Skip to content

Commit

Permalink
add CiliumNetworkPolicy (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
glitchcrab authored Jan 23, 2024
1 parent 944939a commit 9210923
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Add `CiliumNetworkPolicy`.

### Changed

- upgrade grafana chart: 7.0.11 => 7.0.19
Expand Down
8 changes: 8 additions & 0 deletions helm/grafana/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
application.giantswarm.io/team: {{ index .Chart.Annotations "application.giantswarm.io/team" | default "atlas" | quote }}
{{- end -}}

{{/*
Selector labels
*/}}
{{- define "labels.selector" -}}
app.kubernetes.io/name: {{ .Chart.Name | quote }}
app.kubernetes.io/instance: {{ .Chart.Name | quote }}
{{- end -}}

{{/*
Return the appropriate apiVersion for podSecurityPolicy.
*/}}
Expand Down
17 changes: 17 additions & 0 deletions helm/grafana/templates/cilium-network-policy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{- if .Values.ciliumNetworkPolicy.enabled -}}
apiVersion: "cilium.io/v2"
kind: CiliumNetworkPolicy
metadata:
labels:
{{- include "labels.selector" . | nindent 4 }}
name: {{ .Chart.Name }}
namespace: {{ .Release.Namespace }}
spec:
endpointSelector:
matchLabels:
{{- include "labels.selector" . | nindent 6 }}
egress:
- toEntities:
- kube-apiserver
- cluster
{{- end -}}
8 changes: 8 additions & 0 deletions helm/grafana/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
"$schema": "http://json-schema.org/schema#",
"type": "object",
"properties": {
"ciliumNetworkPolicy": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
}
}
},
"global": {
"type": "object",
"properties": {
Expand Down
3 changes: 3 additions & 0 deletions helm/grafana/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ global:
imageRegistry: null
imagePullSecrets: []

ciliumNetworkPolicy:
enabled: true

grafana:
rbac:
create: true
Expand Down

0 comments on commit 9210923

Please sign in to comment.