hongbo-miao/hongbomiao.com

View on GitHub
kubernetes/manifests/west/grpc-server-deployment.yaml

Summary

Maintainability
Test Coverage
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: grpc-server-deployment
  namespace: hm
  labels:
    app.kubernetes.io/name: grpc-server
spec:
  replicas: 1
  selector:
    matchLabels:
      app: grpc-server
  template:
    metadata:
      labels:
        app: grpc-server
    spec:
      containers:
        - name: grpc-server
          image: ghcr.io/hongbo-miao/hm-grpc-server:latest
          env:
            - name: APP_ENV
              valueFrom:
                configMapKeyRef:
                  name: grpc-server-configmap
                  key: app_env
            - name: PORT
              valueFrom:
                configMapKeyRef:
                  name: grpc-server-configmap
                  key: port
            - name: OPEN_CENSUS_AGENT_HOST
              valueFrom:
                configMapKeyRef:
                  name: grpc-server-configmap
                  key: open_census_agent_host
            - name: OPEN_CENSUS_AGENT_PORT
              valueFrom:
                configMapKeyRef:
                  name: grpc-server-configmap
                  key: open_census_agent_port

            # ---- ELASTIC APM BEGIN ----
            - name: ELASTIC_APM_SERVICE_NAME
              valueFrom:
                configMapKeyRef:
                  name: grpc-server-configmap
                  key: elastic_apm_service_name
            - name: ELASTIC_APM_SERVER_URL
              valueFrom:
                configMapKeyRef:
                  name: elastic-apm-configmap
                  key: elastic_apm_server_url
            - name: ELASTIC_APM_ENVIRONMENT
              valueFrom:
                configMapKeyRef:
                  name: elastic-apm-configmap
                  key: elastic_apm_environment
            - name: ELASTIC_APM_SECRET_TOKEN
              valueFrom:
                secretKeyRef:
                  name: hm-elastic-apm
                  key: token
            - name: ELASTIC_APM_VERIFY_SERVER_CERT
              valueFrom:
                configMapKeyRef:
                  name: elastic-apm-configmap
                  key: elastic_apm_verify_server_cert
            - name: ELASTIC_APM_SERVER_CERT
              valueFrom:
                configMapKeyRef:
                  name: elastic-apm-configmap
                  key: elastic_apm_server_cert
            - name: ELASTIC_APM_LOG_LEVEL
              valueFrom:
                configMapKeyRef:
                  name: elastic-apm-configmap
                  key: elastic_apm_log_level
            - name: ELASTIC_APM_LOG_FILE
              valueFrom:
                configMapKeyRef:
                  name: elastic-apm-configmap
                  key: elastic_apm_log_file
                  # ---- ELASTIC APM END ----

          ports:
            - name: grpc-server
              protocol: TCP
              containerPort: 45237

          # ---- ELASTIC APM BEGIN ----
          volumeMounts:
            - name: elastic-apm-volume
              mountPath: /data/elastic-apm
              # ---- ELASTIC APM END ----

      # ---- ELASTIC APM BEGIN ----
      volumes:
        - name: elastic-apm-volume
          persistentVolumeClaim:
            claimName: elastic-apm-pvc
            # ---- ELASTIC APM END ----