Skip to content

Commit eadd4a7

Browse files
committed
Add default global network policy
1 parent 2b99236 commit eadd4a7

File tree

12 files changed

+226
-57
lines changed

12 files changed

+226
-57
lines changed

charts/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ values.yaml
22
values.*.yaml
33
k8s_hosts.ini
44
helmfile.y?ml
5+
6+
*.tgz
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apiVersion: projectcalico.org/v3
2+
kind: NetworkPolicy
3+
metadata:
4+
name: adminer-network-policy
5+
labels:
6+
{{- include "adminer.labels" . | nindent 4 }}
7+
spec:
8+
selector: app.kubernetes.io/instance == "{{ .Release.Name }}"
9+
ingress:
10+
- action: Allow
11+
protocol: TCP
12+
destination:
13+
ports:
14+
- {{ .Values.service.port }}
15+
egress:
16+
- action: Allow
17+
protocol: TCP
18+
destination:
19+
ports:
20+
- 5432
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
apiVersion: v2
2+
name: calico-configuration
3+
description: A Helm chart for Kubernetes
4+
5+
# A chart can be either an 'application' or a 'library' chart.
6+
#
7+
# Application charts are a collection of templates that can be packaged into versioned archives
8+
# to be deployed.
9+
#
10+
# Library charts provide useful utilities or functions for the chart developer. They're included as
11+
# a dependency of application charts to inject those utilities and functions into the rendering
12+
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
13+
type: application
14+
15+
# This is the chart version. This version number should be incremented each time you make changes
16+
# to the chart and its templates, including the app version.
17+
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18+
version: 0.0.1
19+
20+
# This is the version number of the application being deployed. This version number should be
21+
# incremented each time you make changes to the application. Versions are not expected to
22+
# follow Semantic Versioning. They should reflect the version the application is using.
23+
# It is recommended to use it with quotes.
24+
appVersion: "3.26.4"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
## Observe network traffic
2+
3+
https://docs.tigera.io/calico/latest/observability/enable-whisker
4+
https://docs.tigera.io/calico/3.30/observability/view-flow-logs
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This chart configures Calico but does not deploy Calico itself. This is done via Kubespray during Kubernetes Cluster provisioning.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Source: https://docs.tigera.io/calico-enterprise/latest/network-policy/default-deny#best-practice-2-keep-the-scope-to-non-system-pods
2+
apiVersion: projectcalico.org/v3
3+
kind: GlobalNetworkPolicy
4+
metadata:
5+
name: default-global-deny-network-policy
6+
spec:
7+
# on local deployment, calico is installed in the `calico-system` namespace
8+
# and the operator is in the `tigera-operator` namespace
9+
namespaceSelector: kubernetes.io/metadata.name in {"adminer"}
10+
types:
11+
- Ingress
12+
- Egress
13+
egress:
14+
# allow all namespaces to communicate to DNS pods
15+
- action: Allow
16+
protocol: UDP
17+
destination:
18+
selector: 'k8s-app == "kube-dns"'
19+
ports:
20+
- 53
21+
- action: Allow
22+
protocol: TCP
23+
destination:
24+
selector: 'k8s-app == "kube-dns"'
25+
ports:
26+
- 53

charts/portainer/Chart.lock

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
dependencies:
2+
- name: portainer
3+
repository: https://portainer.github.io/k8s/
4+
version: 1.0.54
5+
digest: sha256:bafe4182881aee8c6df3d3c6f8c523a1bd7577bed04942ad3d9b857a5437d96f
6+
generated: "2025-07-29T11:07:15.39037387+02:00"

charts/portainer/Chart.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
apiVersion: v2
2+
name: portainer
3+
description: A Helm chart for Kubernetes
4+
5+
# A chart can be either an 'application' or a 'library' chart.
6+
#
7+
# Application charts are a collection of templates that can be packaged into versioned archives
8+
# to be deployed.
9+
#
10+
# Library charts provide useful utilities or functions for the chart developer. They're included as
11+
# a dependency of application charts to inject those utilities and functions into the rendering
12+
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
13+
type: application
14+
15+
# This is the chart version. This version number should be incremented each time you make changes
16+
# to the chart and its templates, including the app version.
17+
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18+
version: 1.0.54
19+
20+
# This is the version number of the application being deployed. This version number should be
21+
# incremented each time you make changes to the application. Versions are not expected to
22+
# follow Semantic Versioning. They should reflect the version the application is using.
23+
# It is recommended to use it with quotes.
24+
appVersion: 2.21.2
25+
26+
dependencies:
27+
- name: portainer
28+
version: 1.0.54
29+
repository: "https://portainer.github.io/k8s/"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Wrapper around portainer helm chart https://github.com/portainer/k8s

0 commit comments

Comments
 (0)