---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: profile-server
  labels:
    db: pgsql
spec:
  selector:
    matchLabels:
      name: profile-server
  template:
    metadata:
      labels:
        name: profile-server
    spec:
      containers:
      - name: profile-server
        image: gcr.io/pixie-oss/pixie-dev/cloud/profile_server_image
        ports:
        - containerPort: 51500
        readinessProbe:
          httpGet:
            scheme: HTTPS
            path: /healthz
            port: 51500
        livenessProbe:
          httpGet:
            scheme: HTTPS
            path: /healthz
            port: 51500
        envFrom:
        - configMapRef:
            name: pl-db-config
        - configMapRef:
            name: pl-tls-config
        - configMapRef:
            name: pl-domain-config
        - configMapRef:
            name: pl-ory-service-config
        env:
        - name: PL_JWT_SIGNING_KEY
          valueFrom:
            secretKeyRef:
              name: cloud-auth-secrets
              key: jwt-signing-key
        - name: PL_POSTGRES_USERNAME
          valueFrom:
            secretKeyRef:
              name: pl-db-secrets
              key: PL_POSTGRES_USERNAME
        - name: PL_POSTGRES_PASSWORD
          valueFrom:
            secretKeyRef:
              name: pl-db-secrets
              key: PL_POSTGRES_PASSWORD
        - name: PL_PROJECT_MANAGER_SERVICE
          valueFrom:
            configMapKeyRef:
              name: pl-service-config
              key: PL_PROJECT_MANAGER_SERVICE
        volumeMounts:
        - name: certs
          mountPath: /certs
      volumes:
      - name: certs
        secret:
          secretName: service-tls-certs
