Skip to content

Commit

Permalink
Chmod kubeconfig to avoid group-readable (#6800)
Browse files Browse the repository at this point in the history
After upgrading to newer Kubernetes(v1.17 at least), kubectl command
shows the following warning message:

  WARNING: Kubernetes configuration file is group-readable.
  This is insecure. Location: /home/foo/.kube/config

The kubeconfig was copied from {{ artifacts_dir }}/admin.conf with
kubeconfig_localhost feature. It is better to set valid file mode
at getting it on Kubespray.
  • Loading branch information
oomichi authored Oct 9, 2020
1 parent 64f6971 commit e6c2898
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion roles/kubernetes/client/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
copy:
content: "{{ final_admin_kubeconfig | to_nice_yaml(indent=2) }}"
dest: "{{ artifacts_dir }}/admin.conf"
mode: 0640
mode: 0600
delegate_to: localhost
connection: local
become: no
Expand Down

0 comments on commit e6c2898

Please sign in to comment.