c12s-kubespray/roles/network_plugin/kube-ovn/templates/cni-kube-ovn.yml.j2

580 lines
17 KiB
Text
Raw Permalink Normal View History

2019-07-31 03:10:20 +00:00
---
kind: Deployment
apiVersion: apps/v1
metadata:
name: kube-ovn-controller
2020-05-06 18:05:09 +00:00
namespace: kube-system
2019-07-31 03:10:20 +00:00
annotations:
kubernetes.io/description: |
kube-ovn controller
spec:
replicas: {{ kube_ovn_controller_replics }}
2019-07-31 03:10:20 +00:00
selector:
matchLabels:
app: kube-ovn-controller
strategy:
rollingUpdate:
maxSurge: 0%
maxUnavailable: 100%
type: RollingUpdate
template:
metadata:
labels:
app: kube-ovn-controller
component: network
type: infra
spec:
tolerations:
- operator: Exists
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchLabels:
app: kube-ovn-controller
topologyKey: kubernetes.io/hostname
priorityClassName: system-cluster-critical
2019-07-31 03:10:20 +00:00
serviceAccountName: ovn
hostNetwork: true
containers:
- name: kube-ovn-controller
image: {{ kube_ovn_container_image_repo }}:{{ kube_ovn_container_image_tag }}
2019-07-31 03:10:20 +00:00
imagePullPolicy: {{ k8s_image_pull_policy }}
command:
- /kube-ovn/start-controller.sh
args:
- --default-cidr={{ kube_pods_subnet }}{% if enable_dual_stack_networks %},{{ kube_ovn_pool_cidr_ipv6 | default(kube_pods_subnet_ipv6) }}{% endif %}{{''}}
- --default-gateway={% if kube_ovn_default_gateway is defined %}{{ kube_ovn_default_gateway }}{% endif %}{{''}}
- --default-gateway-check={{ kube_ovn_default_gateway_check|string }}
- --default-logical-gateway={{ kube_ovn_default_logical_gateway|string }}
- --default-exclude-ips={% if kube_ovn_default_exclude_ips is defined %}{{ kube_ovn_default_exclude_ips }}{% endif %}{{''}}
- --node-switch-cidr={{ kube_ovn_node_switch_cidr }}{% if enable_dual_stack_networks %},{{ kube_ovn_node_switch_cidr_ipv6 }}{% endif %}{{''}}
- --service-cluster-ip-range={{ kube_service_addresses }}{% if enable_dual_stack_networks %},{{ kube_service_addresses_ipv6 }}{% endif %}{{''}}
- --network-type={{ kube_ovn_network_type }}
- --default-interface-name={{ kube_ovn_default_interface_name|default('') }}
- --default-vlan-id={{ kube_ovn_default_vlan_id }}
- --pod-nic-type={{ kube_ovn_pod_nic_type }}
- --enable-lb={{ kube_ovn_enable_lb|string }}
- --enable-np={{ kube_ovn_enable_np|string }}
- --enable-external-vpc={{ kube_ovn_enable_external_vpc|string }}
- --logtostderr=false
- --alsologtostderr=true
- --log_file=/var/log/kube-ovn/kube-ovn-controller.log
2019-07-31 03:10:20 +00:00
env:
2020-11-26 17:34:19 +00:00
- name: ENABLE_SSL
value: "{{ kube_ovn_enable_ssl | lower }}"
2019-07-31 03:10:20 +00:00
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: KUBE_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
2020-11-26 17:34:19 +00:00
volumeMounts:
2021-06-16 15:10:00 +00:00
- mountPath: /etc/localtime
name: localtime
- mountPath: /var/log/kube-ovn
name: kube-ovn-log
2020-11-26 17:34:19 +00:00
- mountPath: /var/run/tls
name: kube-ovn-tls
2019-07-31 03:10:20 +00:00
readinessProbe:
exec:
command:
- /kube-ovn/kube-ovn-controller-healthcheck
2019-07-31 03:10:20 +00:00
periodSeconds: 3
2020-11-26 17:34:19 +00:00
timeoutSeconds: 45
2019-07-31 03:10:20 +00:00
livenessProbe:
exec:
command:
- /kube-ovn/kube-ovn-controller-healthcheck
2020-05-06 18:05:09 +00:00
initialDelaySeconds: 300
2019-07-31 03:10:20 +00:00
periodSeconds: 7
failureThreshold: 5
2020-11-26 17:34:19 +00:00
timeoutSeconds: 45
2021-02-10 10:25:01 +00:00
resources:
requests:
cpu: {{ kube_ovn_controller_cpu_request }}
memory: {{ kube_ovn_controller_memory_request }}
limits:
cpu: {{ kube_ovn_controller_cpu_limit }}
memory: {{ kube_ovn_controller_memory_limit }}
2019-07-31 03:10:20 +00:00
nodeSelector:
kubernetes.io/os: "linux"
2020-11-26 17:34:19 +00:00
volumes:
2021-06-16 15:10:00 +00:00
- name: localtime
hostPath:
path: /etc/localtime
- name: kube-ovn-log
hostPath:
path: /var/log/kube-ovn
2020-11-26 17:34:19 +00:00
- name: kube-ovn-tls
secret:
optional: true
secretName: kube-ovn-tls
2019-07-31 03:10:20 +00:00
---
kind: DaemonSet
apiVersion: apps/v1
metadata:
name: kube-ovn-cni
2020-05-06 18:05:09 +00:00
namespace: kube-system
2019-07-31 03:10:20 +00:00
annotations:
kubernetes.io/description: |
This daemon set launches the kube-ovn cni daemon.
spec:
selector:
matchLabels:
app: kube-ovn-cni
template:
metadata:
labels:
app: kube-ovn-cni
component: network
type: infra
spec:
tolerations:
- operator: Exists
priorityClassName: system-cluster-critical
2019-07-31 03:10:20 +00:00
serviceAccountName: ovn
hostNetwork: true
hostPID: true
initContainers:
- name: install-cni
image: {{ kube_ovn_container_image_repo }}:{{ kube_ovn_container_image_tag }}
2019-07-31 03:10:20 +00:00
imagePullPolicy: {{ k8s_image_pull_policy }}
command: ["/kube-ovn/install-cni.sh"]
securityContext:
runAsUser: 0
privileged: true
2019-07-31 03:10:20 +00:00
volumeMounts:
- mountPath: /opt/cni/bin
name: cni-bin
containers:
- name: cni-server
image: {{ kube_ovn_container_image_repo }}:{{ kube_ovn_container_image_tag }}
2019-07-31 03:10:20 +00:00
imagePullPolicy: {{ k8s_image_pull_policy }}
command:
2021-02-10 10:25:01 +00:00
- bash
2019-07-31 03:10:20 +00:00
- /kube-ovn/start-cniserver.sh
args:
- --enable-mirror={{ kube_ovn_traffic_mirror | lower }}
- --encap-checksum={{ kube_ovn_encap_checksum | lower }}
- --service-cluster-ip-range={{ kube_service_addresses }}{% if enable_dual_stack_networks %},{{ kube_service_addresses_ipv6 }}{% endif %}{{''}}
- --iface={{ kube_ovn_iface|default('') }}
- --network-type={{ kube_ovn_network_type }}
- --default-interface-name={{ kube_ovn_default_interface_name|default('') }}
{% if kube_ovn_mtu is defined %}
- --mtu={{ kube_ovn_mtu }}
{% endif %}
- --logtostderr=false
- --alsologtostderr=true
- --log_file=/var/log/kube-ovn/kube-ovn-cni.log
2019-07-31 03:10:20 +00:00
securityContext:
runAsUser: 0
privileged: true
2019-07-31 03:10:20 +00:00
env:
- name: kube_ovn_enable_ssl
value: "{{ kube_ovn_enable_ssl | lower }}"
2019-07-31 03:10:20 +00:00
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
volumeMounts:
- mountPath: /etc/openvswitch
name: systemid
2020-11-26 17:34:19 +00:00
- mountPath: /etc/cni/net.d
name: cni-conf
2019-07-31 03:10:20 +00:00
- mountPath: /run/openvswitch
name: host-run-ovs
- mountPath: /run/ovn
name: host-run-ovn
- mountPath: /var/run/netns
name: host-ns
mountPropagation: HostToContainer
- mountPath: /var/log/kube-ovn
name: kube-ovn-log
2021-06-16 15:10:00 +00:00
- mountPath: /etc/localtime
name: localtime
2019-07-31 03:10:20 +00:00
readinessProbe:
exec:
command:
- nc
- -z
- -w3
- 127.0.0.1
- "10665"
periodSeconds: 3
timeoutSeconds: 5
2019-07-31 03:10:20 +00:00
livenessProbe:
exec:
command:
- nc
- -z
- -w3
- 127.0.0.1
- "10665"
initialDelaySeconds: 30
periodSeconds: 7
failureThreshold: 5
timeoutSeconds: 5
2021-10-14 19:11:09 +00:00
resources:
requests:
cpu: {{ kube_ovn_cni_server_cpu_request }}
memory: {{ kube_ovn_cni_server_memory_request }}
limits:
cpu: {{ kube_ovn_cni_server_cpu_limit }}
memory: {{ kube_ovn_cni_server_memory_limit }}
2019-07-31 03:10:20 +00:00
nodeSelector:
kubernetes.io/os: "linux"
2019-07-31 03:10:20 +00:00
volumes:
- name: systemid
hostPath:
path: /etc/origin/openvswitch
2019-07-31 03:10:20 +00:00
- name: host-run-ovs
hostPath:
path: /run/openvswitch
- name: host-run-ovn
hostPath:
path: /run/ovn
2019-07-31 03:10:20 +00:00
- name: cni-conf
hostPath:
path: /etc/cni/net.d
- name: cni-bin
hostPath:
path: /opt/cni/bin
- name: host-ns
hostPath:
path: /var/run/netns
- name: kube-ovn-log
hostPath:
path: /var/log/kube-ovn
2021-06-16 15:10:00 +00:00
- name: localtime
hostPath:
path: /etc/localtime
---
kind: DaemonSet
apiVersion: apps/v1
metadata:
name: kube-ovn-pinger
2020-05-06 18:05:09 +00:00
namespace: kube-system
annotations:
kubernetes.io/description: |
This daemon set launches the openvswitch daemon.
spec:
selector:
matchLabels:
app: kube-ovn-pinger
updateStrategy:
type: RollingUpdate
template:
metadata:
labels:
app: kube-ovn-pinger
component: network
type: infra
spec:
serviceAccountName: ovn
hostPID: true
containers:
- name: pinger
image: {{ kube_ovn_container_image_repo }}:{{ kube_ovn_container_image_tag }}
imagePullPolicy: {{ k8s_image_pull_policy }}
command:
- /kube-ovn/kube-ovn-pinger
args:
- --external-address={{ kube_ovn_external_address }}{% if enable_dual_stack_networks %},{{ kube_ovn_external_address_ipv6 }}{% endif %}{{''}}
- --external-dns={{ kube_ovn_external_dns }}
- --logtostderr=false
- --alsologtostderr=true
- --log_file=/var/log/kube-ovn/kube-ovn-pinger.log
securityContext:
runAsUser: 0
privileged: false
env:
2020-11-26 17:34:19 +00:00
- name: ENABLE_SSL
value: "{{ kube_ovn_enable_ssl | lower }}"
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: HOST_IP
valueFrom:
fieldRef:
fieldPath: status.hostIP
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
volumeMounts:
- mountPath: /lib/modules
name: host-modules
readOnly: true
- mountPath: /run/openvswitch
name: host-run-ovs
- mountPath: /var/run/openvswitch
name: host-run-ovs
- mountPath: /var/run/ovn
name: host-run-ovn
- mountPath: /sys
name: host-sys
readOnly: true
- mountPath: /etc/openvswitch
name: host-config-openvswitch
- mountPath: /var/log/openvswitch
name: host-log-ovs
- mountPath: /var/log/ovn
name: host-log-ovn
- mountPath: /var/log/kube-ovn
name: kube-ovn-log
2021-06-16 15:10:00 +00:00
- mountPath: /etc/localtime
name: localtime
2020-11-26 17:34:19 +00:00
- mountPath: /var/run/tls
name: kube-ovn-tls
resources:
requests:
cpu: {{ kube_ovn_pinger_cpu_request }}
memory: {{ kube_ovn_pinger_memory_request }}
limits:
cpu: {{ kube_ovn_pinger_cpu_limit }}
memory: {{ kube_ovn_pinger_memory_limit }}
nodeSelector:
kubernetes.io/os: "linux"
volumes:
- name: host-modules
hostPath:
path: /lib/modules
- name: host-run-ovs
hostPath:
path: /run/openvswitch
- name: host-run-ovn
hostPath:
path: /run/ovn
- name: host-sys
hostPath:
path: /sys
- name: host-config-openvswitch
hostPath:
path: /etc/origin/openvswitch
- name: host-log-ovs
hostPath:
path: /var/log/openvswitch
- name: kube-ovn-log
hostPath:
path: /var/log/kube-ovn
- name: host-log-ovn
hostPath:
path: /var/log/ovn
2021-06-16 15:10:00 +00:00
- name: localtime
hostPath:
path: /etc/localtime
2020-11-26 17:34:19 +00:00
- name: kube-ovn-tls
secret:
optional: true
secretName: kube-ovn-tls
---
2021-06-16 15:10:00 +00:00
kind: Deployment
apiVersion: apps/v1
metadata:
name: kube-ovn-monitor
namespace: kube-system
annotations:
kubernetes.io/description: |
Metrics for OVN components: northd, nb and sb.
spec:
replicas: 1
strategy:
rollingUpdate:
maxSurge: 1
2021-06-16 15:10:00 +00:00
maxUnavailable: 1
type: RollingUpdate
selector:
matchLabels:
app: kube-ovn-monitor
template:
metadata:
labels:
app: kube-ovn-monitor
component: network
type: infra
spec:
tolerations:
- operator: Exists
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchLabels:
app: kube-ovn-monitor
topologyKey: kubernetes.io/hostname
priorityClassName: system-cluster-critical
serviceAccountName: ovn
hostNetwork: true
2021-06-16 15:10:00 +00:00
containers:
- name: kube-ovn-monitor
image: {{ kube_ovn_container_image_repo }}:{{ kube_ovn_container_image_tag }}
imagePullPolicy: {{ k8s_image_pull_policy }}
command: ["/kube-ovn/start-ovn-monitor.sh"]
securityContext:
runAsUser: 0
privileged: false
env:
- name: ENABLE_SSL
value: "{{ kube_ovn_enable_ssl | lower }}"
2021-06-16 15:10:00 +00:00
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
resources:
requests:
cpu: {{ kube_ovn_monitor_cpu_request }}
memory: {{ kube_ovn_monitor_memory_request }}
limits:
cpu: {{ kube_ovn_monitor_cpu_limit }}
memory: {{ kube_ovn_monitor_memory_limit }}
volumeMounts:
- mountPath: /var/run/openvswitch
name: host-run-ovs
- mountPath: /var/run/ovn
name: host-run-ovn
- mountPath: /etc/openvswitch
name: host-config-openvswitch
- mountPath: /etc/ovn
name: host-config-ovn
- mountPath: /var/log/openvswitch
name: host-log-ovs
- mountPath: /var/log/ovn
name: host-log-ovn
- mountPath: /etc/localtime
name: localtime
- mountPath: /var/run/tls
name: kube-ovn-tls
readinessProbe:
exec:
command:
- cat
- /var/run/ovn/ovnnb_db.pid
periodSeconds: 10
2021-06-16 15:10:00 +00:00
timeoutSeconds: 45
livenessProbe:
exec:
command:
- cat
- /var/run/ovn/ovnnb_db.pid
2021-06-16 15:10:00 +00:00
initialDelaySeconds: 30
periodSeconds: 10
failureThreshold: 5
timeoutSeconds: 45
nodeSelector:
kubernetes.io/os: "linux"
kube-ovn/role: "master"
volumes:
- name: host-run-ovs
hostPath:
path: /run/openvswitch
- name: host-run-ovn
hostPath:
path: /run/ovn
- name: host-config-openvswitch
hostPath:
path: /etc/origin/openvswitch
- name: host-config-ovn
hostPath:
path: /etc/origin/ovn
- name: host-log-ovs
hostPath:
path: /var/log/openvswitch
- name: host-log-ovn
hostPath:
path: /var/log/ovn
- name: localtime
hostPath:
path: /etc/localtime
- name: kube-ovn-tls
secret:
optional: true
secretName: kube-ovn-tls
---
kind: Service
apiVersion: v1
metadata:
name: kube-ovn-monitor
namespace: kube-system
labels:
app: kube-ovn-monitor
spec:
ports:
- name: metrics
port: 10661
type: ClusterIP
{% if enable_dual_stack_networks %}
ipFamilyPolicy: PreferDualStack
{% endif %}
2021-06-16 15:10:00 +00:00
selector:
app: kube-ovn-monitor
sessionAffinity: None
---
kind: Service
apiVersion: v1
metadata:
name: kube-ovn-pinger
2020-05-06 18:05:09 +00:00
namespace: kube-system
labels:
app: kube-ovn-pinger
spec:
{% if enable_dual_stack_networks %}
ipFamilyPolicy: PreferDualStack
{% endif %}
selector:
app: kube-ovn-pinger
ports:
- port: 8080
name: metrics
---
kind: Service
apiVersion: v1
metadata:
name: kube-ovn-controller
2020-05-06 18:05:09 +00:00
namespace: kube-system
labels:
app: kube-ovn-controller
spec:
{% if enable_dual_stack_networks %}
ipFamilyPolicy: PreferDualStack
{% endif %}
selector:
app: kube-ovn-controller
ports:
- port: 10660
name: metrics
---
kind: Service
apiVersion: v1
metadata:
name: kube-ovn-cni
2020-05-06 18:05:09 +00:00
namespace: kube-system
labels:
app: kube-ovn-cni
spec:
{% if enable_dual_stack_networks %}
ipFamilyPolicy: PreferDualStack
{% endif %}
selector:
app: kube-ovn-cni
ports:
- port: 10665
name: metrics