github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/k8s/local/flow-execution-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-execution-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: execution
    17      env: local
    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: execution
    28        env: local
    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: execution
    44          env: local
    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/execution
    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  
    90            # Resource requests and constraints
    91            resources:
    92              requests:
    93                cpu: '125m'
    94                memory: '128Mi'
    95              limits:
    96                cpu: '250m'
    97                memory: '256Mi'
    98            volumeMounts:
    99              - name: badger-volume
   100                mountPath: /flowdb
   101  
   102            # The current liveness and readiness probes use the /metrics endpoint, which is non-ideal and MVP only
   103            # These probes should eventually make use of the gRPC server's Ping function, or should at least
   104            # be moved over to a /live endpoint that has some introspection into the gRPC's liveness/readiness
   105  
   106            # Readiness Probe
   107            readinessProbe:
   108              httpGet:
   109                path: /metrics
   110                port: http
   111              initialDelaySeconds: 5
   112              successThreshold: 1
   113            
   114            # Liveness Probe
   115            livenessProbe:
   116              httpGet:
   117                path: /metrics
   118                port: http
   119              initialDelaySeconds: 30
   120              periodSeconds: 30
   121              successThreshold: 1
   122  
   123    volumeClaimTemplates:
   124      - metadata:
   125          name: badger-volume
   126        spec:
   127          accessModes:
   128          - ReadWriteOnce
   129          resources:
   130            requests:
   131              storage: 20Gi
   132          storageClassName: standard