apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: jupyterhub
    chart: jupyterhub-1.2.0
    component: hub
    heritage: Helm
    release: RELEASE-NAME
  name: hub
spec:
  replicas: 1
  selector:
    matchLabels:
      app: jupyterhub
      component: hub
      release: RELEASE-NAME
  strategy:
    type: Recreate
  template:
    metadata:
      annotations:
        checksum/config-map: e2407bf8968a66be17c02a45b3a07fa55bd1548931d0c2dde5b599fda028b6ea
        checksum/secret: f89a203b949e370cbe840e5802215b1747d57426f14019a548d6259bf3067a03
      labels:
        app: jupyterhub
        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"
        release: RELEASE-NAME
    spec:
      affinity:
        nodeAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
          - preference:
              matchExpressions:
              - key: hub.jupyter.org/node-purpose
                operator: In
                values:
                - core
            weight: 100
      containers:
      - args:
        - jupyterhub
        - --config
        - /usr/local/etc/jupyterhub/jupyterhub_config.py
        - --upgrade-db
        env:
        - name: PYTHONUNBUFFERED
          value: "1"
        - name: HELM_RELEASE_NAME
          value: RELEASE-NAME
        - name: POD_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: CONFIGPROXY_AUTH_TOKEN
          valueFrom:
            secretKeyRef:
              key: hub.config.ConfigurableHTTPProxy.auth_token
              name: hub
        image: jupyterhub/k8s-hub:1.2.0
        livenessProbe:
          failureThreshold: 30
          httpGet:
            path: /hub/health
            port: http
          initialDelaySeconds: 300
          periodSeconds: 10
          timeoutSeconds: 3
        name: hub
        ports:
        - containerPort: 8081
          name: http
        readinessProbe:
          failureThreshold: 1000
          httpGet:
            path: /hub/health
            port: http
          initialDelaySeconds: 0
          periodSeconds: 2
          timeoutSeconds: 1
        securityContext:
          allowPrivilegeEscalation: false
          runAsGroup: 1000
          runAsUser: 1000
        volumeMounts:
        - mountPath: /usr/local/etc/jupyterhub/jupyterhub_config.py
          name: config
          subPath: jupyterhub_config.py
        - mountPath: /usr/local/etc/jupyterhub/z2jh.py
          name: config
          subPath: z2jh.py
        - mountPath: /usr/local/etc/jupyterhub/config/
          name: config
        - mountPath: /usr/local/etc/jupyterhub/secret/
          name: secret
        - mountPath: /srv/jupyterhub
          name: pvc
      nodeSelector: {}
      securityContext:
        fsGroup: 1000
      serviceAccountName: hub
      tolerations:
      - effect: NoSchedule
        key: hub.jupyter.org/dedicated
        operator: Equal
        value: core
      - effect: NoSchedule
        key: hub.jupyter.org_dedicated
        operator: Equal
        value: core
      volumes:
      - configMap:
          name: hub
        name: config
      - name: secret
        secret:
          secretName: hub
      - name: pvc
        persistentVolumeClaim:
          claimName: hub-db-dir
