-
Notifications
You must be signed in to change notification settings - Fork 123
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
Add Host process examples #161
Add Host process examples #161
Conversation
9ff49ce
to
6ce8bcf
Compare
securityContext: | ||
windowsOptions: | ||
hostProcess: true | ||
runAsUserName: "NT AUTHORITY\\system" |
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.
Can we use NT AUTHORITY\\NetworkService
here?
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.
It is on my list to try this. local system
did not work because calls to HNS apis failed silently
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.
The network service doesn't work either, I think there were some folder permissions or something, I can't quite remember but I was hoping to use network service as well!
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.
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.
No not off the top of my head, I can ask some hns folks
d47fa61
to
20c89d1
Compare
20c89d1
to
b310003
Compare
22fa649
to
d2542e0
Compare
# and CNI network config file on each node. | ||
- name: install-cni | ||
image: sigwindowstools/calico-install:v3.20.0-hostprocess | ||
args: ["$env:CONTAINER_SANDBOX_MOUNT_POINT/calico/install.ps1"] |
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.
what interprets this envvar? normally, envvars would be specified in args as $(CONTAINER_SANDBOX_MOUNT_POINT)/calico/install.ps1
(https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/#using-environment-variables-inside-of-your-config)
- name: calico-node-startup | ||
image: sigwindowstools/calico-node:v3.20.0-hostprocess | ||
args: ["$env:CONTAINER_SANDBOX_MOUNT_POINT/calico/node-service.ps1"] | ||
workingDir: "$env:CONTAINER_SANDBOX_MOUNT_POINT/calico/" |
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.
same question about what component evaluates/expands this envvar... are envvars normally usable inside workingDir?
it looks like the kubelet only expands envvars in command/args, and workingdir is passed as-is to the runtime:
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.
These variables are set for processes created inside the container by hcsshim (for both normal and hostProcess containers). Windows will expand and environment variables found in the command line when it tries to runt he process / entry point for the container.
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.
The runtime sets and evaluates these ENV variables as part of its path processing. We can't use the approach in https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/#using-environment-variables-inside-of-your-config) since it is not known until runtime since that value is set by hcsschim.
Using the vars, technically shouldn't be necessary for hostprocess but we found some bugs in hcsshim around arg and Working directory path processing. With the approach that we are evaluating now this env variable won't be necessary any longer as the container will be given its own filesystem (thought it still has access to the host filesystem unlike on linux).
For reference these are the fixes that are in being worked on until the new approach is validated:
microsoft/hcsshim#1137
microsoft/hcsshim#1117
cc: @dcantah
Can we update the 1.22.1 references to 1.22.2? |
Other than that I think this is ready to merge (and we can iterate later if needed) |
Co-authored-by: Mark Rossetti <marosset@microsoft.com>
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.
/lgtm
I think this is ready to merge. We can iterate if needed.
Thanks for all this work @jsturtevant
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jsturtevant, marosset The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Please make sigwindowstools/flannel-tools:v0.14.0-hostprocess as public. Currently we don't have access to the image. |
@vitaliy-leschenko It should be |
Reason for PR:
Start providing some examples of how to use hostprocess
Issue Fixed:
Issue #
Requirements
Notes:
This is meant to be an example to start testing things out. Not ready for production.