跳至正文
Wener Notes

K8S Features

约 1 分钟阅读

StatefulSetAutoDeletePVC

yaml
apiVersion: apps/v1
kind: StatefulSet
spec:
  # StatefulSetAutoDeletePVC
  # sts 异常后的 pvc 回收策略
  persistentVolumeClaimRetentionPolicy:
    whenDeleted: Retain
    whenScaled: Delete

CronJobControllerV2

schedule=
@yearly,@annually0 0 1 1 *
@monthly0 0 1 * *
@weekly0 0 * * 0
@daily,@midnight0 0 * * *
@hourly0 * * * *
  • 时区基于 kube-controller-manager
  • 未正式支持 CRON_TZ, TZ
yaml
apiVersion: batch/v1
kind: CronJob
metadata:
  name: hello
spec:
  schedule: '*/1 * * * *'
  jobTemplate:
    spec:
      template:
        spec:
          containers:
            - name: hello
              image: busybox
              imagePullPolicy: IfNotPresent
              command:
                - /bin/sh
                - -c
                - date; echo Hello from the Kubernetes cluster
          restartPolicy: OnFailure

IPv6DualStack

yaml
apiVersion: v1
kind: Service
metadata:
  name: my-service
spec:
  type: ClusterIP
  selector:
    app: MyApp
  ports:
    - protocol: TCP
      port: 80
      targetPort: 9376
  # 默认 SingleStack, 支持 PreferDualStack, RequireDualStack
  ipFamilyPolicy: RequireDualStack
  ipFamilies:
    - IPv4
    - IPv6
  # 申请到的地址
  clusterIP: 1.2.3.4
  clusterIPs:
    - 1.2.3.4
    - 2001::1

关联信息

反向链接、本文链接的其他页面和外部资料。

参考资料

GitHub2 条
其他外链1 条
最近更新commit 958471a编辑