-
Notifications
You must be signed in to change notification settings - Fork 4.6k
helm chart: add Kubernetes Auth options #12314
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 1 commit
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 |
---|---|---|
|
@@ -22,6 +22,9 @@ spec: | |
{{- end }} | ||
spec: | ||
serviceAccountName: {{ include "airbyte.serviceAccountName" . }} | ||
{{- if and .Values.serviceAccount.create .Values.kubernetesAuth.tryServiceAccount }} | ||
automountServiceAccountToken: true | ||
{{- end }} | ||
{{- if .Values.podSweeper.nodeSelector }} | ||
nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.podSweeper.nodeSelector "context" $) | nindent 8 }} | ||
{{- end }} | ||
|
@@ -40,6 +43,16 @@ spec: | |
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.namespace | ||
- name: KUBERNETES_AUTH_TRYSERVICEACCOUNT | ||
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. can we add the link to the fabric client documentation here to make it clear for users what is consuming these? |
||
valueFrom: | ||
configMapKeyRef: | ||
name: airbyte-env | ||
key: KUBERNETES_AUTH_TRYSERVICEACCOUNT | ||
- name: KUBERNETES_AUTH_TRYKUBECONFIG | ||
valueFrom: | ||
configMapKeyRef: | ||
name: airbyte-env | ||
key: KUBERNETES_AUTH_TRYKUBECONFIG | ||
{{- if .Values.podSweeper.containerSecurityContext }} | ||
securityContext: {{- toYaml .Values.podSweeper.containerSecurityContext | nindent 10 }} | ||
{{- end }} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -239,6 +239,16 @@ spec: | |
configMapKeyRef: | ||
name: {{ include "common.names.fullname" . }}-env | ||
key: INTERNAL_API_HOST | ||
- name: KUBERNETES_AUTH_TRYSERVICEACCOUNT | ||
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. what is using these env vars? 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 think you are most likely using a k8s client lib to interact with k8s, eg: https://github.com/fabric8io/kubernetes-client/blob/master/README.md#configuring-the-client 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. Got it. Thanks for the link. 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. same comment here on adding the link to make it clear what is consuming this |
||
valueFrom: | ||
configMapKeyRef: | ||
name: airbyte-env | ||
key: KUBERNETES_AUTH_TRYSERVICEACCOUNT | ||
- name: KUBERNETES_AUTH_TRYKUBECONFIG | ||
valueFrom: | ||
configMapKeyRef: | ||
name: airbyte-env | ||
key: KUBERNETES_AUTH_TRYKUBECONFIG | ||
{{- if .Values.worker.extraEnv }} | ||
{{ .Values.worker.extraEnv | toYaml | nindent 8 }} | ||
{{- end }} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,15 @@ serviceAccount: | |
annotations: {} | ||
name: airbyte-admin | ||
|
||
## Kubernetes Authentication | ||
## Authentication method used by airbyte pods requiring cluster access, eg. worker/pod-sweeper | ||
## @param kubernetesAuth.tryKubeConfig if true, will try to use kube config mounted inside the pod (default: true) | ||
## @param kubernetesAuth.tryServiceAccount if true, will try to use serviceAccount credentials from serviceAccount.name (default: false) | ||
## | ||
kubernetesAuth: | ||
tryKubeConfig: true | ||
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. what does 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. it tells you in the param section a couple of lines up:
I defaulted this to 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. Thanks for the fabric link. I understand this now. What do you think about removing the try kube config option and switching on the service account? I don't think a user would want to want both to be set to true/false so this seems like a clearer configuration option to me. We can have this tryServiceAccount variable be the switch. What do you think? Can we rename
Contributor
Author
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.
Yeah, sounds good - I'll make the changes - I could not think of a use-case for having kube config mounted inside a k8s pod - but did not want to deviate too much, but I agree - it doesn't make sense - I also think that
Yep, will do |
||
tryServiceAccount: false | ||
|
||
## @param version Sets the AIRBYTE_VERSION environment variable. Defaults to Chart.AppVersion. | ||
## If changing the image tags below, you should probably also update this. | ||
version: "" | ||
|
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.
isn't this set to true by default?
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.
I was trying to keep it consistent with the other pod that needs service account token access to k8s https://github.com/airbytehq/airbyte/blob/master/charts/airbyte/templates/worker/deployment.yaml#L22