-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'iam-move' into aws-kubeconfig
- Loading branch information
Showing
9 changed files
with
97 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
hub-templates/basehub/templates/cloud-resources/gcp/_helpers.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{{- define "cloudResources.gcp.serviceAccountName" -}} | ||
{{.Release.Name}}-user-sa | ||
{{- end }} | ||
|
||
{{- define "cloudResources.scratchBucket.name" -}} | ||
{{- if eq .Values.jupyterhub.cloudResources.provider "gcp" -}} | ||
{{ .Values.jupyterhub.cloudResources.gcp.projectId }}-{{ .Release.Name }}-scratch-bucket | ||
{{- end -}} | ||
{{- end }} |
9 changes: 9 additions & 0 deletions
9
hub-templates/basehub/templates/cloud-resources/gcp/env-vars.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{{ if .Values.jupyterhub.cloudResources.scratchBucket.enabled}} | ||
kind: ConfigMap | ||
apiVersion: v1 | ||
metadata: | ||
name: cloud-env-vars | ||
data: | ||
scratch-bucket-name: {{ include "cloudResources.scratchBucket.name" . }} | ||
scratch-bucket-protocol: "gcs" | ||
{{- end }} |
47 changes: 47 additions & 0 deletions
47
hub-templates/basehub/templates/cloud-resources/gcp/service-account.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{{ if .Values.jupyterhub.cloudResources.scratchBucket.enabled}} | ||
apiVersion: iam.cnrm.cloud.google.com/v1beta1 | ||
kind: IAMServiceAccount | ||
metadata: | ||
name: {{ include "cloudResources.gcp.serviceAccountName" . }} | ||
annotations: | ||
cnrm.cloud.google.com/project-id : {{ .Values.jupyterhub.cloudResources.gcp.projectId | quote }} | ||
spec: | ||
displayName: {{ .Release.Name }} hub user service account | ||
--- | ||
apiVersion: iam.cnrm.cloud.google.com/v1beta1 | ||
kind: IAMPolicy | ||
metadata: | ||
name: workload-identity-binding | ||
annotations: | ||
cnrm.cloud.google.com/project-id : {{ .Values.jupyterhub.cloudResources.gcp.projectId | quote }} | ||
spec: | ||
resourceRef: | ||
apiVersion: iam.cnrm.cloud.google.com/v1beta1 | ||
kind: IAMServiceAccount | ||
name: {{ include "cloudResources.gcp.serviceAccountName" . }} | ||
bindings: | ||
- role: roles/iam.workloadIdentityUser | ||
members: | ||
- serviceAccount:{{ .Values.jupyterhub.cloudResources.gcp.projectId }}.svc.id.goog[{{ .Release.Namespace }}/user-sa] | ||
--- | ||
apiVersion: iam.cnrm.cloud.google.com/v1beta1 | ||
kind: IAMPolicyMember | ||
metadata: | ||
name: sa-requester-pays-binding | ||
annotations: | ||
cnrm.cloud.google.com/project-id : {{ .Values.jupyterhub.cloudResources.gcp.projectId | quote }} | ||
spec: | ||
member: serviceAccount:{{ include "cloudResources.gcp.serviceAccountName" . }}@{{ .Values.jupyterhub.cloudResources.gcp.projectId }}.iam.gserviceaccount.com | ||
role: roles/serviceusage.serviceUsageConsumer | ||
resourceRef: | ||
apiVersion: resourcemanager.cnrm.cloud.google.com/v1beta1 | ||
kind: Project | ||
external: projects/{{ .Values.jupyterhub.cloudResources.gcp.projectId }} | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
annotations: | ||
iam.gke.io/gcp-service-account: {{ include "cloudResources.gcp.serviceAccountName" .}}@{{ .Values.jupyterhub.cloudResources.gcp.projectId }}.iam.gserviceaccount.com | ||
name: user-sa | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.