Update MetalLB how to with instructions for k8s 1.25+#1291
Update MetalLB how to with instructions for k8s 1.25+#1291openshift-merge-robot merged 2 commits intoopenshift:mainfrom
Conversation
|
Thank you, @kevchu3. |
|
/assign @ggiguash |
|
Hi @ggiguash, Here are my thoughts on applying this to the nginx example application. As a best practices, end user OpenShift (and subsequently MicroShift) applications should not be running as privileged pods (i.e. root). The recommendations for the metallb-system load balancers are different as they are part of the infrastructure and may require root. I looked into the docker.io/library/nginx:1.18 image that was being used, and it is indeed intended to be run as root, which may be fine with other k8s distros but is not best practices for MicroShift. In fact, a quick traversal of the image showed mostly all of the filesystem including configurations needed by nginx are owned by root user and group. That being said, the proper approach would likely be to select another base image that adheres to OpenShift standards of running non-privileged containers. However, I couldn't immediately find one that was consumable for nginx which didn't require us to build from source. The other item to call out for our nginx application is that there is no deprecated/removed PodSecurityPolicy being applied in the manifests. Thus, the issues affecting this nginx application when deploying in OpenShift are entirely different, and have persisted well before k8s 1.25+ removed PodSecurityPolicy. Anyways, I'll walk through a hack workaround to resolve the issue for purposes of testing. Here are my results: First, I ran the original instructions: Which subsequently runs into the issue you've observed where the pod can't modify files on the filesystem. Note that I then apply the privileged annotation to the namespace. Note that However, this isn't sufficient because the pod still expects to run as the high UID (in my case 1000160000). What we need to do is set I'd like to hear your thoughts on whether we should move forward with this example for purposes of testing, before I go ahead and update the PR to include these changes. |
|
@kevchu3, I think your suggestion makes a lot of sense. The purpose of this example is to demonstrate MetalLB load balancing, so having a simple-enough test is preferrable. Please, update the PR with your proposal. Is only running as root user sufficient, or we also need to apply scc? |
|
Looks like the SCC is required. Here's what happens when I create the namespace and workload but don't apply the SCC. I'll create a PR with your latest recommendations. |
|
/label tide/merge-method-squash |
|
@kevchu3 , thank you for your help. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ggiguash, kevchu3 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@kevchu3: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Which issue(s) this PR addresses: #1290
Closes #1290