apiVersion: apps/v1
kind: DaemonSet
metadata:
  labels:
    k8s-app: gitlab-authn
  name: gitlab-authn
  namespace: kube-system
spec:
  selector:
    matchLabels:
      k8s-app: gitlab-authn
  template:
    metadata:
      labels:
        k8s-app: gitlab-authn
      annotations:
        scheduler.alpha.kubernetes.io/critical-pod: ''
    spec:
      containers:
      - image: xjjo/kube-gitlab-authn
        imagePullPolicy: Always
        env:
          - name: GITLAB_API_ENDPOINT
            value: https://gitlab.com/api/v4/
          # Simple root group:
          # - name: GITLAB_ROOT_GROUP
          #   value: my-root-group
          #
          # Arbitrary regexp (not ewill also match sub-groups e.g. my-root-group/kube-team1):
          # - name: GITLAB_GROUP_RE
          #   value: '^my-root-group/kube-.+$'
          #
          # If and-only-if GITLAB_PROJECT_RE is set, then *also* add projects membership
          # as if there where subgroups
          # - name: GITLAB_PROJECT_RE
          #   value: '^my-root-group/.+course.+'
        name: gitlab-authn
        ports:
        - containerPort: 3000
          hostPort: 3000
          protocol: TCP
      hostNetwork: true
      tolerations:
      - key: node-role.kubernetes.io/master
        effect: NoSchedule
      nodeSelector:
        node-role.kubernetes.io/master: ""
      restartPolicy: Always
