Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Document and prepare CCM installation #113

Merged
merged 7 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ cluster.yaml

# release
out/

#testing stuff
clusterctl-settings.json
8 changes: 7 additions & 1 deletion docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,13 @@ KUBECONFIG=ionos-quickstart.kubeconfig kubectl get nodes

### Installing a CNI

TODO(gfariasalves): Add instructions about installing a CNI or available flavours
<!-- TODO(gfariasalves): Add instructions about installing a CNI or available flavours -->

### Installing a Cloud Controller Manager

We provide a helm chart for the Cloud Controller Manager for IONOS Cloud.
Refer to its [README](https://github.com/ionos-cloud/cloud-provider-ionoscloud/tree/main/charts/ionoscloud-cloud-controller-manager/README.md)
for detailed installation instructions.

### Cleanup

Expand Down
34 changes: 32 additions & 2 deletions templates/cluster-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -197,21 +197,47 @@ spec:
path: /etc/ie-csi/cfg.json
permissions: '0644'

- content: |
#!/bin/bash
set -e

# Nothing to do for kubernetes < v1.29
KUBEADM_MINOR="$(kubeadm version -o short | cut -d '.' -f 2)"
if [[ "$KUBEADM_MINOR" -lt "29" ]]; then
exit 0
fi

NODE_IPv4_ADDRESS=$(ip -j addr show dev ens6 | jq -r '.[].addr_info[] | select(.family == "inet") | select(.scope=="global") | select(.dynamic) | .local')
if [[ $NODE_IPv4_ADDRESS ]]; then
sed -i '$ s/$/ --node-ip '"$NODE_IPv4_ADDRESS"'/' /etc/default/kubelet
fi
# IPv6 currently not set, the ip is not set then this runs. Needs to be waited for.
NODE_IPv6_ADDRESS=$(ip -j addr show dev ens6 | jq -r '.[].addr_info[] | select(.family == "inet6") | select(.scope=="global") | .local')
if [[ $NODE_IPv6_ADDRESS ]]; then
sed -i '$ s/$/ --node-ip '"$NODE_IPv6_ADDRESS"'/' /etc/default/kubelet
fi
owner: root:root
path: /etc/set-node-ip.sh
permissions: '0700'

preKubeadmCommands:
- systemctl restart systemd-networkd.service systemd-modules-load.service systemd-journald containerd
# disable swap
- swapoff -a
- sed -i '/ swap / s/^/#/' /etc/fstab
- sysctl --system
- /etc/kube-vip-prepare.sh
# workaround 1.29 IP issue
- /etc/set-node-ip.sh
postKubeadmCommands:
- >
sed -i 's#path: /etc/kubernetes/super-admin.conf#path: /etc/kubernetes/admin.conf#' \
/etc/kubernetes/manifests/kube-vip.yaml
- >
systemctl disable --now udisks2 multipathd motd-news.timer fwupd-refresh.timer
packagekit ModemManager snapd snapd.socket snapd.apparmor snapd.seeded
# TODO(jriedel-ionos): remove that if we have a CCM
# INFO(schegi-ionos): We decided to not remove this for now, since removing this would require the ccm to be installed for cluster-api
# to continue after the first node.
- export system_uuid=$(kubectl --kubeconfig /etc/kubernetes/kubelet.conf get node $(hostname) -ojsonpath='{..systemUUID }')
- >
kubectl --kubeconfig /etc/kubernetes/kubelet.conf
Expand All @@ -227,6 +253,9 @@ spec:
joinConfiguration:
nodeRegistration:
criSocket: unix:///run/containerd/containerd.sock
kubeletExtraArgs:
# use cloud-provider: external when using a CCM
cloud-provider: ""
version: "${KUBERNETES_VERSION}"
---
kind: IonosCloudMachineTemplate
Expand Down Expand Up @@ -345,7 +374,8 @@ spec:
- >
systemctl disable --now udisks2 multipathd motd-news.timer fwupd-refresh.timer
packagekit ModemManager snapd snapd.socket snapd.apparmor snapd.seeded
# TODO(jriedel-ionos): remove that if we have a CCM
# INFO(schegi-ionos): We decided to not remove this for now, since removing this would require the ccm to be
# installed for cluster-api to continue after the first node.
- export system_uuid=$(kubectl --kubeconfig /etc/kubernetes/kubelet.conf get node $(hostname) -ojsonpath='{..systemUUID }')
- >
kubectl --kubeconfig /etc/kubernetes/kubelet.conf
Expand Down
Loading