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

[Kiali-operator Helm Chart] Mount /tmp instead of /tmp/ansible-operator/runner as emptyDir to enable read-only root filesystem #6888

Closed
eli-gc opened this issue Nov 27, 2023 · 7 comments · Fixed by kiali/helm-charts#235 or kiali/kiali-operator#729
Assignees
Labels
enhancement This is the preferred way to describe new end-to-end features. requires helm chart PR requires operator PR It requires update in operator code

Comments

@eli-gc
Copy link

eli-gc commented Nov 27, 2023

I came across an issue when trying to enable read-only root filesystem for Kiali-operator. The operator tries to write to kubeconfig in /tmp directory of the root filesystem. There is an existing emptyDir mount for /tmp/ansible-operator/runner for the ansible logging volume. I am proposing that /tmp be mounted to this emptyDir instead. This should preserve previous functionality of the Ansible logging volume while also enabling read only root filesystem.

This work is related to #5810

I'm going to test this and will make a PR if no one has any objections.

@eli-gc eli-gc added the enhancement This is the preferred way to describe new end-to-end features. label Nov 27, 2023
@eli-gc eli-gc changed the title [Kiali-operator] Mount /tmp instead of /tmp/ansible-operator/runner as emptyDir to enable read-only root filesystem [Kiali-operator Helm Chart] Mount /tmp instead of /tmp/ansible-operator/runner as emptyDir to enable read-only root filesystem Nov 27, 2023
@eli-gc
Copy link
Author

eli-gc commented Nov 28, 2023

I'm testing the mounting but I am having trouble with ansible trying to write to /opt/ansible/.ansible/tmp. Anyone know if there is a way to change this path?

@eli-gc
Copy link
Author

eli-gc commented Nov 28, 2023

I tried to set DEFAULT_LOCAL_TMP = /tmp and I confirmed this env variable is set in my container, but Ansible is still writing to /opt/ansible/.ansible/tmp

@jmazzitelli
Copy link
Collaborator

I don't know the answer; sounds like a good question to ask the ansible operator SDK folks here: https://github.com/operator-framework/ansible-operator-plugins/issues/new?assignees=&labels=&projects=&template=support-question.md&title=

@eli-gc
Copy link
Author

eli-gc commented Nov 29, 2023

Haven't heard back from Ansible, but I was able to get it to work by mounting another ephemeral volume for /opt/ansible/.ansible/tmp.

@jmazzitelli
Copy link
Collaborator

Here's the answer I was told:

DEFAULT_LOCAL_TMP is the configuration name;
the env var is ANSIBLE_LOCAL_TEMP
https://docs.ansible.com/ansible/latest/reference_appendices/config.html#default-local-tmp

@eli-gc
Copy link
Author

eli-gc commented Nov 29, 2023

I tried it and it works! Thank you so much!

@jmazzitelli
Copy link
Collaborator

Thanks, @eli-gc ... looks good... All merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This is the preferred way to describe new end-to-end features. requires helm chart PR requires operator PR It requires update in operator code
Projects
2 participants