[bitnami/jupyterhub] Support for customizing standard labels (#18555)

This commit is contained in:
Juan Ariza Toledano
2023-08-23 17:13:45 +02:00
committed by GitHub
parent 3220c1806c
commit ced91cc89f
27 changed files with 113 additions and 219 deletions

View File

@@ -1,9 +1,9 @@
dependencies:
- name: postgresql
repository: oci://registry-1.docker.io/bitnamicharts
version: 12.8.3
version: 12.9.0
- name: common
repository: oci://registry-1.docker.io/bitnamicharts
version: 2.8.0
digest: sha256:3e0d01f64a38d3e892f9b44ed3f8bf43b82c3011f3d16cd021de491520699f5f
generated: "2023-08-19T20:48:01.182675879Z"
version: 2.9.0
digest: sha256:3e3373b4d5b1b1fce1711b2f257e9e2414ef3287484581210a7a9f044d872943
generated: "2023-08-23T12:42:27.243297+02:00"

View File

@@ -37,4 +37,4 @@ maintainers:
name: jupyterhub
sources:
- https://github.com/bitnami/charts/tree/main/bitnami/jupyterhub
version: 4.1.11
version: 4.2.0

View File

@@ -7,11 +7,8 @@ SPDX-License-Identifier: APACHE-2.0
apiVersion: v1
kind: ConfigMap
metadata:
labels: {{- include "common.labels.standard" . | nindent 4 }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: hub
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
name: {{ include "jupyterhub.hub.name" . }}
namespace: {{ .Release.Namespace | quote }}
{{- if .Values.commonAnnotations }}

View File

@@ -8,11 +8,8 @@ kind: Deployment
metadata:
name: {{ include "jupyterhub.hub.name" . }}
namespace: {{ .Release.Namespace | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: hub
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
@@ -20,8 +17,9 @@ spec:
{{- if .Values.hub.updateStrategy }}
strategy: {{- toYaml .Values.hub.updateStrategy | nindent 4 }}
{{- end }}
{{- $podLabels := merge .Values.hub.podLabels .Values.commonLabels }}
selector:
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
app.kubernetes.io/component: hub
template:
metadata:
@@ -35,14 +33,11 @@ spec:
{{- if empty .Values.hub.existingSecret }}
checksum/hub-secret: {{ include (print $.Template.BasePath "/hub/secret.yaml") . | sha256sum }}
{{- end }}
labels: {{- include "common.labels.standard" . | nindent 8 }}
labels: {{- include "common.labels.standard" ( dict "customLabels" $podLabels "context" $ ) | nindent 8 }}
app.kubernetes.io/component: hub
hub.jupyter.org/network-access-proxy-api: "true"
hub.jupyter.org/network-access-proxy-http: "true"
hub.jupyter.org/network-access-singleuser: "true"
{{- if .Values.hub.podLabels }}
{{- include "common.tplvalues.render" (dict "value" .Values.hub.podLabels "context" $) | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ template "jupyterhub.hubServiceAccountName" . }}
{{- include "jupyterhub.imagePullSecrets" . | nindent 6 }}
@@ -53,8 +48,8 @@ spec:
affinity: {{- include "common.tplvalues.render" ( dict "value" .Values.hub.affinity "context" $) | nindent 8 }}
{{- else }}
affinity:
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.hub.podAffinityPreset "component" "hub" "context" $) | nindent 10 }}
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.hub.podAntiAffinityPreset "component" "hub" "context" $) | nindent 10 }}
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.hub.podAffinityPreset "component" "hub" "customLabels" $podLabels "context" $) | nindent 10 }}
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.hub.podAntiAffinityPreset "component" "hub" "customLabels" $podLabels "context" $) | nindent 10 }}
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.hub.nodeAffinityPreset.type "key" .Values.hub.nodeAffinityPreset.key "values" .Values.hub.nodeAffinityPreset.values) | nindent 10 }}
{{- end }}
{{- if .Values.hub.nodeSelector }}

View File

@@ -8,10 +8,7 @@ apiVersion: v1
kind: Secret
metadata:
name: {{ printf "%s-%s" .Release.Name "externaldb" | trunc 63 | trimSuffix "-" }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: hub
namespace: {{ .Release.Namespace | quote }}
{{- if .Values.commonAnnotations }}

View File

@@ -7,19 +7,17 @@ SPDX-License-Identifier: APACHE-2.0
apiVersion: {{ include "common.capabilities.networkPolicy.apiVersion" . }}
kind: NetworkPolicy
metadata:
labels: {{- include "common.labels.standard" . | nindent 4 }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: hub
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
name: {{ include "jupyterhub.hub.name" . }}
namespace: {{ .Release.Namespace | quote }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
{{- $hubPodLabels := merge .Values.hub.podLabels .Values.commonLabels }}
podSelector:
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $hubPodLabels "context" $ ) | nindent 6 }}
app.kubernetes.io/component: hub
policyTypes:
- Ingress
@@ -55,15 +53,16 @@ spec:
- ports:
- port: {{ .Values.proxy.containerPort.api }}
to:
{{- $proxyPodLabels := merge .Values.proxy.podLabels .Values.commonLabels }}
- podSelector:
matchLabels: {{- include "common.labels.matchLabels" . | nindent 14 }}
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $proxyPodLabels "context" $ ) | nindent 14 }}
app.kubernetes.io/component: proxy
# Hub --> Single User
- ports:
- port: {{ .Values.singleuser.containerPort }}
to:
- podSelector:
matchLabels: {{- include "common.labels.matchLabels" . | nindent 14 }}
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 14 }}
app.kubernetes.io/component: singleuser
## DNS access
- ports:

View File

@@ -9,18 +9,16 @@ kind: PodDisruptionBudget
metadata:
name: {{ include "jupyterhub.hub.name" . }}
namespace: {{ .Release.Namespace | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: hub
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
minAvailable: {{ .Values.hub.pdb.minAvailable }}
maxUnavailable: {{ .Values.hub.pdb.maxUnavailable }}
{{- $podLabels := merge .Values.hub.podLabels .Values.commonLabels }}
selector:
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
app.kubernetes.io/component: hub
{{- end }}

View File

@@ -9,11 +9,8 @@ apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ printf "%s-hub" (include "common.names.fullname" .) }}
namespace: {{ .Release.Namespace | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: hub
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}

View File

@@ -9,11 +9,8 @@ apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ include "jupyterhub.hub.name" . }}
namespace: {{ .Release.Namespace | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: hub
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}

View File

@@ -9,11 +9,8 @@ kind: Secret
metadata:
name: {{ include "jupyterhub.hub.name" . }}
namespace: {{ .Release.Namespace | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: hub
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}

View File

@@ -9,17 +9,11 @@ kind: ServiceAccount
metadata:
name: {{ template "jupyterhub.hubServiceAccountName" . }}
namespace: {{ .Release.Namespace | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: hub
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
annotations:
{{- if .Values.commonAnnotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.hub.serviceAccount.annotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.hub.serviceAccount.annotations "context" $ ) | nindent 4 }}
{{- end }}
{{- if or .Values.hub.serviceAccount.annotations .Values.commonAnnotations }}
{{- $annotations := merge .Values.hub.serviceAccount.annotations .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
{{- end }}
automountServiceAccountToken: {{ .Values.hub.serviceAccount.automountServiceAccountToken }}
{{- end }}

View File

@@ -8,18 +8,12 @@ kind: Service
metadata:
name: {{ include "jupyterhub.hub.name" . }}
namespace: {{ .Release.Namespace | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: hub
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
annotations:
{{- if .Values.commonAnnotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.hub.service.annotations }}
{{- include "common.tplvalues.render" (dict "value" .Values.hub.service.annotations "context" $) | nindent 4 }}
{{- end }}
{{- if or .Values.hub.service.annotations .Values.commonAnnotations }}
{{- $annotations := merge .Values.hub.service.annotations .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.hub.service.type }}
{{- if and .Values.hub.service.clusterIP (eq .Values.hub.service.type "ClusterIP") }}
@@ -53,5 +47,6 @@ spec:
{{- if .Values.hub.service.extraPorts }}
{{- include "common.tplvalues.render" (dict "value" .Values.hub.service.extraPorts "context" $) | nindent 4 }}
{{- end }}
selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
{{- $podLabels := merge .Values.hub.podLabels .Values.commonLabels }}
selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: hub

View File

@@ -9,19 +9,10 @@ apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "jupyterhub.hub.name" . }}
{{- if .Values.hub.metrics.serviceMonitor.namespace }}
namespace: {{ .Values.hub.metrics.serviceMonitor.namespace }}
{{- else }}
namespace: {{ .Release.Namespace }}
{{- end }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
namespace: {{ default .Release.Namespace .Values.hub.metrics.serviceMonitor.namespace | quote }}
{{- $labels := merge .Values.hub.metrics.serviceMonitor.labels .Values.commonLabels }}
labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: hub
{{- if .Values.hub.metrics.serviceMonitor.labels }}
{{- include "common.tplvalues.render" (dict "value" .Values.hub.metrics.serviceMonitor.labels "context" $) | nindent 4 }}
{{- end }}
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
@@ -51,7 +42,7 @@ spec:
matchNames:
- {{ .Release.Namespace }}
selector:
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 6 }}
{{- if .Values.hub.metrics.serviceMonitor.selector }}
{{- include "common.tplvalues.render" (dict "value" .Values.hub.metrics.serviceMonitor.selector "context" $) | nindent 6 }}
{{- end }}

View File

@@ -9,11 +9,8 @@ kind: DaemonSet
metadata:
name: {{ printf "%s-image-puller" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
namespace: {{ .Release.Namespace | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: image-puller
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
@@ -21,19 +18,17 @@ spec:
{{- if .Values.imagePuller.updateStrategy }}
updateStrategy: {{- toYaml .Values.imagePuller.updateStrategy | nindent 4 }}
{{- end }}
{{- $podLabels := merge .Values.imagePuller.podLabels .Values.commonLabels }}
selector:
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
app.kubernetes.io/component: image-puller
template:
metadata:
{{- if .Values.imagePuller.podAnnotations }}
annotations: {{- include "common.tplvalues.render" (dict "value" .Values.imagePuller.podAnnotations "context" $) | nindent 8 }}
{{- end }}
labels: {{- include "common.labels.standard" . | nindent 8 }}
labels: {{- include "common.labels.standard" ( dict "customLabels" $podLabels "context" $ ) | nindent 8 }}
app.kubernetes.io/component: image-puller
{{- if .Values.imagePuller.podLabels }}
{{- include "common.tplvalues.render" (dict "value" .Values.imagePuller.podLabels "context" $) | nindent 8 }}
{{- end }}
spec:
{{- include "jupyterhub.imagePullSecrets" . | nindent 6 }}
{{- if .Values.imagePuller.hostAliases }}
@@ -43,8 +38,8 @@ spec:
affinity: {{- include "common.tplvalues.render" ( dict "value" .Values.imagePuller.affinity "context" $) | nindent 8 }}
{{- else }}
affinity:
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.imagePuller.podAffinityPreset "component" "image-puller" "context" $) | nindent 10 }}
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.imagePuller.podAntiAffinityPreset "component" "image-puller" "context" $) | nindent 10 }}
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.imagePuller.podAffinityPreset "component" "image-puller" "customLabels" $podLabels "context" $) | nindent 10 }}
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.imagePuller.podAntiAffinityPreset "component" "image-puller" "customLabels" $podLabels "context" $) | nindent 10 }}
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.imagePuller.nodeAffinityPreset.type "key" .Values.imagePuller.nodeAffinityPreset.key "values" .Values.imagePuller.nodeAffinityPreset.values) | nindent 10 }}
{{- end }}
{{- if .Values.imagePuller.nodeSelector }}

View File

@@ -8,11 +8,8 @@ kind: Deployment
metadata:
name: {{ include "jupyterhub.proxy.name" . }}
namespace: {{ .Release.Namespace | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: proxy
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
@@ -20,8 +17,9 @@ spec:
{{- if .Values.proxy.updateStrategy }}
strategy: {{- toYaml .Values.proxy.updateStrategy | nindent 4 }}
{{- end }}
{{- $podLabels := merge .Values.proxy.podLabels .Values.commonLabels }}
selector:
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
app.kubernetes.io/component: proxy
template:
metadata:
@@ -30,13 +28,10 @@ spec:
{{- include "common.tplvalues.render" (dict "value" .Values.proxy.podAnnotations "context" $) | nindent 8 }}
{{- end }}
checksum/hub-secret: {{ include (print $.Template.BasePath "/hub/secret.yaml") . | sha256sum }}
labels: {{- include "common.labels.standard" . | nindent 8 }}
labels: {{- include "common.labels.standard" ( dict "customLabels" $podLabels "context" $ ) | nindent 8 }}
app.kubernetes.io/component: proxy
hub.jupyter.org/network-access-hub: "true"
hub.jupyter.org/network-access-singleuser: "true"
{{- if .Values.proxy.podLabels }}
{{- include "common.tplvalues.render" (dict "value" .Values.proxy.podLabels "context" $) | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ template "jupyterhub.proxyServiceAccountName" . }}
automountServiceAccountToken: {{ .Values.proxy.automountServiceAccountToken }}
@@ -48,8 +43,8 @@ spec:
affinity: {{- include "common.tplvalues.render" ( dict "value" .Values.proxy.affinity "context" $) | nindent 8 }}
{{- else }}
affinity:
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.proxy.podAffinityPreset "component" "proxy" "context" $) | nindent 10 }}
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.proxy.podAntiAffinityPreset "component" "proxy" "context" $) | nindent 10 }}
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.proxy.podAffinityPreset "component" "proxy" "customLabels" $podLabels "context" $) | nindent 10 }}
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.proxy.podAntiAffinityPreset "component" "proxy" "customLabels" $podLabels "context" $) | nindent 10 }}
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.proxy.nodeAffinityPreset.type "key" .Values.proxy.nodeAffinityPreset.key "values" .Values.proxy.nodeAffinityPreset.values) | nindent 10 }}
{{- end }}
{{- if .Values.proxy.nodeSelector }}

View File

@@ -8,21 +8,16 @@ apiVersion: {{ include "common.capabilities.ingress.apiVersion" . }}
kind: Ingress
metadata:
name: {{ include "common.names.fullname" . }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: proxy
namespace: {{ .Release.Namespace | quote }}
annotations:
{{- if .Values.proxy.ingress.certManager }}
kubernetes.io/tls-acme: "true"
{{- end }}
{{- if .Values.proxy.ingress.annotations }}
{{- include "common.tplvalues.render" (dict "value" .Values.proxy.ingress.annotations "context" $) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- if or .Values.proxy.ingress.annotations .Values.commonAnnotations }}
{{- $annotations := merge .Values.proxy.ingress.annotations .Values.commonAnnotations }}
{{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
{{- end }}
spec:
{{- if and .Values.proxy.ingress.ingressClassName (include "common.ingress.supportsIngressClassname" .) }}

View File

@@ -7,19 +7,17 @@ SPDX-License-Identifier: APACHE-2.0
apiVersion: {{ include "common.capabilities.networkPolicy.apiVersion" . }}
kind: NetworkPolicy
metadata:
labels: {{- include "common.labels.standard" . | nindent 4 }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: proxy
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
name: {{ include "jupyterhub.proxy.name" . }}
namespace: {{ .Release.Namespace | quote }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
{{- $proxyPodLabels := merge .Values.proxy.podLabels .Values.commonLabels }}
podSelector:
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $proxyPodLabels "context" $ ) | nindent 6 }}
app.kubernetes.io/component: proxy
policyTypes:
- Ingress
@@ -47,16 +45,16 @@ spec:
- ports:
- port: {{ coalesce .Values.hub.containerPorts.http .Values.hub.containerPort }}
to:
{{- $hubPodLabels := merge .Values.hub.podLabels .Values.commonLabels }}
- podSelector:
matchLabels: {{- include "common.labels.matchLabels" . | nindent 14 }}
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $hubPodLabels "context" $ ) | nindent 14 }}
app.kubernetes.io/component: hub
# Proxy --> Single User
- ports:
- port: {{ .Values.singleuser.containerPort }}
to:
- podSelector:
matchLabels:
{{- include "common.labels.matchLabels" . | nindent 14 }}
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 14 }}
app.kubernetes.io/component: singleuser
## DNS access
- ports:

View File

@@ -7,17 +7,18 @@ SPDX-License-Identifier: APACHE-2.0
apiVersion: {{ include "common.capabilities.policy.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/component: proxy
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
name: {{ include "jupyterhub.proxy.name" . }}
namespace: {{ .Release.Namespace | quote }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: proxy
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
minAvailable: {{ .Values.proxy.pdb.minAvailable }}
maxUnavailable: {{ .Values.proxy.pdb.maxUnavailable }}
{{- $podLabels := merge .Values.proxy.podLabels .Values.commonLabels }}
selector:
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
app.kubernetes.io/component: proxy
{{- end }}

View File

@@ -9,17 +9,11 @@ kind: ServiceAccount
metadata:
name: {{ template "jupyterhub.proxyServiceAccountName" . }}
namespace: {{ .Release.Namespace | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: proxy
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
annotations:
{{- if .Values.commonAnnotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.proxy.serviceAccount.annotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.proxy.serviceAccount.annotations "context" $ ) | nindent 4 }}
{{- end }}
{{- if or .Values.proxy.serviceAccount.annotations .Values.commonAnnotations }}
{{- $annotations := merge .Values.proxy.serviceAccount.annotations .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
{{- end }}
automountServiceAccountToken: {{ .Values.proxy.serviceAccount.automountServiceAccountToken }}
{{- end }}

View File

@@ -8,18 +8,12 @@ kind: Service
metadata:
name: {{ printf "%s-proxy-api" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
namespace: {{ .Release.Namespace | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: proxy
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
annotations:
{{- if .Values.commonAnnotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.proxy.service.api.annotations }}
{{- include "common.tplvalues.render" (dict "value" .Values.proxy.service.api.annotations "context" $) | nindent 4 }}
{{- end }}
{{- if or .Values.proxy.service.api.annotations .Values.commonAnnotations }}
{{- $annotations := merge .Values.proxy.service.api.annotations .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.proxy.service.api.type }}
{{- if and .Values.proxy.service.api.clusterIP (eq .Values.proxy.service.api.type "ClusterIP") }}
@@ -53,5 +47,6 @@ spec:
{{- if .Values.proxy.service.api.extraPorts }}
{{- include "common.tplvalues.render" (dict "value" .Values.proxy.service.api.extraPorts "context" $) | nindent 4 }}
{{- end }}
selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
{{- $podLabels := merge .Values.proxy.podLabels .Values.commonLabels }}
selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: proxy

View File

@@ -10,18 +10,12 @@ kind: Service
metadata:
name: {{ printf "%s-proxy-metrics" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
namespace: {{ .Release.Namespace | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: proxy
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
annotations:
{{- if .Values.commonAnnotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.proxy.service.metrics.annotations }}
{{- include "common.tplvalues.render" (dict "value" .Values.proxy.service.metrics.annotations "context" $) | nindent 4 }}
{{- end }}
{{- if or .Values.proxy.service.metrics.annotations .Values.commonAnnotations }}
{{- $annotations := merge .Values.proxy.service.metrics.annotations .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.proxy.service.metrics.type }}
{{- if and .Values.proxy.service.metrics.clusterIP (eq .Values.proxy.service.metrics.type "ClusterIP") }}
@@ -55,6 +49,7 @@ spec:
{{- if .Values.proxy.service.metrics.extraPorts }}
{{- include "common.tplvalues.render" (dict "value" .Values.proxy.service.metrics.extraPorts "context" $) | nindent 4 }}
{{- end }}
selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
{{- $podLabels := merge .Values.proxy.podLabels .Values.commonLabels }}
selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: proxy
{{- end }}

View File

@@ -8,18 +8,12 @@ kind: Service
metadata:
name: {{ printf "%s-proxy-public" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
namespace: {{ .Release.Namespace | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: proxy
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
annotations:
{{- if .Values.commonAnnotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.proxy.service.public.annotations }}
{{- include "common.tplvalues.render" (dict "value" .Values.proxy.service.public.annotations "context" $) | nindent 4 }}
{{- end }}
{{- if or .Values.proxy.service.public.annotations .Values.commonAnnotations }}
{{- $annotations := merge .Values.proxy.service.public.annotations .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.proxy.service.public.type }}
{{- if and .Values.proxy.service.public.clusterIP (eq .Values.proxy.service.public.type "ClusterIP") }}
@@ -53,5 +47,6 @@ spec:
{{- if .Values.proxy.service.public.extraPorts }}
{{- include "common.tplvalues.render" (dict "value" .Values.proxy.service.public.extraPorts "context" $) | nindent 4 }}
{{- end }}
selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
{{- $podLabels := merge .Values.proxy.podLabels .Values.commonLabels }}
selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: proxy

View File

@@ -9,19 +9,10 @@ apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ printf "%s-proxy-api" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
{{- if .Values.proxy.metrics.serviceMonitor.namespace }}
namespace: {{ .Values.proxy.metrics.serviceMonitor.namespace }}
{{- else }}
namespace: {{ .Release.Namespace }}
{{- end }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
namespace: {{ default .Release.Namespace .Values.proxy.metrics.serviceMonitor.namespace | quote }}
{{- $labels := merge .Values.proxy.metrics.serviceMonitor.labels .Values.commonLabels }}
labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: proxy
{{- if .Values.proxy.metrics.serviceMonitor.labels }}
{{- include "common.tplvalues.render" (dict "value" .Values.proxy.metrics.serviceMonitor.labels "context" $) | nindent 4 }}
{{- end }}
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
@@ -51,7 +42,7 @@ spec:
matchNames:
- {{ .Release.Namespace }}
selector:
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 6 }}
{{- if .Values.proxy.metrics.serviceMonitor.selector }}
{{- include "common.tplvalues.render" (dict "value" .Values.proxy.metrics.serviceMonitor.selector "context" $) | nindent 6 }}
{{- end }}

View File

@@ -11,10 +11,7 @@ kind: Secret
metadata:
name: {{ .name }}
namespace: {{ $.Release.Namespace | quote }}
labels: {{- include "common.labels.standard" $ | nindent 4 }}
{{- if $.Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" $.Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
labels: {{- include "common.labels.standard" ( dict "customLabels" $.Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: proxy
{{- if $.Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" $.Values.commonAnnotations "context" $ ) | nindent 4 }}
@@ -35,10 +32,7 @@ kind: Secret
metadata:
name: {{ $secretName }}
namespace: {{ .Release.Namespace | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}

View File

@@ -7,11 +7,8 @@ SPDX-License-Identifier: APACHE-2.0
apiVersion: {{ include "common.capabilities.networkPolicy.apiVersion" . }}
kind: NetworkPolicy
metadata:
labels: {{- include "common.labels.standard" . | nindent 4 }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: singleuser
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
name: {{ printf "%s-singleuser" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
namespace: {{ .Release.Namespace | quote }}
{{- if .Values.commonAnnotations }}
@@ -19,7 +16,7 @@ metadata:
{{- end }}
spec:
podSelector:
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 6 }}
app.kubernetes.io/component: singleuser
policyTypes:
- Ingress
@@ -47,8 +44,9 @@ spec:
- ports:
- port: {{ coalesce .Values.hub.containerPorts.http .Values.hub.containerPort }}
to:
{{- $hubPodLabels := merge .Values.hub.podLabels .Values.commonLabels }}
- podSelector:
matchLabels: {{- include "common.labels.matchLabels" . | nindent 14 }}
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $hubPodLabels "context" $ ) | nindent 14 }}
app.kubernetes.io/component: hub
{{- if not .Values.singleuser.networkPolicy.allowCloudMetadataAccess }}
## Limit access to the Cloud Metadata API

View File

@@ -9,17 +9,11 @@ kind: ServiceAccount
metadata:
name: {{ template "jupyterhub.singleuserServiceAccountName" . }}
namespace: {{ .Release.Namespace | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: singleuser
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
annotations:
{{- if .Values.commonAnnotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.singleuser.serviceAccount.annotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.singleuser.serviceAccount.annotations "context" $ ) | nindent 4 }}
{{- end }}
{{- if or .Values.singleuser.serviceAccount.annotations .Values.commonAnnotations }}
{{- $annotations := merge .Values.singleuser.serviceAccount.annotations .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
{{- end }}
automountServiceAccountToken: {{ .Values.singleuser.serviceAccount.automountServiceAccountToken }}
{{- end }}

View File

@@ -166,10 +166,7 @@ hub:
extraLabels:
hub.jupyter.org/network-access-hub: "true"
app.kubernetes.io/component: singleuser
{{- include "common.labels.standard" . | nindent 4 }}
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- if .Values.singleuser.podLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.singleuser.podLabels "context" $ ) | nindent 4 }}
{{- end }}
@@ -200,7 +197,7 @@ hub:
{{- end }}
extraLabels:
app.kubernetes.io/component: singleuser
{{- include "common.labels.standard" . | nindent 6 }}
{{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 6 }}
{{- if .Values.singleuser.extraVolumes }}
extraVolumes: {{- include "common.tplvalues.render" ( dict "value" .Values.singleuser.extraVolumes "context" $ ) | nindent 4 }}
{{- end }}