File tree Expand file tree Collapse file tree 5 files changed +63
-1
lines changed
charts/apl-network-policies
templates/networkpolicies
values/apl-network-policies Expand file tree Collapse file tree 5 files changed +63
-1
lines changed Original file line number Diff line number Diff line change
1
+ {{- if .Values.netpols.otomiApi }}
2
+ ---
3
+ apiVersion : networking.k8s.io/v1
4
+ kind : NetworkPolicy
5
+ metadata :
6
+ name : otomi-api-platform-policy
7
+ namespace : otomi
8
+ labels :
9
+ {{- include "apl-network-policies.labels" . | nindent 4 }}
10
+ app : otomi-api
11
+ spec :
12
+ podSelector :
13
+ matchLabels :
14
+ app.kubernetes.io/name : otomi-api
15
+ policyTypes :
16
+ - Ingress
17
+ ingress :
18
+ # Allow access from Istio public ingress gateway
19
+ - from :
20
+ - namespaceSelector :
21
+ matchLabels :
22
+ name : istio-system
23
+ podSelector :
24
+ matchLabels :
25
+ app.kubernetes.io/instance : istio-ingressgateway-public
26
+ # Allow access from gitea for webhook notifications
27
+ - from :
28
+ - namespaceSelector :
29
+ matchLabels :
30
+ name : gitea
31
+ podSelector :
32
+ matchLabels :
33
+ app : gitea
34
+ # Allow monitoring access for metrics scraping
35
+ - from :
36
+ - namespaceSelector :
37
+ matchLabels :
38
+ name : monitoring
39
+ podSelector :
40
+ matchLabels :
41
+ app.kubernetes.io/instance : po-prometheus
42
+ # Allow internal otomi namespace communication
43
+ - from :
44
+ - namespaceSelector :
45
+ matchLabels :
46
+ name : otomi
47
+ {{- end }}
Original file line number Diff line number Diff line change 7
7
# Example configuration (all commented out):
8
8
# Simple on/off switch per application
9
9
# netpols:
10
- # gitea: true # Enable network policies for Gitea with sensible defaults
10
+ # gitea: true # Enable network policies for Gitea with sensible defaults
11
+ # otomiApi: true # Enable network policies for otomi-api with sensible defaults
11
12
12
13
# Network policy behavior when enabled:
13
14
#
23
24
# * CNPG system (for database management)
24
25
# * Internal gitea namespace communication
25
26
#
27
+ # For otomi-api (netpols.otomiApi: true):
28
+ # - Creates a NetworkPolicy in the otomi namespace
29
+ # - Allows ingress from:
30
+ # * Istio public ingress gateway (for web access)
31
+ # * Gitea namespace (for webhook notifications)
32
+ # * Monitoring namespace (for metrics scraping)
33
+ # * Internal otomi namespace communication
34
+ #
26
35
# The complex network policy rules are baked into the chart templates,
27
36
# so users only need to toggle network policies on/off per application.
Original file line number Diff line number Diff line change @@ -967,6 +967,8 @@ environments:
967
967
otomi-api :
968
968
editorInactivityTimeout : 1
969
969
_rawValues : {}
970
+ networkPolicies :
971
+ enabled : true
970
972
resources :
971
973
api :
972
974
limits :
Original file line number Diff line number Diff line change @@ -2531,6 +2531,8 @@ properties:
2531
2531
$ref : ' #/definitions/resources'
2532
2532
tools :
2533
2533
$ref : ' #/definitions/resources'
2534
+ networkPolicies :
2535
+ $ref : ' #/definitions/appNetworkPolicyConfig'
2534
2536
otomi-console :
2535
2537
additionalProperties : false
2536
2538
properties :
Original file line number Diff line number Diff line change 1
1
{{- $v := .Values }}
2
2
{{- $a := $v.apps }}
3
+ {{- $oa := $v.apps | get "otomi-api" }}
3
4
4
5
# Simple per-app network policy configuration
5
6
netpols:
6
7
gitea: {{ $a.gitea.networkPolicies.enabled}}
8
+ otomiApi: {{ $oa.networkPolicies.enabled}}
You can’t perform that action at this time.
0 commit comments