DeploymentExamples/MultiInstances/xcmetrics-deployment.yaml [1:43]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
apiVersion: apps/v1
kind: Deployment
metadata:
    name: xcmetrics-server
spec:
  replicas: 1 # Create only one instance. This version uses local storage, it can only run in one instance
  selector:
    matchLabels:
      app: xcmetrics-server
      tier: frontend
  template:
    metadata:
      labels:
        app: xcmetrics-server
        tier: frontend
    spec:
      volumes:
        - name: service-account-volume
          secret:
            secretName: google-service-account

      containers:
      - name: cloud-sql-proxy
        image: gcr.io/cloudsql-docker/gce-proxy:1.17
        command: ["/cloud_sql_proxy",
                  "-instances=Replace with your Cloud SQL connection string=tcp:5432",
                  "-credential_file=/secrets/service_account.json"]
        ports:
        - name: xcmetricsdb
          containerPort: 5432
          protocol: TCP

        securityContext:
          runAsNonRoot: true

        volumeMounts:
        - name: service-account-volume
          mountPath: /secrets/
          readOnly: true

        resources:
          requests:
            cpu: 100m
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



DeploymentExamples/SingleInstance/xcmetrics-deployment.yaml [1:43]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
apiVersion: apps/v1
kind: Deployment
metadata:
    name: xcmetrics-server
spec:
  replicas: 1 # Create only one instance. This version uses local storage, it can only run in one instance
  selector:
    matchLabels:
      app: xcmetrics-server
      tier: frontend
  template:
    metadata:
      labels:
        app: xcmetrics-server
        tier: frontend
    spec:
      volumes:
        - name: service-account-volume
          secret:
            secretName: google-service-account

      containers:
      - name: cloud-sql-proxy
        image: gcr.io/cloudsql-docker/gce-proxy:1.17
        command: ["/cloud_sql_proxy",
                  "-instances=Replace with your Cloud SQL connection string=tcp:5432",
                  "-credential_file=/secrets/service_account.json"]
        ports:
        - name: xcmetricsdb
          containerPort: 5432
          protocol: TCP

        securityContext:
          runAsNonRoot: true

        volumeMounts:
        - name: service-account-volume
          mountPath: /secrets/
          readOnly: true

        resources:
          requests:
            cpu: 100m
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



