UNCLASSIFIED

Commit b0eb4d20 authored by Ryan Garcia's avatar Ryan Garcia
Browse files

Merge branch 'network-policy-2' into 'main'

Network Policy Template Finalization

See merge request !24
parents f32694ac 5e6f9b41
Pipeline #304748 passed with stages
in 4 minutes and 43 seconds
...@@ -4,6 +4,28 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ...@@ -4,6 +4,28 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
--- ---
## [0.0.5-bb.0] - 2021-06-02
### Changed
- Network policy resource Templates
## [0.0.4-bb.3] - 2021-06-01
### Added
- Gluon test library dependency
### Changed
- CI Test infrastructure. Migrating to helm tests with script capabilities.
## [0.0.4-bb.2] - 2021-05-26
### Added
- Network policy resource Templates
## [0.0.4-bb.0] - 2021-05-12 ## [0.0.4-bb.0] - 2021-05-12
### Added ### Added
......
apiVersion: v2 apiVersion: v2
name: twistlock name: twistlock
version: 0.0.4-bb.3 version: 0.0.5-bb.0
appVersion: 21.04.412 appVersion: 21.04.412
dependencies: dependencies:
- name: gluon - name: gluon
......
{{- if .Values.networkPolicies.enabled }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: egress-kube-dns
namespace: "{{ .Release.Namespace }}"
spec:
egress:
- to:
- namespaceSelector: {} # all namespaces
ports:
- port: 53
protocol: UDP
podSelector: {} # all pods in Release namespace
policyTypes:
- Egress
{{- end }}
{{- $bbtests := .Values.bbtests | default dict -}}
{{- $cypress := $bbtests.cypress | default dict -}}
{{- $enabled := (hasKey $bbtests "enabled") -}}
{{- $artifacts := (hasKey $cypress "artifacts") -}}
{{- if and $enabled $artifacts }}
{{- if and .Values.networkPolicies.enabled .Values.bbtests.enabled .Values.bbtests.cypress.artifacts }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-helm-test-egress
namespace: {{ .Release.Namespace }}
spec:
podSelector:
matchLabels:
helm-test: enabled
policyTypes:
- Egress
egress:
- {}
{{- end }}
{{- end }}
...@@ -2,14 +2,12 @@ ...@@ -2,14 +2,12 @@
apiVersion: networking.k8s.io/v1 apiVersion: networking.k8s.io/v1
kind: NetworkPolicy kind: NetworkPolicy
metadata: metadata:
name: ingress-allow-cluster name: ingress-allow-ns
namespace: "{{ .Release.Namespace }}" namespace: "{{ .Release.Namespace }}"
spec: spec:
ingress: ingress:
- from: - from:
- namespaceSelector: {} # all namespaces for now - podSelector: {} # all pods in namespace
ports:
- port: 8084 # communications port
podSelector: {} # all pods podSelector: {} # all pods
policyTypes: policyTypes:
- Ingress - Ingress
......
...@@ -2,21 +2,23 @@ ...@@ -2,21 +2,23 @@
apiVersion: networking.k8s.io/v1 apiVersion: networking.k8s.io/v1
kind: NetworkPolicy kind: NetworkPolicy
metadata: metadata:
name: istio name: istio-ingress
namespace: "{{ .Release.Namespace }}" namespace: "{{ .Release.Namespace }}"
spec: spec:
podSelector: {} podSelector:
matchLabels:
app: twistlock-console
policyTypes: policyTypes:
- Ingress - Ingress
- Egress
ingress: ingress:
- from: - from:
- namespaceSelector:
matchLabels:
app.kubernetes.io/name: istio-controlplane
egress:
- to:
- namespaceSelector: - namespaceSelector:
matchLabels: matchLabels:
app.kubernetes.io/name: istio-controlplane app.kubernetes.io/name: istio-controlplane
podSelector:
matchLabels:
{{- toYaml .Values.networkPolicies.ingressLabels | nindent 12}}
ports:
- port: 8081 #Default UI console Port
- port: 8083 #TLS configured UI console Port
{{- end }} {{- end }}
...@@ -7,11 +7,17 @@ metadata: ...@@ -7,11 +7,17 @@ metadata:
spec: spec:
ingress: ingress:
- from: - from:
- namespaceSelector: {} # all namespaces for now - namespaceSelector:
matchLabels:
app.kubernetes.io/name: monitoring
podSelector:
matchLabels:
app: prometheus
ports: ports:
- port: PROMETHEUS_PORT - port: 8081
protocol: TCP podSelector:
podSelector: {} # all pods matchLabels:
name: twistlock-console
policyTypes: policyTypes:
- Ingress - Ingress
{{- end }} {{- end }}
{{- if and .Values.networkPolicies.enabled .Values.istio.enabled }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-istiod-egress
namespace: {{ .Release.Namespace }}
spec:
podSelector: {}
policyTypes:
- Egress
egress:
- to:
- namespaceSelector:
matchLabels:
app.kubernetes.io/name: istio-controlplane
podSelector:
matchLabels:
app: istiod
ports:
- port: 15012
{{- end }}
\ No newline at end of file
...@@ -18,6 +18,9 @@ istio: ...@@ -18,6 +18,9 @@ istio:
networkPolicies: networkPolicies:
enabled: false enabled: false
ingressLabels:
app: istio-ingressgateway
istio: ingressgateway
# imagePullSecrets defines the secrets to use when pulling the operator container image. # imagePullSecrets defines the secrets to use when pulling the operator container image.
imagePullSecrets: [] imagePullSecrets: []
......
istio: istio:
enabled: true enabled: true
networkPolicies:
enabled: true
imagePullSecrets: imagePullSecrets:
- name: private-registry-mil - name: private-registry-mil
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment