fix(miniserve): add networkpolicy support
This commit is contained in:
parent
9dac131ffd
commit
49bcbf4130
4 changed files with 61 additions and 2 deletions
|
@ -3,7 +3,7 @@ name: miniserve
|
||||||
description: A Helm chart for Kubernetes
|
description: A Helm chart for Kubernetes
|
||||||
icon: https://raw.githubusercontent.com/svenstaro/miniserve/master/data/logo.svg
|
icon: https://raw.githubusercontent.com/svenstaro/miniserve/master/data/logo.svg
|
||||||
type: application
|
type: application
|
||||||
version: 0.3.7
|
version: 0.4.0
|
||||||
# renovate: image=docker.io/svenstaro/miniserve
|
# renovate: image=docker.io/svenstaro/miniserve
|
||||||
appVersion: "0.27.0"
|
appVersion: "0.27.0"
|
||||||
maintainers:
|
maintainers:
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
= miniserve
|
= miniserve
|
||||||
|
|
||||||
image::https://img.shields.io/badge/Version-0.3.7-informational?style=flat-square[Version: 0.3.7]
|
image::https://img.shields.io/badge/Version-0.4.0-informational?style=flat-square[Version: 0.4.0]
|
||||||
image::https://img.shields.io/badge/Version-application-informational?style=flat-square[Type: application]
|
image::https://img.shields.io/badge/Version-application-informational?style=flat-square[Type: application]
|
||||||
image::https://img.shields.io/badge/AppVersion-0.27.0-informational?style=flat-square[AppVersion: 0.27.0]
|
image::https://img.shields.io/badge/AppVersion-0.27.0-informational?style=flat-square[AppVersion: 0.27.0]
|
||||||
== Maintainers
|
== Maintainers
|
||||||
|
@ -277,6 +277,26 @@ helm uninstall miniserve-release
|
||||||
| `""`
|
| `""`
|
||||||
|
|
|
|
||||||
|
|
||||||
|
| networkPolicy.egress.enabled
|
||||||
|
| bool
|
||||||
|
| `true`
|
||||||
|
| activate egress no networkpolicy
|
||||||
|
|
||||||
|
| networkPolicy.egress.extra
|
||||||
|
| list
|
||||||
|
| `[]`
|
||||||
|
| egress rules
|
||||||
|
|
||||||
|
| networkPolicy.enabled
|
||||||
|
| bool
|
||||||
|
| `false`
|
||||||
|
|
|
||||||
|
|
||||||
|
| networkPolicy.ingress.http
|
||||||
|
| list
|
||||||
|
| `[]`
|
||||||
|
| ingress for http port (e.g. ingress-controller)
|
||||||
|
|
||||||
| nodeSelector
|
| nodeSelector
|
||||||
| object
|
| object
|
||||||
| `{}`
|
| `{}`
|
||||||
|
|
28
miniserve/templates/networkpolicy.yaml
Normal file
28
miniserve/templates/networkpolicy.yaml
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
{{- if .Values.networkPolicy.enabled }}
|
||||||
|
---
|
||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: NetworkPolicy
|
||||||
|
metadata:
|
||||||
|
name: {{ include "miniserve.fullname" . }}
|
||||||
|
labels:
|
||||||
|
{{- include "miniserve.labels" . | nindent 4 }}
|
||||||
|
spec:
|
||||||
|
podSelector:
|
||||||
|
matchLabels:
|
||||||
|
{{- include "miniserve.selectorLabels" . | nindent 6 }}
|
||||||
|
policyTypes:
|
||||||
|
- Ingress
|
||||||
|
{{- if .Values.networkPolicy.egress.enabled }}
|
||||||
|
- Egress
|
||||||
|
{{- end }}
|
||||||
|
ingress:
|
||||||
|
- ports:
|
||||||
|
- port: {{ .Values.service.port }}
|
||||||
|
protocol: TCP
|
||||||
|
from:
|
||||||
|
{{- toYaml .Values.networkPolicy.ingress.http | nindent 8 }}
|
||||||
|
{{- with .Values.networkPolicy.egress }}
|
||||||
|
egress:
|
||||||
|
{{- toYaml .extra | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
|
@ -126,6 +126,17 @@ service:
|
||||||
type: ClusterIP
|
type: ClusterIP
|
||||||
port: 8080
|
port: 8080
|
||||||
|
|
||||||
|
networkPolicy:
|
||||||
|
enabled: false
|
||||||
|
ingress:
|
||||||
|
# -- ingress for http port (e.g. ingress-controller)
|
||||||
|
http: []
|
||||||
|
egress:
|
||||||
|
# -- activate egress no networkpolicy
|
||||||
|
enabled: true
|
||||||
|
# -- egress rules
|
||||||
|
extra: []
|
||||||
|
|
||||||
ingress:
|
ingress:
|
||||||
enabled: false
|
enabled: false
|
||||||
className: ""
|
className: ""
|
||||||
|
|
Loading…
Add table
Reference in a new issue