apiVersion: apps/v1
kind: Deployment
metadata:
  name: oauth2-sso
  namespace: istio-system
  labels:
    app: oauth2-sso
    version: v1
spec:
  replicas: 3
  selector:
    matchLabels:
      app: oauth2-sso
      version: v1
  template:
    metadata:
      labels:
        app: oauth2-sso
        version: v1
    spec:
      serviceAccountName: oauth2-sso
      containers:
      - name: oauth2-sso
        image: docker-registry.example.com/oauth2-sso:v0.0.1
        resources:
          limits:
            memory: 50Mi
            cpu: 30m
          requests:
            memory: 50Mi
            cpu: 30m
        ports:
        - containerPort: 80
        envFrom:
        - secretRef:
            name: oauth2-sso
        volumeMounts:
        - name: config
          mountPath: "/opt/sso"
          readOnly: true
        readinessProbe:
          tcpSocket:
            port: 80
          initialDelaySeconds: 5
          periodSeconds: 5
        livenessProbe:
          tcpSocket:
            port: 80
          initialDelaySeconds: 5
          periodSeconds: 20
      volumes:
        - name: config
          secret:
              secretName: oauth2-sso
              items:
              - key: config.json
                path: config.json
      imagePullSecrets:
      - name: regcred
