github.com/koko1123/flow-go-1@v0.29.6/k8s/staging/flow-consensus-node-deployment.yml (about)

     1  apiVersion: apps/v1
     2  kind: StatefulSet
     3  metadata:
     4    # This is the full name of your deployment. It must be unique
     5    name: flow-consensus-node-v1
     6    namespace: flow
     7  
     8    # Best practice labels:
     9    #   app: <app-name> (the non-unique version of metadata.name)
    10    #   kind: [web|worker]
    11    #   env: [staging|production|test|dev]
    12    #   owner: who to ask about this service
    13    #   version: the major version of this service (v1/v2/v1beta1)
    14    labels:
    15      app: flow-test-net
    16      node: consensus
    17      env: staging
    18      owner: Kan
    19      version: v1
    20  
    21  spec:
    22    replicas: 1
    23    serviceName: flow-test-network-v1
    24    selector:
    25      matchLabels:
    26        app: flow-test-net
    27        node: consensus
    28        env: staging
    29        version: v1
    30    podManagementPolicy: Parallel
    31    template:
    32      metadata:
    33        annotations:
    34          # Set to "false" to opt out of prometheus scrapes
    35          # Prometheus still needs a port called "metrics" (below) to scrape properly
    36          prometheus.io/scrape: 'true'
    37  
    38          # Set the path to the API endpoint that exposes prometheus metrics, or leave blank for `/metrics`
    39          # prometheus.io/path: "/metrics"
    40  
    41        labels:
    42          app: flow-test-net
    43          node: consensus
    44          env: staging
    45          owner: Kan
    46          version: v1
    47          kind: web
    48  
    49      spec:
    50        imagePullSecrets:
    51          - name: gcr
    52        containers:
    53          - name: flow-test-net
    54            # No tag, will be attached by teamcity
    55            image: gcr.io/dl-flow/consensus
    56            args: 
    57              - '--nodename'
    58              - '$(POD_NAME)'
    59              - '--entries'
    60              - '$(NODE_ENTRIES)'
    61              - '--datadir'
    62              - '/flowdb'
    63  
    64            # Ports exposed can be named so other resources can reference
    65            # them by name and not have to hard code numbers
    66            ports:
    67              - name: grpc
    68                containerPort: 3569
    69              - name: http
    70                containerPort: 8080
    71              # Prometheus is looking specifically for a port named 'metrics'
    72              # This may be the same as the above port, or different
    73              - name: metrics
    74                containerPort: 8080
    75  
    76            # Environment variables
    77            env:
    78              - name: ENV
    79                value: STAGING
    80              - name: POD_NAME
    81                valueFrom:
    82                  fieldRef:
    83                    fieldPath: metadata.name
    84              - name: NODE_ENTRIES
    85                valueFrom:
    86                  configMapKeyRef:
    87                    name: flow-node-config-map
    88                    key: entries
    89              # Due to the fact that we're using a headless service, we cannot use the cgo version of net,
    90              # which causes an error, instead, force using the pure go version now
    91              - name: GODEBUG
    92                value: "netdns=go"
    93  
    94            # Resource requests and constraints
    95            resources:
    96              requests:
    97                cpu: '250m'
    98                memory: '512Mi'
    99              limits:
   100                cpu: '500m'
   101                memory: '2Gi'
   102            volumeMounts:
   103              - name: badger-volume
   104                mountPath: /flowdb
   105  
   106            # The current liveness and readiness probes use the /metrics endpoint, which is non-ideal and MVP only
   107            # These probes should eventually make use of the gRPC server's Ping function, or should at least
   108            # be moved over to a /live endpoint that has some introspection into the gRPC's liveness/readiness
   109  
   110            # Readiness Probe
   111            readinessProbe:
   112              httpGet:
   113                path: /metrics
   114                port: http
   115              initialDelaySeconds: 5
   116              successThreshold: 1
   117            
   118            # Liveness Probe
   119            livenessProbe:
   120              httpGet:
   121                path: /metrics
   122                port: http
   123              initialDelaySeconds: 30
   124              periodSeconds: 30
   125              successThreshold: 1
   126  
   127    volumeClaimTemplates:
   128      - metadata:
   129          name: badger-volume
   130        spec:
   131          accessModes:
   132          - ReadWriteOnce
   133          resources:
   134            requests:
   135              storage: 10Gi
   136          storageClassName: standard