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

kube-controller-manager pod fails to be created with kube-controller-manager-extra-mount flag #7422

Open
skanakal opened this issue Dec 12, 2024 · 2 comments
Assignees

Comments

@skanakal
Copy link

skanakal commented Dec 12, 2024

Environmental Info:
RKE2 Version: v1.31.3+rke2r1

Node(s) CPU architecture, OS, and Version: x86_64, Ubuntu, 22.04

Cluster Configuration:

Describe the bug:

kube-controller-manager pod fails to be created with kube-controller-manager-extra-mount flag

Steps To Reproduce:

  • Installed RKE2:
#/etc/rancher/rke2/config.yaml
      kube-controller-manager-extra-mount:
        - /tmp/example.txt:/tmp/example.txt
        - /var/lib/rancher/rke2/server/logs/:/var/lib/rancher/rke2/server/logs

Expected behavior:

  - hostPath:
      path: /tmp/example.txt
      type: File
    name: extra-mount-0
  - hostPath:
      path: /var/lib/rancher/rke2/server/logs/
      type: DirectoryOrCreate
    name: extra-mount-1

Actual behavior:

tail -f /var/lib/rancher/rke2/agent/pod-manifests/kube-controller-manager.yaml 
    name: file9
  - hostPath:
      path: /tmp/example.txt
      type: File
    name: extra-mount-0
  - hostPath:
      path: /var/lib/rancher/rke2/server/logs/
      type: File
    name: extra-mount-1

Additional context / logs:

https://jira.suse.com/browse/SURE-9493

@brandond
Copy link
Member

brandond commented Dec 12, 2024

How the mount is handled depends on whether or not something exists at that path, and if so, what kind of file it is. If you want to set the mount type manually, instead of having RKE2 try to guess it for you, use the four-parameter form, where the 3rd parameter is the mode (rw/ro) and the 4th is the mount type.

 kube-controller-manager-extra-mount:
- /var/lib/rancher/rke2/server/logs/:/var/lib/rancher/rke2/server/logs:rw:DirectoryOrCreate

@brandond
Copy link
Member

brandond commented Dec 12, 2024

Edit: Ahh, I see that there is incorrect behavior if there are multiple entries that should be of different types, but the type is left auto-detected instead of manually specified.

As a workaround, I'd suggest manually specifying the type in all the entries, as shown above.

@brandond brandond reopened this Dec 12, 2024
@brandond brandond self-assigned this Dec 12, 2024
@brandond brandond added this to the 2025-01 Release Cycle milestone Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants