Table of Contents generated with DocToc
The clusterctl
image is designed to run independently to provision ibmcloud cluster. We have embedded the kind
and kubectl
into clusterctl
image.
-
Follow this readme to generate
cluster.yaml
,machines.yaml
,provider-components.yaml
, andaddons.yaml
-
Create
serviceAccount
for clusterctl runningkubectl apply -f examples/clusterctl/serviceaccount.yaml
-
Create
configmap
withcluster.yaml
,machines.yaml
,provider-components.yaml
.kubectl create configmap ibmcloud-config --from-file=./cluster.yaml \ --from-file=./machines.yaml --from-file=./provider-components.yaml
Optionally, add a
addons.yaml
can provide additional add-ons in target cluster. You need to createconfigmap
withaddons.yaml
kubectl create configmap ibmcloud-config --from-file=./cluster.yaml \ --from-file=./machines.yaml --from-file=./provider-components.yaml \ --from-file=./addons.yaml
and modify the
examples/clusterctl/job.yaml
to append-a /examples/addons.yaml
forclusterctl create
command. -
Create
secret
to store the ssh private keykubectl create secret generic ibmcloud-ssh-key-secret \ --from-file=id_ibmcloud=/root/.ssh/id_ibmcloud
-
Create clusterrole and clusterrolebinding by apply the examples/clusterrole.yaml and examples/clusterrolebinding.yaml
kubectl apply -f examples/clusterctl/clusterrole.yaml kubectl apply -f examples/clusterctl/clusterrolebinding.yaml
-
Create job to generate ibmcloud cluster
kubectl apply -f examples/clusterctl/job.yaml
-
After the job completes successfully, it creates a secret to store the
kubeconfig
. You can save it to access the remote cluster. for example:kubectl get secret kubeconfig -ojsonpath={.data.kubeconfig} \ | base64 -d > /tmp/kubeconfig
-
Now it is ready to access the remote cluster
kubectl --kubeconfig /tmp/kubeconfig get ns NAME STATUS AGE default Active 4m11s ibmcloud-provider-system Active 3m52s kube-node-lease Active 4m14s kube-public Active 4m14s kube-system Active 4m14s system Active 4m11s