Skip to content

Commit

Permalink
Merge pull request #44 from Starttoaster/helm-networkpolicy
Browse files Browse the repository at this point in the history
helm: Add networkpolicy to chart
  • Loading branch information
Starttoaster authored Jun 12, 2024
2 parents 776400a + 17c652d commit 785a9f7
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 1 deletion.
2 changes: 1 addition & 1 deletion chart/proxmox-exporter/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.10
version: 0.2.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
35 changes: 35 additions & 0 deletions chart/proxmox-exporter/templates/networkpolicy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{{- if .Values.networkPolicy.enabled -}}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: {{ include "proxmox-exporter.fullname" . }}
labels:
{{- include "proxmox-exporter.labels" . | nindent 4 }}
spec:
podSelector:
matchExpressions:
- key: app.kubernetes.io/instance
operator: In
values:
- {{ .Release.Name }}
- key: app.kubernetes.io/name
operator: In
values:
- {{ include "proxmox-exporter.name" . }}
policyTypes:
{{- with .Values.networkPolicy.policyTypes }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{if has "Ingress" .Values.networkPolicy.policyTypes }}
ingress:
{{- with .Values.networkPolicy.ingressRules }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
{{if has "Egress" .Values.networkPolicy.policyTypes }}
egress:
{{- with .Values.networkPolicy.egressRules }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
{{- end }}
22 changes: 22 additions & 0 deletions chart/proxmox-exporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,28 @@ serviceAccount:
# If not set and create is true, a name is generated using the fullname template
name: ""

networkPolicy:
enabled: false
policyTypes: []
# - Egress
# - Ingress
egressRules: []
# - to:
# - namespaceSelector:
# matchLabels:
# name: chia-blockchain
# ports:
# - protocol: TCP
# port: 8555
ingressRules: []
# - from:
# - namespaceSelector:
# matchLabels:
# name: chia-blockchain
# ports:
# - protocol: TCP
# port: 8555

podAnnotations: {}

podSecurityContext: {}
Expand Down

0 comments on commit 785a9f7

Please sign in to comment.