Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PE-6036: update kubelet and certs file perms to 600 #169

Merged
merged 1 commit into from
Jan 29, 2025
Merged
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
15 changes: 15 additions & 0 deletions scripts/kube-reconfigure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,20 @@ regenerate_etcd_manifests() {
sleep 60
}

update_file_permissions() {
chmod 600 /var/lib/kubelet/config.yaml
chmod 600 /etc/systemd/system/kubelet.service

if [ -f /etc/kubernetes/pki/ca.crt ]; then
chmod 600 /etc/kubernetes/pki/ca.crt
fi

if [ -f /etc/kubernetes/proxy.conf ]; then
chown root:root /etc/kubernetes/proxy.conf
chmod 600 /etc/kubernetes/proxy.conf
fi
}

if [ "$node_role" != "worker" ];
then
regenerate_kube_components_manifests
Expand All @@ -121,4 +135,5 @@ then
fi
regenerate_kubelet_config
regenerate_kubelet_envs
update_file_permissions
restart_kubelet
Loading