• pod 亲和性/反亲和性


    pod亲和性、pod-flag.yaml 被 pod-affinity.yaml 依赖 pod-antiaffinity.yaml 反亲和性 pod-flag.yaml
    pof-flag.yaml
    apiVersion: v1
    kind: Pod
    metadata:
    name: pod-flag
    labels:
    security: "S1"
    app: "nginx"
    spec:
    containers:
    - name: nginx
    image: nginx

    pod-affinity.yaml
    apiVersion: v1
    kind: Pod
    metadata:
    name: pod-affinity
    spec:
    affinity:
    podAffinity:
    requiredDuringSchedulingIgnoredDuringExecution:
    - labelSelector:
    matchExpressions:
    - key: security
    operator: In
    values:
    - S1
    topologyKey: kubernetes.io/hostname
    containers:
    - name: with-pod-affinity
    image: gcr.io/google_containers/pause:2.0

    pdo-antiaffinity.yaml
    apiVersion: v1
    kind: Pod
    metadata:
    name: anti-affinity
    spec:
    affinity:
    podAffinity:
    requiredDuringSchedulingIgnoredDuringExecution:
    - labelSelector:
    matchExpressions:
    - key: security
    operator: In
    values:
    - S1
    topologyKey: kubernetes.io/zone
    podAntiAffinity:
    requiredDuringSchedulingIgnoredDuringExecution:
    - labelSelector:
    matchExpressions:
    - key: app
    operator: In
    values:
    - nginx
    topologyKey: kubernetes.io/hostname
    containers:
    - name: anti-affinity
    image: gcr.io/google_containers/pause:2.0

  • 相关阅读:
    sort函数详解
    C++重载运算符的规则详解
    poj3061-subsequence
    员工管理系统 :练习
    Jdbc 模拟登陆系统的练习
    有关String 的常用方法
    浅谈希尔排序-----摘录
    简单选择排序
    typedef 和define 的区别
    写博客的理由
  • 原文地址:https://www.cnblogs.com/sqbk/p/15213651.html
Copyright © 2020-2023  润新知