Skip to content

Commit

Permalink
Update Harvester Helm chart to support custom RKE2 CIDRs in node prom…
Browse files Browse the repository at this point in the history
…otion

config

During installation, these custom values would have been added to the
Harvester's ManagedChart config at
/etc/rancher/rancherd/config.yaml.d/10-harvester.yaml. See
harvester/harvester-installer#886.

Signed-off-by: Ivan Sim <[email protected]>
  • Loading branch information
ihcsim committed Dec 13, 2024
1 parent ef97c6c commit 6e530f7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
8 changes: 5 additions & 3 deletions deploy/charts/harvester/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,20 @@ data:
echo Waiting for bootstrap object of $CUSTOM_MACHINE...
sleep 2
done
`}}
VIP=$($KUBECTL get configmap vip -n harvester-system -o=jsonpath='{.data.ip}')
cat > /host/etc/rancher/rke2/config.yaml.d/90-harvester-server.yaml <<EOF
cni: multus,canal
cluster-cidr: 10.52.0.0/16
service-cidr: 10.53.0.0/16
cluster-dns: 10.53.0.10
cluster-cidr: {{ .Values.promote.clusterPodCIDR }}
service-cidr: {{ .Values.promote.clusterServiceCIDR }}
cluster-dns: {{ .Values.promote.clusterDNS }}
tls-san:
- $VIP
audit-policy-file: /etc/rancher/rke2/config.yaml.d/92-harvester-kube-audit-policy.yaml
EOF
{{`
# Disable snapshot-controller related charts because we manage them in Harvester.
# RKE2 enables these charts by default after v1.25.7 (https://github.com/rancher/rke2/releases/tag/v1.25.7%2Brke2r1)
cat > /host/etc/rancher/rke2/config.yaml.d/40-disable-charts.yaml <<EOF
Expand Down
8 changes: 8 additions & 0 deletions deploy/charts/harvester/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -550,3 +550,11 @@ snapshot-validation-webhook:
enableLonghornNetworkPolicy: true

enableGoCoverDir: false

# these cluster network configuration are used by node promotion controller.
# their values must match those provided during Harvester installation, and
# cannot be modified post-installation.
promote:
clusterPodCIDR: 10.52.0.0/16
clusterServiceCIDR: 10.53.0.0/16
clusterDNS: 10.53.0.10

0 comments on commit 6e530f7

Please sign in to comment.