kubeasz/roles/kube-ovn/templates/kube-ovn.yaml.j2

373 lines
9.6 KiB
Plaintext
Raw Normal View History

2019-05-22 11:17:42 +08:00
---
kind: Deployment
apiVersion: apps/v1
metadata:
name: kube-ovn-controller
2021-01-18 10:21:48 +08:00
namespace: kube-system
2019-05-22 11:17:42 +08:00
annotations:
kubernetes.io/description: |
kube-ovn controller
spec:
2019-07-23 13:28:46 +08:00
replicas: 1
2019-05-22 11:17:42 +08: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:
2021-01-18 10:21:48 +08:00
- operator: Exists
2019-05-22 11:17:42 +08:00
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchLabels:
app: kube-ovn-controller
topologyKey: kubernetes.io/hostname
2021-01-18 10:21:48 +08:00
priorityClassName: system-cluster-critical
2019-05-22 11:17:42 +08:00
serviceAccountName: ovn
hostNetwork: true
containers:
- name: kube-ovn-controller
2021-01-18 10:21:48 +08:00
image: "kubeovn/kube-ovn:v1.5.3"
2019-05-22 11:17:42 +08:00
imagePullPolicy: IfNotPresent
command:
2021-01-18 10:21:48 +08:00
- /kube-ovn/start-controller.sh
2019-05-22 11:17:42 +08:00
args:
2021-01-18 10:21:48 +08:00
- --default-cidr={{ kube_ovn_default_cidr }}
- --default-gateway={{ kube_ovn_default_gateway }}
- --node-switch-cidr={{ kube_ovn_node_switch_cidr }}
- --network-type=geneve
- --default-interface-name=
- --default-vlan-id=100
2019-05-22 11:17:42 +08:00
env:
2021-01-18 10:21:48 +08:00
- name: ENABLE_SSL
value: "false"
2019-05-22 11:17:42 +08:00
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: KUBE_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
2019-07-23 13:28:46 +08:00
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
2021-01-18 10:21:48 +08:00
volumeMounts:
- mountPath: /var/run/tls
name: kube-ovn-tls
2019-07-23 13:28:46 +08:00
readinessProbe:
exec:
command:
2021-01-18 10:21:48 +08:00
- sh
- /kube-ovn/kube-ovn-controller-healthcheck.sh
2019-07-23 13:28:46 +08:00
periodSeconds: 3
2021-01-18 10:21:48 +08:00
timeoutSeconds: 45
2019-07-23 13:28:46 +08:00
livenessProbe:
exec:
command:
2021-01-18 10:21:48 +08:00
- sh
- /kube-ovn/kube-ovn-controller-healthcheck.sh
initialDelaySeconds: 300
2019-07-23 13:28:46 +08:00
periodSeconds: 7
failureThreshold: 5
2021-01-18 10:21:48 +08:00
timeoutSeconds: 45
resources:
requests:
cpu: 200m
memory: 200Mi
limits:
cpu: 1000m
memory: 1Gi
2019-05-22 11:17:42 +08:00
nodeSelector:
2021-01-18 10:21:48 +08:00
kubernetes.io/os: "linux"
volumes:
- name: kube-ovn-tls
secret:
optional: true
secretName: kube-ovn-tls
2019-05-22 11:17:42 +08:00
---
kind: DaemonSet
apiVersion: apps/v1
metadata:
name: kube-ovn-cni
2021-01-18 10:21:48 +08:00
namespace: kube-system
2019-05-22 11:17:42 +08: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:
2021-01-18 10:21:48 +08:00
- operator: Exists
priorityClassName: system-cluster-critical
2019-05-22 11:17:42 +08:00
serviceAccountName: ovn
hostNetwork: true
hostPID: true
initContainers:
2021-01-18 10:21:48 +08:00
- name: install-cni
image: "kubeovn/kube-ovn:v1.5.3"
imagePullPolicy: IfNotPresent
command: ["/kube-ovn/install-cni.sh"]
securityContext:
runAsUser: 0
privileged: true
volumeMounts:
- mountPath: /opt/cni/bin
name: cni-bin
2019-05-22 11:17:42 +08:00
containers:
2021-01-18 10:21:48 +08:00
- name: cni-server
image: "kubeovn/kube-ovn:v1.5.3"
imagePullPolicy: IfNotPresent
command:
- sh
- /kube-ovn/start-cniserver.sh
args:
- --enable-mirror={{ kube_ovn_enable_mirror|string|lower }}
- --service-cluster-ip-range={{ SERVICE_CIDR }}
- --encap-checksum=true
- --iface=
- --network-type=geneve
- --default-interface-name=
securityContext:
runAsUser: 0
privileged: true
env:
- name: ENABLE_SSL
value: "false"
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
volumeMounts:
- mountPath: /etc/cni/net.d
name: cni-conf
- mountPath: /run/openvswitch
name: host-run-ovs
- mountPath: /run/ovn
name: host-run-ovn
- mountPath: /var/run/netns
name: host-ns
mountPropagation: HostToContainer
readinessProbe:
exec:
command:
- nc
- -z
- -w3
- 127.0.0.1
- "10665"
periodSeconds: 3
livenessProbe:
exec:
command:
- nc
- -z
- -w3
- 127.0.0.1
- "10665"
initialDelaySeconds: 30
periodSeconds: 7
failureThreshold: 5
resources:
requests:
cpu: 200m
memory: 200Mi
limits:
cpu: 1000m
memory: 1Gi
2019-05-22 11:17:42 +08:00
nodeSelector:
2021-01-18 10:21:48 +08:00
kubernetes.io/os: "linux"
2019-05-22 11:17:42 +08:00
volumes:
- name: host-run-ovs
hostPath:
path: /run/openvswitch
2021-01-18 10:21:48 +08:00
- name: host-run-ovn
hostPath:
path: /run/ovn
2019-05-22 11:17:42 +08:00
- name: cni-conf
hostPath:
path: /etc/cni/net.d
- name: cni-bin
hostPath:
path: {{ bin_dir }}
2021-01-18 10:21:48 +08:00
- name: host-ns
hostPath:
path: /var/run/netns
2019-10-14 18:21:30 +08:00
---
kind: DaemonSet
apiVersion: apps/v1
metadata:
name: kube-ovn-pinger
2021-01-18 10:21:48 +08:00
namespace: kube-system
annotations:
kubernetes.io/description: |
This daemon set launches the openvswitch daemon.
2019-10-14 18:21:30 +08:00
spec:
selector:
matchLabels:
app: kube-ovn-pinger
updateStrategy:
type: RollingUpdate
template:
metadata:
labels:
app: kube-ovn-pinger
component: network
type: infra
spec:
tolerations:
- operator: Exists
serviceAccountName: ovn
hostPID: true
containers:
- name: pinger
2021-01-18 10:21:48 +08:00
image: "kubeovn/kube-ovn:v1.5.3"
command: ["/kube-ovn/kube-ovn-pinger", "--external-address=114.114.114.114", "--external-dns=alauda.cn"]
2019-10-14 18:21:30 +08:00
imagePullPolicy: IfNotPresent
securityContext:
runAsUser: 0
privileged: false
env:
2021-01-18 10:21:48 +08:00
- name: ENABLE_SSL
value: "false"
2019-10-14 18:21:30 +08:00
- 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
2021-01-18 10:21:48 +08:00
- mountPath: /var/run/ovn
name: host-run-ovn
2019-10-14 18:21:30 +08:00
- mountPath: /sys
name: host-sys
readOnly: true
- mountPath: /etc/openvswitch
name: host-config-openvswitch
- mountPath: /var/log/openvswitch
2021-01-18 10:21:48 +08:00
name: host-log-ovs
- mountPath: /var/log/ovn
name: host-log-ovn
- mountPath: /var/run/tls
name: kube-ovn-tls
2019-10-14 18:21:30 +08:00
resources:
requests:
cpu: 100m
2021-01-18 10:21:48 +08:00
memory: 200Mi
2019-10-14 18:21:30 +08:00
limits:
cpu: 200m
memory: 400Mi
nodeSelector:
2021-01-18 10:21:48 +08:00
kubernetes.io/os: "linux"
2019-10-14 18:21:30 +08:00
volumes:
- name: host-modules
hostPath:
path: /lib/modules
- name: host-run-ovs
hostPath:
path: /run/openvswitch
2021-01-18 10:21:48 +08:00
- name: host-run-ovn
hostPath:
path: /run/ovn
2019-10-14 18:21:30 +08:00
- name: host-sys
hostPath:
path: /sys
- name: host-config-openvswitch
hostPath:
path: /etc/origin/openvswitch
2021-01-18 10:21:48 +08:00
- name: host-log-ovs
2019-10-14 18:21:30 +08:00
hostPath:
path: /var/log/openvswitch
2021-01-18 10:21:48 +08:00
- name: host-log-ovn
hostPath:
path: /var/log/ovn
- name: kube-ovn-tls
secret:
optional: true
secretName: kube-ovn-tls
2019-10-14 18:21:30 +08:00
---
kind: Service
apiVersion: v1
metadata:
name: kube-ovn-pinger
2021-01-18 10:21:48 +08:00
namespace: kube-system
2019-10-14 18:21:30 +08:00
labels:
app: kube-ovn-pinger
spec:
selector:
app: kube-ovn-pinger
ports:
- port: 8080
2021-01-18 10:21:48 +08:00
name: metrics
---
kind: Service
apiVersion: v1
metadata:
name: kube-ovn-controller
namespace: kube-system
labels:
app: kube-ovn-controller
spec:
selector:
app: kube-ovn-controller
ports:
- port: 10660
name: metrics
---
kind: Service
apiVersion: v1
metadata:
name: kube-ovn-cni
namespace: kube-system
labels:
app: kube-ovn-cni
spec:
selector:
app: kube-ovn-cni
ports:
- port: 10665
name: metrics