Skip to content

Commit

Permalink
Update node promotion Helm config to override custom RKE2 CIDRs
Browse files Browse the repository at this point in the history
During installation, these custom values would have come from
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 authored and FrankYang0529 committed Dec 18, 2024
1 parent a9cfd04 commit a69db3c
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 a69db3c

Please sign in to comment.