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

k8s

k8s中开启istio注入命令

2021-5-8 9:15:25

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
今日签到
有新私信 私信列表
搜索