k8s部署StatefulSet案例yaml编排文件

k8s部署StatefulSet案例yaml编排文件

apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: push-testselinuxcn
  namespace: rectest
  labels:
    service: push-testselinuxcn
spec:
  replicas: 2
  serviceName: push-testselinuxcn
  selector:
    matchLabels:
      service: push-testselinuxcn
  template:
    metadata:
      labels:
        service: push-testselinuxcn

    spec:
      containers:
        - name: push-testselinuxcn
          image: hub.selinux.cn/test/push-testselinuxcn:myversion
          resources:
            limits:
              cpu: 8
              memory: 8Gi
            requests:
              cpu: 4
              memory: 4Gi
          imagePullPolicy: IfNotPresent
          ports:
            - containerPort: 33010
          livenessProbe:
            httpGet:
              path: /test/health
              port: 33010
            initialDelaySeconds: 20
            periodSeconds: 5
            timeoutSeconds: 5
          readinessProbe:
            httpGet:
              path: /test/health
              port: 33010
            initialDelaySeconds: 20
            periodSeconds: 5
            timeoutSeconds: 5
      nodeSelector:
        type2: "true"
---

apiVersion: v1
kind: Service
metadata:
  name: push-testselinuxcn
  namespace: rectest
spec:
  type: NodePort
  ports:
    - port: 33010
      protocol: TCP
      nodePort: 33051
  selector:
    service: push-testselinuxcn

给TA打赏
共{{data.count}}人
人已打赏
k8s编排文件

Prometheus Alert开源告警转发系统

2021-8-15 14:22:41

常用工具命令

pssh命令

2018-4-22 17:58:35

个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索