Skip to content

Commit

Permalink
[fix] add exception for the platform in network policy
Browse files Browse the repository at this point in the history
  • Loading branch information
facchettos committed Aug 1, 2024
1 parent 8cea580 commit 58f6511
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions chart/templates/networkpolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ spec:
podSelector:
matchLabels:
k8s-app: kube-dns
{{- if .Values.policies.networkPolicy.platformEnabled }}
- podSelector:
matchLabels:
app: loft
namespaceSelector: {}
{{- end }}
policyTypes:
- Egress
{{- end }}
3 changes: 3 additions & 0 deletions chart/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1931,6 +1931,9 @@
"type": "boolean",
"description": "Enabled defines if the network policy should be deployed by vCluster."
},
"platformEnabled": {
"type": "boolean"
},
"fallbackDns": {
"type": "string"
},
Expand Down
1 change: 1 addition & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,7 @@ policies:
networkPolicy:
# Enabled defines if the network policy should be deployed by vCluster.
enabled: false
platformEnabled: true
labels: {}
annotations: {}
fallbackDns: 8.8.8.8
Expand Down
3 changes: 2 additions & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -1438,7 +1438,8 @@ type LimitRange struct {

type NetworkPolicy struct {
// Enabled defines if the network policy should be deployed by vCluster.
Enabled bool `json:"enabled,omitempty"`
Enabled bool `json:"enabled,omitempty"`
PlatformEnabled bool `json:"platformEnabled,omitempty"`

FallbackDNS string `json:"fallbackDns,omitempty"`
OutgoingConnections OutgoingConnections `json:"outgoingConnections,omitempty"`
Expand Down
1 change: 1 addition & 0 deletions config/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ policies:

networkPolicy:
enabled: false
platformEnabled: true
labels: {}
annotations: {}
fallbackDns: 8.8.8.8
Expand Down

0 comments on commit 58f6511

Please sign in to comment.