github.com/m3db/m3@v1.5.0/kube/m3dbnode-statefulset.yaml (about)

     1  # Headless service for the statefulset
     2  apiVersion: v1
     3  kind: Service
     4  metadata:
     5    name: m3dbnode
     6    labels:
     7      app: m3dbnode
     8    namespace: m3db
     9  spec:
    10    ports:
    11    - port: 9000
    12      name: client
    13    - port: 9001
    14      name: cluster
    15    - port: 9002
    16      name: http-node
    17    - port: 9003
    18      name: http-cluster
    19    - port: 9004
    20      name: debug
    21    - port: 7201
    22      name: coordinator
    23    - port: 7203
    24      name: coordinator-metrics
    25    # NOTE: There MUST be a headless (clusterIP == None) service with name equal
    26    # to the `spec.serviceName` field of the stateful set. Search "headless" on
    27    # https://v1-10.docs.kubernetes.io/docs/concepts/workloads/controllers/statefulset/
    28    # for more info
    29    clusterIP: None
    30    selector:
    31      app: m3dbnode
    32  ---
    33  apiVersion: v1
    34  kind: Service
    35  metadata:
    36    name: m3coordinator
    37    labels:
    38      app: m3dbnode
    39    namespace: m3db
    40  spec:
    41    selector:
    42      app: m3dbnode
    43    ports:
    44    - port: 7201
    45      name: coordinator
    46    - port: 7203
    47      name: coordinator-metrics
    48  ---
    49  apiVersion: apps/v1
    50  kind: StatefulSet
    51  metadata:
    52    labels:
    53      app: m3dbnode
    54    name: m3dbnode
    55    namespace: m3db
    56  spec:
    57    serviceName: m3dbnode
    58    replicas: 3
    59    selector:
    60      matchLabels:
    61        app: m3dbnode
    62    updateStrategy:
    63      type: RollingUpdate
    64    template:
    65      metadata:
    66        labels:
    67          app: m3dbnode
    68      spec:
    69        tolerations:
    70          - key: "dedicated-m3db"
    71            effect: NoSchedule
    72            operator: Exists
    73        affinity:
    74          nodeAffinity:
    75            preferredDuringSchedulingIgnoredDuringExecution:
    76            - preference:
    77                matchExpressions:
    78                - key: m3db.io/dedicated-m3db
    79                  operator: In
    80                  values:
    81                    - "true"
    82              weight: 10
    83        containers:
    84        - name: m3db
    85          image: quay.io/m3/m3dbnode:latest
    86          # Allows m3dbnode to raise its own file limits. Comment this out if you
    87          # have a restrictive Pod Security Policy or similar enforcement
    88          # mechanisms.
    89          securityContext:
    90            capabilities:
    91              add:
    92              - SYS_RESOURCE
    93          imagePullPolicy: Always
    94          # resources:
    95          #   limits:
    96          #     memory: 15Gi
    97          #   requests:
    98          #     memory: 10Gi
    99          args:
   100            - "-f"
   101            - "/etc/m3db/m3dbnode.yml"
   102          volumeMounts:
   103          - name: config-vol
   104            mountPath: /etc/m3db/
   105          - name: m3db-db
   106            mountPath: /var/lib/m3db
   107          ports:
   108          - containerPort: 9000
   109            name: client
   110            protocol: TCP
   111          - containerPort: 9001
   112            name: cluster
   113            protocol: TCP
   114          - containerPort: 9002
   115            name: http-node
   116            protocol: TCP
   117          - containerPort: 9003
   118            name: http-cluster
   119            protocol: TCP
   120          - containerPort: 9004
   121            name: debug
   122            protocol: TCP
   123          - containerPort: 7201
   124            name: coordinator
   125            protocol: TCP
   126          - containerPort: 7203
   127            # max name length == 15 chars
   128            name: coord-metrics
   129            protocol: TCP
   130        volumes:
   131        - name: config-vol
   132          configMap:
   133            name: m3dbnode-config
   134        dnsPolicy: ClusterFirst
   135        restartPolicy: Always
   136        schedulerName: default-scheduler
   137        securityContext: {}
   138        terminationGracePeriodSeconds: 30
   139    volumeClaimTemplates:
   140      - metadata:
   141          name: m3db-db
   142        spec:
   143          accessModes:
   144            - ReadWriteOnce
   145          storageClassName: fast
   146          resources:
   147            requests:
   148              storage: 200Gi