Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,26 @@

echo "Backing up kube-controller-manager manifest..."
cp -a "$MANIFEST" "$BACKUP"

# -----------------------------------------
# Update --controllers= argument
# -----------------------------------------
OLD="--controllers=*,bootstrapsigner,tokencleaner"
NEW="--controllers=*,nodeipam,nodelifecycle,bootstrapsigner,tokencleaner"

echo "Checking and updating controllers argument in: $BACKUP"

# Detect ANY existing --controllers= line (with or without OLD)
if grep -Fq -- "--controllers=" "$BACKUP"; then
echo "Existing controllers line found. Updating..."
# Replace entire existing controllers argument safely
sed -i "s|.*--controllers=.*| - $NEW|" "$BACKUP"
else
echo "No controllers line found. Adding new one..."
# Insert after the kube-controller-manager entry
sed -i "/- kube-controller-manager/a \ \ \ \ - $NEW" "$BACKUP"
fi


for ARG in "${ARGS[@]}"; do
if grep -Fq -- "$ARG" "$BACKUP"; then
Expand Down Expand Up @@ -644,7 +664,22 @@
sleep 10
fi
done


#update the kubelet config.yaml
CONFIG_FILE="/var/lib/kubelet/config.yaml"

# Update or add the parameters
sed -i 's|^nodeStatusUpdateFrequency:.*|nodeStatusUpdateFrequency: 5s|' $CONFIG_FILE
sed -i 's|^nodeStatusReportFrequency:.*|nodeStatusReportFrequency: 10s|' $CONFIG_FILE
sed -i 's|^syncFrequency:.*|syncFrequency: 10s|' $CONFIG_FILE

# If a key is missing, append it
grep -q "^nodeStatusUpdateFrequency:" $CONFIG_FILE || echo "nodeStatusUpdateFrequency: 5s" >> $CONFIG_FILE
grep -q "^nodeStatusReportFrequency:" $CONFIG_FILE || echo "nodeStatusReportFrequency: 10s" >> $CONFIG_FILE
grep -q "^syncFrequency:" $CONFIG_FILE || echo "syncFrequency: 10s" >> $CONFIG_FILE

# Restart kubelet to apply changes
systemctl restart kubelet

echo "Installing plugins"
echo "Installing nfs-client-provisioner"
Expand Down Expand Up @@ -866,6 +901,20 @@
fi
fi

FILE="/opt/omnia/csi-driver-powerscale/values.yaml" # <-- update with actual path

echo "Updating arrayConnectivityPollRate in: $FILE"

if grep -Fq -- "--arrayConnectivityPollRate=60" "$FILE"; then
echo "Found existing poll rate 60. Updating to 20..."
sed -i 's/--arrayConnectivityPollRate=60/--arrayConnectivityPollRate=20/g' "$FILE"
else
echo "No poll rate value 60 found. Nothing to change."
fi

echo "Done updating poll rate."


if [ "$POWERSCALE_DEPLOYMENT_FAILED" -eq 0 ]; then
echo "===== Running CSI PowerScale installation script ====="
INSTALL_SCRIPT="/opt/omnia/csi-driver-powerscale/csi-powerscale/dell-csi-helm-installer/csi-install.sh"
Expand Down Expand Up @@ -1009,4 +1058,4 @@
kubectl get pods --all-namespaces -o wide
echo "Cloud-Init finished successfully after the reboot."

fi
fi
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,25 @@
echo "Backing up kube-controller-manager manifest..."
cp -a "$MANIFEST" "$BACKUP"

# -----------------------------------------
# Update --controllers= argument
# -----------------------------------------
OLD="--controllers=*,bootstrapsigner,tokencleaner"
NEW="--controllers=*,nodeipam,nodelifecycle,bootstrapsigner,tokencleaner"

echo "Checking and updating controllers argument in: $BACKUP"

# Detect ANY existing --controllers= line (with or without OLD)
if grep -Fq -- "--controllers=" "$BACKUP"; then
echo "Existing controllers line found. Updating..."
# Replace entire existing controllers argument safely
sed -i "s|.*--controllers=.*| - $NEW|" "$BACKUP"
else
echo "No controllers line found. Adding new one..."
# Insert after the kube-controller-manager entry
sed -i "/- kube-controller-manager/a \ \ \ \ - $NEW" "$BACKUP"
fi

for ARG in "${ARGS[@]}"; do
if grep -Fq -- "$ARG" "$BACKUP"; then
echo "Already present: $ARG"
Expand All @@ -414,6 +433,20 @@
echo "Updating the kubelet arguments."
sed -i 's/^shutdownGracePeriod:.*/shutdownGracePeriod: 30s/' /var/lib/kubelet/config.yaml
sed -i 's/^shutdownGracePeriodCriticalPods:.*/shutdownGracePeriodCriticalPods: 10s/' /var/lib/kubelet/config.yaml

#update the kubelet config.yaml
CONFIG_FILE="/var/lib/kubelet/config.yaml"

# Update or add the parameters
sed -i 's|^nodeStatusUpdateFrequency:.*|nodeStatusUpdateFrequency: 5s|' $CONFIG_FILE
sed -i 's|^nodeStatusReportFrequency:.*|nodeStatusReportFrequency: 10s|' $CONFIG_FILE
sed -i 's|^syncFrequency:.*|syncFrequency: 10s|' $CONFIG_FILE

# If a key is missing, append it
grep -q "^nodeStatusUpdateFrequency:" $CONFIG_FILE || echo "nodeStatusUpdateFrequency: 5s" >> $CONFIG_FILE
grep -q "^nodeStatusReportFrequency:" $CONFIG_FILE || echo "nodeStatusReportFrequency: 10s" >> $CONFIG_FILE
grep -q "^syncFrequency:" $CONFIG_FILE || echo "syncFrequency: 10s" >> $CONFIG_FILE

systemctl daemon-reload
systemctl restart kubelet

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,26 @@
else
echo "WARNING: /etc/kubernetes/kubelet.conf not found. Kubelet may not be initialized yet."
fi

#update the kubelet config.yaml
CONFIG_FILE="/var/lib/kubelet/config.yaml"

# Update or add the parameters
sed -i 's|^nodeStatusUpdateFrequency:.*|nodeStatusUpdateFrequency: 5s|' $CONFIG_FILE
sed -i 's|^nodeStatusReportFrequency:.*|nodeStatusReportFrequency: 10s|' $CONFIG_FILE
sed -i 's|^syncFrequency:.*|syncFrequency: 10s|' $CONFIG_FILE

# If a key is missing, append it
grep -q "^nodeStatusUpdateFrequency:" $CONFIG_FILE || echo "nodeStatusUpdateFrequency: 5s" >> $CONFIG_FILE
grep -q "^nodeStatusReportFrequency:" $CONFIG_FILE || echo "nodeStatusReportFrequency: 10s" >> $CONFIG_FILE
grep -q "^syncFrequency:" $CONFIG_FILE || echo "syncFrequency: 10s" >> $CONFIG_FILE

# Restart kubelet to apply changes
systemctl restart kubelet
# Mark initialization complete so all of above is skipped on reboot!
touch "$MARKER"
echo "Cloud-Init has completed successfully."

else
# SUBSEQUENT BOOT - SKIP JOIN
echo "service_kube_node_x86_64 is already part of cluster."
Expand Down