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 1, 2024
1 parent 915bce5 commit 282cbe6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions templates/flavors/rke2/rke2ConfigTemplate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ 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 | awk '{print $2}')" >> /etc/rancher/rke2/config.yaml.d/capi-config.yaml
sed -i "/tls-san:/a - $(hostname -I | awk '{print $1}')" /etc/rancher/rke2/config.yaml
- sed -i '/swap/d' /etc/fstab
- swapoff -a
- hostnamectl set-hostname '{{ ds.meta_data.label }}' && hostname -F /etc/hostname
5 changes: 5 additions & 0 deletions templates/flavors/rke2/rke2ControlPlane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ 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 | awk '{print $2}')" >> /etc/rancher/rke2/config.yaml.d/capi-config.yaml
sed -i "/tls-san:/a - $(hostname -I | awk '{print $1}')" /etc/rancher/rke2/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 282cbe6

Please sign in to comment.