apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: code-server
  name: code-server
  namespace: workshopctl
spec:
  selector:
    matchLabels:
      app: code-server
  template:
    metadata:
      labels:
        app: code-server
    spec:
      containers:
      - env:
        - name: GIT_REPO
          value: https://github.com/praqma-training/kubernetes-katas
        - name: GIT_SUBDIR
          value: tutorials
        - name: PASSWORD
          valueFrom:
            secretKeyRef:
              key: VSCODE_PASSWORD
              name: praqma
        image: praqma/vscode:1.39.2
        imagePullPolicy: Always
        name: code-server
        ports:
        - containerPort: 8080
          name: http
        volumeMounts:
        - mountPath: /home/coder/.kube
          name: kubeconfig
        - mountPath: /var/run/docker.sock
          name: docker
      serviceAccountName: code-server
      volumes:
      - configMap:
          name: code-server
        name: kubeconfig
      - hostPath:
          path: /var/run/docker.sock
        name: docker
