apiVersion: apps/v1
kind: Deployment
metadata:
  name: kubeconfig-generator
  labels:
    app: kubeconfig-generator
  namespace: kube-system
spec:
  replicas: 1
  selector:
    matchLabels:
      app: kubeconfig-generator
  template:
    metadata:
      labels:
        app: kubeconfig-generator
    spec:
      containers:
      - name: kubeconfig-generator
        image: kairen/kubeconfig-generator:v0.1.0
        args:
        - serve
        - --kube-apiserver-endpoint=https://192.16.35.11:6443
        - --ldap-address=192.16.35.20:389
        - --ldap-dc=dc=k8s,dc=com
        - --user-search-base=ou=People,dc=k8s,dc=com
        - --user-name-attribute=givenName
        - --user-token-arttribute=kubernetesToken
        env:
        - name: GIN_MODE
          value: release
        resources:
          requests:
            cpu: 100m
            memory: 50Mi
        readinessProbe:
          httpGet:
            path: /healthz
            port: 8080
            scheme: HTTP
          failureThreshold: 2
          initialDelaySeconds: 5
          periodSeconds: 10
          timeoutSeconds: 20
        livenessProbe:
          httpGet:
            path: /healthz
            port: 8080
            scheme: HTTP
          failureThreshold: 2
          initialDelaySeconds: 15
          periodSeconds: 15
          timeoutSeconds: 20
        ports:
        - containerPort: 8080
      - name: kubeconfig-generator-ui
        image: kairen/kubeconfig-generator-ui:v0.1.0
        resources:
          requests:
            cpu: 100m
            memory: 50Mi
        readinessProbe:
          tcpSocket:
            port: 9090
          failureThreshold: 2
          initialDelaySeconds: 5
          periodSeconds: 10
          timeoutSeconds: 20
        livenessProbe:
          tcpSocket:
            port: 9090
          failureThreshold: 2
          initialDelaySeconds: 15
          periodSeconds: 15
          timeoutSeconds: 20
        ports:
        - containerPort: 9090
