UNCLASSIFIED

Commit c2b52a1e authored by kevin.wilder's avatar kevin.wilder
Browse files

Merge branch 'network-policies' into 'main'

Network policies

See merge request !4
parents b71f41b3 e8d6ff71
Pipeline #308226 passed with stages
in 2 minutes and 56 seconds
# Changelog # Changelog
## [29.1.0-bb.2]
# Added
* default-deny-all network policy
* istio network policy
* monitoring network policy
apiVersion: v2 apiVersion: v2
name: nexus-repository-manager name: nexus-repository-manager
version: 29.1.0-bb.1 version: 29.1.0-bb.2
appVersion: 3.29.0 appVersion: 3.29.0
description: Sonatype Nexus Repository Manager - Universal Binary repository description: Sonatype Nexus Repository Manager - Universal Binary repository
type: application type: application
......
{{ if .Values.networkPolicies.enabled }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: default-deny-all
namespace: {{ .Release.Namespace }}
spec:
podSelector: {}
policyTypes:
- Ingress
- Egress
ingress: []
egress: []
{{- end }}
{{ if .Values.networkPolicies.enabled }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-to-istio-ingressgateway
namespace: {{ .Release.Namespace }}
spec:
podSelector: {}
policyTypes:
- Ingress
ingress:
- from:
- namespaceSelector:
matchLabels:
app.kubernetes.io/name: istio-controlplane
podSelector:
matchLabels:
{{- toYaml .Values.networkPolicies.ingressLabels | nindent 10}}
ports:
- port: {{ .Values.nexus.nexusPort }}
{{- range .Values.nexus.docker.registries }}
- port: {{ .port }}
{{- end }}
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-to-istio-egress
namespace: {{ .Release.Namespace }}
spec:
podSelector: {}
policyTypes:
- Egress
egress:
- to:
- namespaceSelector:
matchLabels:
app.kubernetes.io/name: istio-controlplane
podSelector:
matchLabels:
istio: pilot
ports:
- port: 15012
{{- end }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: kube-api-dns-egress
namespace: {{ .Release.Namespace }}
spec:
egress:
- to:
- namespaceSelector: {}
ports:
- port: 443
protocol: TCP
- port: 53
protocol: UDP
podSelector:
matchLabels:
app.kubernetes.io/name: nexus-repository-manager
policyTypes:
- Egress
\ No newline at end of file
{{- if and .Values.networkPolicies.enabled .Values.monitoring.enabled }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-scraping
namespace: "{{ .Release.Namespace }}"
spec:
ingress:
- from:
- namespaceSelector:
matchLabels:
app.kubernetes.io/name: monitoring
podSelector:
matchLabels:
app: prometeus
ports:
- port: {{ .Values.nexus.nexusPort }}
podSelector:
matchLabels:
app.kubernetes.io/name: nexus-repository-manager
policyTypes:
- Ingress
{{- end }}
...@@ -6,6 +6,13 @@ istio: ...@@ -6,6 +6,13 @@ istio:
nexus: nexus:
gateways: gateways:
- "istio-system/main" - "istio-system/main"
networkPolicies:
enabled: false
ingressLabels:
app: istio-ingressgateway
istio: ingressgateway
monitoring: monitoring:
enabled: false enabled: false
license_key: "" license_key: ""
......
...@@ -4,5 +4,6 @@ istio: ...@@ -4,5 +4,6 @@ istio:
nexus: nexus:
imagePullSecrets: imagePullSecrets:
- name: private-registry-mil - name: private-registry-mil
networkPolicies:
enabled: true
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