3939make local-dev
4040` ` `
4141
42- Run controller against the cluster :
42+ Now you can either run the controller locally or in-cluster.
43+
44+ # ## Running locally
45+
46+ Run controller locally against the cluster :
4347
4448` ` `
4549make run
4650` ` `
4751
48- Since the controller is running outside the Kind cluster, you need to make api server accessible (on a separate terminal) :
52+ Since the controller is running outside the Kind cluster, you need to make the
53+ API server accessible to the controller. You can do this by running a proxy :
4954
5055` ` `
56+ # on a separate terminal
5157sudo kubectl proxy --port=8081
5258` ` `
5359
54- # ## Testing in Local Cluster
60+ See [below](#required-configuration) for how to properly setup the RBAC for the
61+ locally running controller.
62+
63+ # ## Running in-cluster
64+
65+ Run controller in-cluster :
66+
67+ ` ` `
68+ make local-deploy
69+ ` ` `
70+
71+ See [below](#required-configuration) for how to properly setup the RBAC for the
72+ locally running controller.
73+
74+ # ## Required configuration
5575
56761. Prepare provider config for the local cluster :
57- 1. If provider kubernetes running in the cluster (e.g. provider installed with crossplane) :
77+ 1. If provider kubernetes running in the cluster (e.g. provider installed with crossplane or using `make local-deploy` ) :
5878
5979 ```
6080 SA=$(kubectl -n crossplane-system get sa -o name | grep provider-kubernetes | sed -e 's|serviceaccount\/|crossplane-system:|g')
@@ -65,7 +85,7 @@ sudo kubectl proxy --port=8081
6585
6686 ```
6787 KUBECONFIG=$(kind get kubeconfig --name local-dev | sed -e 's|server:\s*.*$|server : http://localhost:8081|g')
68- kubectl -n crossplane-system create secret generic cluster-config --from-literal=kubeconfig="${KUBECONFIG}"
88+ kubectl -n crossplane-system create secret generic cluster-config --from-literal=kubeconfig="${KUBECONFIG}"
6989 kubectl apply -f examples/provider/config.yaml
7090 ```
7191
@@ -77,6 +97,8 @@ sudo kubectl proxy --port=8081
7797
7898# ## Cleanup
7999
100+ To delete the local kind cluster :
101+
80102` ` `
81- make local .down
103+ make controlplane .down
82104` ` `
0 commit comments