apiVersion: v1
kind: Pod
metadata:
  name: konnectivity-server
  namespace: kube-system
  annotations:
    scheduler.alpha.kubernetes.io/critical-pod: ''
    seccomp.security.alpha.kubernetes.io/pod: 'docker/default'
spec:
  hostNetwork: true
  containers:
  - name: konnectivity-server-container
    image: ${PROXY_IMAGE}:${TAG}
    resources:
      requests:
        cpu: 1m
    command: [ "/proxy-server"]
    args: [
      "--log-file=/var/log/konnectivity-server.log",
      "--logtostderr=false",
      "--log-file-max-size=0",
      "--uds-name=/etc/srv/kubernetes/konnectivity-server/konnectivity-server.socket",
      "--cluster-cert=/etc/srv/kubernetes/pki/apiserver.crt",
      "--cluster-key=/etc/srv/kubernetes/pki/apiserver.key",
      "--server-port=0",
      "--agent-port=8091",
      "--health-port=8092",
      "--admin-port=8093",
      "--keepalive-time=1h",
      "--mode=http-connect",
      "--agent-namespace=kube-system",
      "--agent-service-account=konnectivity-agent",
      "--kubeconfig=/etc/srv/kubernetes/konnectivity-server/kubeconfig",
      "--authentication-audience=system:konnectivity-server",
      ]
    livenessProbe:
      httpGet:
        scheme: HTTP
        host: 127.0.0.1
        port: 8092
        path: /healthz
      initialDelaySeconds: 10
      timeoutSeconds: 60
    ports:
    - name: serverport
      containerPort: 8090
      hostPort: 8090
    - name: agentport
      containerPort: 8091
      hostPort: 8091
    - name: healthport
      containerPort: 8092
      hostPort: 8092
    - name: adminport
      containerPort: 8093
      hostPort: 8093
    volumeMounts:
    - name: varlogkonnectivityserver
      mountPath: /var/log/konnectivity-server.log
      readOnly: false
    - name: pki
      mountPath: /etc/srv/kubernetes/pki
      readOnly: true
    - name: konnectivity-home
      mountPath: /etc/srv/kubernetes/konnectivity-server
  volumes:
  - name: varlogkonnectivityserver
    hostPath:
      path: /var/log/konnectivity-server.log
      type: FileOrCreate
  - name: pki
    hostPath:
      path: /etc/srv/kubernetes/pki
  - name: konnectivity-home
    hostPath:
      path: /etc/srv/kubernetes/konnectivity-server
      type: DirectoryOrCreate
