This article provides a daemonset that can be applied on Guest Clusters to update the vmware-system-user password expiry, allowing SSH sessions to Guest Cluster nodes if required
Symptoms:
VMware vSphere 7.0 with Tanzu
Change the vmware-system-user password expiry on Existing Clusters using the following daemonset:
# cat <<EOF>> pass_expiry.yaml
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: cluster-admin
spec:
selector:
matchLabels:
tkgs: cluster-admin
template:
metadata:
labels:
tkgs: cluster-admin
spec:
volumes:
- name: hostfs
hostPath:
path: /
initContainers:
- name: init
image: ubuntu:23.04
command:
- /bin/sh
- -xc
- |
chroot /host chage -l vmware-system-user \
&& chroot /host chage -m 0 -M -1 vmware-system-user \
&& echo expiry updated \
&& chroot /host chage -l vmware-system-user \
&& echo done
volumeMounts:
- name: hostfs
mountPath: /host
containers:
- name: sleep
image: localhost:5000/vmware.io/pause:3.6
tolerations:
- effect: NoSchedule
key: node-role.kubernetes.io/control-plane
operator: Exists
- effect: NoSchedule
key: node-role.kubernetes.io/master
operator: Exists
- key: CriticalAddonsOnly
operator: Exists
- effect: NoExecute
key: node.alpha.kubernetes.io/notReady
operator: Exists
- effect: NoExecute
key: node.alpha.kubernetes.io/unreachable
operator: Exists
- effect: NoSchedule
key: kubeadmNode
operator: Equal
value: master
EOF
# kubectl vsphere login --insecure-skip-tls-verify --server <SUPERVISOR_VIP> --tanzu-kubernetes-cluster-namespace <GUEST_CLUSTER_NAMESPACE> --tanzu-kubernetes-cluster-name <GUEST_CLUSTER_NAME>
# kubectl apply -f pass_expiry.yaml
*Important*:
In newer TKC versions supported on vSphere 7.x and 8.x, the DaemonSet fails to configure the vmware-system-user
account to never expire on the control plane (master) nodes.
To resolve this, the toleration for running on the control plane nodes was updated as follows:
-
effect: "NoSchedule"
key: "node-role.kubernetes.io/control-plane"
operator: "Exists"