Skip to content

Commit

Permalink
add workaround to get both container logs working and server join wor…
Browse files Browse the repository at this point in the history
…king without controlPlaneEndpoint registration support on rke2
  • Loading branch information
AshleyDumaine committed Mar 4, 2024
1 parent 915bce5 commit 48252b6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions templates/flavors/rke2/rke2ConfigTemplate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ spec:
kubelet:
extraArgs:
- "provider-id=linode://{{ ds.meta_data.id }}"
# TODO: use MDS to get public and private IP instead because hostname ordering can't always be assumed
preRKE2Commands:
- |
mkdir -p /etc/rancher/rke2/config.yaml.d/
echo "node-ip: $(hostname -I | grep -oE 192\.168\.[0-9]+\.[0-9]+)" >> /etc/rancher/rke2/config.yaml.d/capi-config.yaml
- sed -i '/swap/d' /etc/fstab
- swapoff -a
- hostnamectl set-hostname '{{ ds.meta_data.label }}' && hostname -F /etc/hostname
4 changes: 4 additions & 0 deletions templates/flavors/rke2/rke2ControlPlane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ spec:
name: linode-${CLUSTER_NAME}-crs-0
owner: root:root
path: /var/lib/rancher/rke2/server/manifests/linode-token-region.yaml
registrationMethod: internal-only-ips
serverConfig:
cni: cilium
cloudProviderName: external
Expand All @@ -36,6 +37,9 @@ spec:
extraArgs:
- "provider-id=linode://{{ ds.meta_data.id }}"
preRKE2Commands:
- |
mkdir -p /etc/rancher/rke2/config.yaml.d/
echo "node-ip: $(hostname -I | grep -oE 192\.168\.[0-9]+\.[0-9]+)" >> /etc/rancher/rke2/config.yaml.d/capi-config.yaml
- sed -i '/swap/d' /etc/fstab
- swapoff -a
- hostnamectl set-hostname '{{ ds.meta_data.label }}' && hostname -F /etc/hostname
Expand Down

0 comments on commit 48252b6

Please sign in to comment.