diff --git a/deploy/handler/network_policy.yaml b/deploy/handler/network_policy.yaml index 47cc0e8fb..09177fb32 100644 --- a/deploy/handler/network_policy.yaml +++ b/deploy/handler/network_policy.yaml @@ -121,6 +121,36 @@ spec: --- apiVersion: networking.k8s.io/v1 kind: NetworkPolicy +metadata: + name: allow-webhook-egress-dns + namespace: {{ .HandlerNamespace }} +spec: + podSelector: + matchLabels: + app: kubernetes-nmstate + component: kubernetes-nmstate-webhook + egress: + - ports: + - protocol: UDP + port: 53 + - protocol: TCP + port: 53 +{{- if .IsOpenShift }} + - to: + - namespaceSelector: + matchLabels: + kubernetes.io/metadata.name: openshift-dns + ports: + - protocol: UDP + port: 5353 + - protocol: TCP + port: 5353 +{{- end }} + policyTypes: + - Egress +--- +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy metadata: name: allow-metrics-egress-api-6443 namespace: {{ .HandlerNamespace }} @@ -138,6 +168,65 @@ spec: --- apiVersion: networking.k8s.io/v1 kind: NetworkPolicy +metadata: + name: allow-metrics-egress-dns + namespace: {{ .HandlerNamespace }} +spec: + podSelector: + matchLabels: + app: kubernetes-nmstate + component: kubernetes-nmstate-metrics + egress: + - ports: + - protocol: UDP + port: 53 + - protocol: TCP + port: 53 +{{- if .IsOpenShift }} + - to: + - namespaceSelector: + matchLabels: + kubernetes.io/metadata.name: openshift-dns + ports: + - protocol: UDP + port: 5353 + - protocol: TCP + port: 5353 +{{- end }} + policyTypes: + - Egress +--- +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: allow-operator-egress-dns + namespace: {{ .OperatorNamespace }} +spec: + podSelector: + matchLabels: + app: kubernetes-nmstate-operator + egress: + - ports: + - protocol: UDP + port: 53 + - protocol: TCP + port: 53 +{{- if .IsOpenShift }} + - to: + - namespaceSelector: + matchLabels: + kubernetes.io/metadata.name: openshift-dns + ports: + - protocol: UDP + port: 5353 + - protocol: TCP + port: 5353 +{{- end }} + policyTypes: + - Egress +--- +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy metadata: name: default-deny-labelled-operator namespace: {{ .OperatorNamespace }} diff --git a/deploy/handler/operator.yaml b/deploy/handler/operator.yaml index 9edeb28b9..890b13d0a 100644 --- a/deploy/handler/operator.yaml +++ b/deploy/handler/operator.yaml @@ -92,15 +92,19 @@ spec: - containerPort: 8443 name: metrics protocol: TCP - readinessProbe: + startupProbe: tcpSocket: port: metrics initialDelaySeconds: 10 periodSeconds: 10 + failureThreshold: 18 + readinessProbe: + tcpSocket: + port: metrics + periodSeconds: 10 livenessProbe: tcpSocket: port: metrics - initialDelaySeconds: 10 periodSeconds: 10 timeoutSeconds: 1 successThreshold: 1 @@ -192,6 +196,12 @@ spec: - containerPort: 9443 name: webhook-server protocol: TCP + startupProbe: + tcpSocket: + port: webhook-server + initialDelaySeconds: 10 + periodSeconds: 10 + failureThreshold: 18 readinessProbe: httpGet: path: /readyz @@ -200,7 +210,6 @@ spec: httpHeaders: - name: Content-Type value: application/json - initialDelaySeconds: 10 periodSeconds: 10 livenessProbe: httpGet: @@ -210,7 +219,6 @@ spec: httpHeaders: - name: Content-Type value: application/json - initialDelaySeconds: 10 periodSeconds: 10 timeoutSeconds: 1 successThreshold: 1