When using the clusterctl
you can generate your own cluster spec from a
template.
This is what happens when you run:
$ clusterctl config cluster <cluster-name> --infrastructure packet >
out/cluster.yaml
The workflow triggered by that command summarized here:
- Based on the
--infrastructure
option it goes to the right repository and it looks for thelatest
release. At the time I am writing it is v0.3.0. clusterctl
lookup a file calledcluster-template.yaml
from the release artifactsclusterctl
usescluster-template.yaml
plus a set of environment variables that you can find described in the README.md to generate the cluster specification- With the command
> out/cluster.yaml
the generated spec gets moved to./out/cluster.yaml
other than being printed tostdout
.
This is good if you do not have particular needs or if you are trying capp.
The current cluster-templates.yaml
uses apt
and it depends upon Ubuntu
.
But you can open and modify it to match your requirements.
Every time you feel like the default one is not enough, or if you need more automation. Here a few examples:
- ClusterAPI decided to leave the CNI configuration out from its workflow
because there are too many of them. If you want to automate that part and
let's suppose you want
flannel
you can add the following line topostKubeadmCommands
for theKubeadmControlPlane
resource:
kubectl --kubeconfig /etc/kubernetes/admin.conf apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
-
If you want to use an operating system that is not Ubuntu you can change the
preKubeadmCommands
for theKubeadmControlPlane
and theKubeadmConfigTemplate
to use kubernetes binaries or a different package manager. -
(2a) If you want to change operating system you have to change the
OS
field for thePacketMachineTemplate
resource