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

chore: Add ability to the helm chart to specify initContainers. #7668

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions charts/karpenter/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ spec:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
{{- with .Values.initContainers }}
initContainers:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand Down
5 changes: 5 additions & 0 deletions charts/karpenter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ dnsConfig: {}
# options:
# - name: ndots
# value: "1"
# -- add additional initContainers to run before karpenter container starts
initContainers: {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an interesting use-case. Why can't you just ensure that your permissions are correct (and/or) see the failure once Karpenter starts OR rely on something like #7624 to ensure this

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Validating IAM Credentials is one common use of initContainers and the one we want to check (and for which #7624 may help), but initContainers can also be used for other use cases specific to each cluster maintainer's needs.

# - name: list-ec2-instances
# image: amazon/aws-cli:latest
# command: [ 'aws', 'ec2', 'describe-instance-types']
# -- Node selectors to schedule the pod to nodes with labels.
nodeSelector:
kubernetes.io/os: linux
Expand Down