Fix SELinux context for local-path provisioner
This commit is contained in:
parent
7e78625cff
commit
21f4c81832
1 changed files with 10 additions and 0 deletions
|
|
@ -204,9 +204,19 @@
|
|||
- "/var/lib/rancher/k3s"
|
||||
- "/var/lib/rancher/k3s/server"
|
||||
- "/var/lib/rancher/k3s/server/manifests"
|
||||
- "/var/lib/rancher/k3s/storage"
|
||||
when:
|
||||
- kubernetes_master|bool
|
||||
|
||||
# semanage fcontext -a -t container_file_t "/var/lib/rancher/k3s/storage(/.*)?"
|
||||
- name: Allow K3S local-path provisioner to create directories in /var/lib/rancher/k3s/storage
|
||||
community.general.sefcontext:
|
||||
target: '/var/lib/rancher/k3s/storage(/.*)?'
|
||||
setype: container_file_t
|
||||
state: present
|
||||
- name: Apply new SELinux file context to filesystem
|
||||
ansible.builtin.command: restorecon -R /var/lib/rancher/k3s/storage/
|
||||
|
||||
- name: Deploy Network Policies
|
||||
ansible.builtin.template:
|
||||
src: "{{ item }}.j2"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue