-
Notifications
You must be signed in to change notification settings - Fork 35
flux: Readme: Improve documentation #291
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,10 +67,15 @@ spec: | |
- command: | ||
- /bin/sh | ||
- -c | ||
- mkdir -p /build/plugins && cp -r /plugins/* /build/plugins/ | ||
- mkdir -p /build/plugins && cp -r /plugins/* /build/plugins/ && chown -R 100:101 /build | ||
image: ghcr.io/headlamp-k8s/headlamp-plugin-flux:latest | ||
imagePullPolicy: Always | ||
name: headlamp-plugins | ||
securityContext: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This part here is required because of the Could you please add a comment to there explaining why it's necessary? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The securityContext overwrite the USER headlamp non root user. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, that makes sense now. Thanks. Could you please add a comment about that in there for future readers? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I can, it's not a big deal. WDYT? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Umm i don't understand this change we already did chwon above so we would not want to run this as root right?? maybe this is what we need here
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it's true. What is the user who run this cmd? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
runAsNonRoot: false | ||
privileged: false | ||
runAsUser: 0 | ||
runAsGroup: 0 | ||
volumeMounts: | ||
- mountPath: /build/plugins | ||
name: headlamp-plugins | ||
|
@@ -85,5 +90,34 @@ spec: | |
volumes: | ||
- name: headlamp-plugins | ||
persistentVolumeClaim: | ||
claimName: headlamp | ||
claimName: headlamp # The name of the Helm release | ||
``` | ||
|
||
As alternative, you can also use the Use EmptyDir (Ephemeral Shared Volume) to pass files from the init containers to the main container. | ||
|
||
```yaml | ||
config: | ||
pluginsDir: /build/plugins | ||
initContainers: | ||
- command: | ||
- /bin/sh | ||
- -c | ||
- mkdir -p /build/plugins && cp -r /plugins/* /build/plugins/ && chown -R 100:101 /build | ||
image: ghcr.io/headlamp-k8s/headlamp-plugin-flux:latest | ||
imagePullPolicy: Always | ||
name: headlamp-plugins | ||
securityContext: | ||
runAsNonRoot: false | ||
privileged: false | ||
runAsUser: 0 | ||
runAsGroup: 0 | ||
volumeMounts: | ||
- mountPath: /build/plugins | ||
name: headlamp-plugins | ||
volumeMounts: | ||
- mountPath: /build/plugins | ||
name: headlamp-plugins | ||
volumes: | ||
- name: headlamp-plugins | ||
emptyDir: {} | ||
``` |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh... I just realised the 100:101 here is the headlamp user and group from the alpine headlamp Dockerfile container?
Can we use
chown -R headlamp:headlamp /build
here instead?How about a comment explaining why the chown is necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
https://github.com/headlamp-k8s/plugins/blob/main/Dockerfile#L45
Actually we can improve also this line, to define exactly the number of the group to be more clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, but it's not a true way, because from image to image the number of the
headlamp
group could be diff.It's a better to update the Dockerfile to set up a static number, smth like:
I can update it, WDYT ?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I understand I think... so if someone uses headlamp:headlamp in say their own custom Debian image maybe it's different from an alpine image?
Yeah, I think it's a good change to make.