Skip to content

Commit

Permalink
fixed makefile and docs with correct commands
Browse files Browse the repository at this point in the history
  • Loading branch information
deepakm-ntnx committed Jan 3, 2024
1 parent 85c001d commit e93fdd1
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 10 deletions.
13 changes: 9 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ ifeq ($(EXPORT_RESULT), true)
endif

.PHONY: test-cluster-create
test-clusterctl-create: ## Run the tests using clusterctl
test-cluster-create: ## Run the tests using clusterctl
which clusterctl
clusterctl version
clusterctl config repositories | grep nutanix
Expand All @@ -400,7 +400,7 @@ test-clusterctl-create: ## Run the tests using clusterctl
kubectl apply --server-side -f ./cluster.yaml

.PHONY: test-cluster-delete
test-clusterctl-delete: ## Delete clusterctl created cluster
test-cluster-delete: ## Delete clusterctl created cluster
kubectl -n ${TEST_NAMESPACE} delete cluster ${TEST_CLUSTER_NAME} --ignore-not-found

.PHONY: list-bootstrap-resources
Expand All @@ -425,13 +425,18 @@ test-cc-cluster-create: cluster-templates
kubectl apply --server-side -f ./${TEST_CLUSTER_CLASS_NAME}.yaml
kubectl apply --server-side -f ./${TEST_TOPOLOGY_CLUSTER_NAME}.yaml

# .PHONY: test-cc-cluster-upgrade
# test-cc-cluster-upgrade:
# clusterctl generate cluster ${TEST_TOPOLOGY_CLUSTER_NAME} --from ./templates/cluster-template-topology.yaml -n $(TEST_NAMESPACE) > ${TEST_TOPOLOGY_CLUSTER_NAME}.yaml
# kubectl apply --server-side -f ./${TEST_TOPOLOGY_CLUSTER_NAME}.yaml

.PHONY: test-cc-cluster-delete
test-cc-cluster-delete:
kubectl -n $(TEST_NAMESPACE) delete cluster ${TEST_TOPOLOGY_CLUSTER_NAME} --ignore-not-found
kubectl -n $(TEST_NAMESPACE) delete secret ${TEST_TOPOLOGY_CLUSTER_NAME} --ignore-not-found
kubectl -n $(TEST_NAMESPACE) delete cm ${TEST_TOPOLOGY_CLUSTER_NAME}-pc-trusted-ca-bundle --ignore-not-found
rm ${TEST_TOPOLOGY_CLUSTER_NAME}.yaml || true
rm ${TEST_CLUSTER_CLASS_NAME}.yaml || true
rm -f ${TEST_TOPOLOGY_CLUSTER_NAME}.yaml
rm -f ${TEST_CLUSTER_CLASS_NAME}.yaml

.PHONY: generate-cc-cluster-kubeconfig
generate-cc-cluster-kubeconfig:
Expand Down
2 changes: 2 additions & 0 deletions clusterctl.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ WORKER_MACHINE_COUNT: 2 # Number of Machines in the worker node
KUBEVIP_LB_ENABLE: "false" # See https://kube-vip.io/docs/about/architecture/?query=lb_enable#control-plane-load-balancing
KUBEVIP_SVC_ENABLE: "false" # See https://kube-vip.io/docs/about/architecture/?query=lb_enable#kubernetes-service-load-balancing

CLUSTER_CLASS_NAME: "" # ClusterClass Name if any

providers:
# add a custom provider
- name: "nutanix"
Expand Down
37 changes: 31 additions & 6 deletions docs/developer_workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,18 @@ This will configure [kubectl](https://kubernetes.io/docs/reference/kubectl/) for
kubectl get pods -n capx-system
```

## Create a test workload cluster
## Create a test workload cluster without topology

1. Create a workload cluster:

```shell
make test-clusterctl-create
make test-cluster-create
```

Optionally, to use a unique cluster name:

```shell
make test-clusterctl-create TEST_CLUSTER_NAME=<>
make test-cluster-create TEST_CLUSTER_NAME=<>
```

1. Get the workload cluster kubeconfig. This will write out the kubeconfig file in the local directory as `<cluster-name>.workload.kubeconfig`:
Expand All @@ -88,6 +88,20 @@ This will configure [kubectl](https://kubernetes.io/docs/reference/kubectl/) for
make test-kubectl-workload TEST_CLUSTER_NAME=<>
```

## Create a test workload cluster with topology

1. Create a workload cluster:

```shell
make test-cc-cluster-create
```

Optionally, to use a unique cluster name:

```shell
make test-cc-cluster-create TEST_CLUSTER_NAME=<>
```

## Debugging failures

1. Check the cluster resources:
Expand Down Expand Up @@ -123,16 +137,27 @@ This will configure [kubectl](https://kubernetes.io/docs/reference/kubectl/) for

## Cleanup

1. Delete the test workload cluster:
1. Delete the test workload cluster without topology:

```shell
make test-cluster-delete
```

When using a unique cluster name set `TEST_CLUSTER_NAME` variable:

```shell
make test-cluster-delete TEST_CLUSTER_NAME=<>
1. Delete the test workload cluster with topology:
```shell
make test-clusterctl-delete
make test-cc-cluster-delete
```

When using a unique cluster name set `TEST_CLUSTER_NAME` variable:

```shell
make test-clusterctl-delete TEST_CLUSTER_NAME=<>
make test-cluster-delete TEST_CLUSTER_NAME=<>
1. Delete the management KIND cluster:
Expand Down

0 comments on commit e93fdd1

Please sign in to comment.