-
Notifications
You must be signed in to change notification settings - Fork 106
/
server.yaml
100 lines (100 loc) · 2.84 KB
/
server.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
labels:
app: network-resources-injector
name: network-resources-injector
namespace: {{.Namespace}}
annotations:
kubernetes.io/description: |
This daemon set launches the network resource injector component on master or worker nodes.
release.openshift.io/version: "{{.ReleaseVersion}}"
spec:
selector:
matchLabels:
app: network-resources-injector
updateStrategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 33%
template:
metadata:
annotations:
target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}'
labels:
app: network-resources-injector
component: network
type: infra
openshift.io/component: network
annotations:
openshift.io/required-scc: restricted-v2
spec:
securityContext:
runAsNonRoot: true
serviceAccountName: network-resources-injector-sa
priorityClassName: "system-cluster-critical"
nodeSelector:
kubernetes.io/os: linux
affinity:
{{ if not .ExternalControlPlane }}
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-role.kubernetes.io/master
operator: Exists
- matchExpressions:
- key: node-role.kubernetes.io/control-plane
operator: Exists
{{ end }}
tolerations:
{{ if not .ExternalControlPlane }}
- key: "node-role.kubernetes.io/master"
operator: Exists
effect: NoSchedule
- key: "node-role.kubernetes.io/control-plane"
operator: Exists
effect: NoSchedule
- key: "node.kubernetes.io/not-ready"
operator: Exists
effect: NoSchedule
{{ end }}
{{- if .ImagePullSecrets }}
imagePullSecrets:
{{- range .ImagePullSecrets }}
- name: {{ . }}
{{- end }}
{{- end }}
containers:
- name: webhook-server
image: {{.NetworkResourcesInjectorImage}}
command:
- webhook
args:
- -bind-address=0.0.0.0
- -port=6443
- -tls-private-key-file=/etc/tls/tls.key
- -tls-cert-file=/etc/tls/tls.crt
- -insecure=true
- -logtostderr=true
- -alsologtostderr=true
env:
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
securityContext:
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
resources:
requests:
cpu: 10m
memory: 50Mi
volumeMounts:
- mountPath: /etc/tls
name: tls
volumes:
- name: tls
secret:
secretName: {{.InjectorWebhookSecretName}}