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

286 lines
7.2 KiB
Plaintext
Raw Normal View History

2019-05-22 11:17:42 +08:00
---
kind: Deployment
apiVersion: apps/v1
metadata:
name: kube-ovn-controller
namespace: kube-ovn
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:
- operator: Exists
effect: NoSchedule
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchLabels:
app: kube-ovn-controller
topologyKey: kubernetes.io/hostname
serviceAccountName: ovn
hostNetwork: true
containers:
- name: kube-ovn-controller
2019-11-27 11:18:45 +08:00
image: "index.alauda.cn/alaudak8s/kube-ovn-controller:v0.9.1"
2019-05-22 11:17:42 +08:00
imagePullPolicy: IfNotPresent
command:
- /kube-ovn/start-controller.sh
args:
2019-08-05 20:58:24 +08:00
- --default-cidr={{ kube_ovn_default_cidr }}
- --default-gateway={{ kube_ovn_default_gateway }}
- --node-switch-cidr={{ kube_ovn_node_switch_cidr }}
2019-05-22 11:17:42 +08:00
env:
- 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
readinessProbe:
exec:
command:
- nc
- -z
- -w3
- 127.0.0.1
- "10660"
periodSeconds: 3
livenessProbe:
exec:
command:
- nc
- -z
- -w3
- 127.0.0.1
- "10660"
initialDelaySeconds: 30
periodSeconds: 7
failureThreshold: 5
2019-05-22 11:17:42 +08:00
nodeSelector:
beta.kubernetes.io/os: "linux"
---
kind: DaemonSet
apiVersion: apps/v1
metadata:
name: kube-ovn-cni
namespace: kube-ovn
annotations:
kubernetes.io/description: |
This daemon set launches the kube-ovn cni daemon.
spec:
selector:
matchLabels:
app: kube-ovn-cni
updateStrategy:
2019-11-27 11:18:45 +08:00
type: OnDelete
2019-05-22 11:17:42 +08:00
template:
metadata:
labels:
app: kube-ovn-cni
component: network
type: infra
spec:
tolerations:
- operator: Exists
effect: NoSchedule
serviceAccountName: ovn
hostNetwork: true
hostPID: true
initContainers:
- name: install-cni
2019-11-27 11:18:45 +08:00
image: "index.alauda.cn/alaudak8s/kube-ovn-cni:v0.9.1"
2019-05-22 11:17:42 +08:00
imagePullPolicy: IfNotPresent
command: ["/kube-ovn/install-cni.sh"]
2019-11-27 11:18:45 +08:00
securityContext:
runAsUser: 0
privileged: true
2019-05-22 11:17:42 +08:00
volumeMounts:
- mountPath: /etc/cni/net.d
name: cni-conf
- mountPath: /opt/cni/bin
name: cni-bin
containers:
- name: cni-server
2019-11-27 11:18:45 +08:00
image: "index.alauda.cn/alaudak8s/kube-ovn-cni:v0.9.1"
2019-05-22 11:17:42 +08:00
imagePullPolicy: IfNotPresent
2019-07-23 13:28:46 +08:00
command:
- sh
- /kube-ovn/start-cniserver.sh
args:
2019-08-05 22:41:56 +08:00
- --enable-mirror={{ kube_ovn_enable_mirror|string|lower }}
2019-08-05 20:58:24 +08:00
- --service-cluster-ip-range={{ SERVICE_CIDR }}
2019-05-22 11:17:42 +08:00
securityContext:
runAsUser: 0
privileged: true
env:
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
volumeMounts:
- mountPath: /run/openvswitch
name: host-run-ovs
2019-07-23 13:28:46 +08:00
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
2019-05-22 11:17:42 +08:00
nodeSelector:
beta.kubernetes.io/os: "linux"
volumes:
- name: host-run-ovs
hostPath:
path: /run/openvswitch
- name: cni-conf
hostPath:
path: /etc/cni/net.d
- name: cni-bin
hostPath:
path: {{ bin_dir }}
2019-10-14 18:21:30 +08:00
---
kind: DaemonSet
apiVersion: apps/v1
metadata:
name: kube-ovn-pinger
namespace: kube-ovn
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
effect: NoSchedule
serviceAccountName: ovn
hostPID: true
containers:
- name: pinger
2019-11-27 11:18:45 +08:00
image: "index.alauda.cn/alaudak8s/kube-ovn-pinger:v0.9.1"
2019-10-14 18:21:30 +08:00
imagePullPolicy: IfNotPresent
securityContext:
runAsUser: 0
privileged: false
env:
- 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: /sys
name: host-sys
readOnly: true
- mountPath: /etc/openvswitch
name: host-config-openvswitch
- mountPath: /var/log/openvswitch
name: host-log
resources:
requests:
cpu: 100m
memory: 300Mi
limits:
cpu: 200m
memory: 400Mi
nodeSelector:
beta.kubernetes.io/os: "linux"
volumes:
- name: host-modules
hostPath:
path: /lib/modules
- name: host-run-ovs
hostPath:
path: /run/openvswitch
- name: host-sys
hostPath:
path: /sys
- name: host-config-openvswitch
hostPath:
path: /etc/origin/openvswitch
- name: host-log
hostPath:
path: /var/log/openvswitch
---
kind: Service
apiVersion: v1
metadata:
name: kube-ovn-pinger
namespace: kube-ovn
labels:
app: kube-ovn-pinger
spec:
selector:
app: kube-ovn-pinger
ports:
- port: 8080
name: http