Skip to content

Commit

Permalink
Add network-policies helm release (#507)
Browse files Browse the repository at this point in the history
* Add network-policies helm release

* adjust value path

* adjust other values

* normalize schema

* Update CHANGELOG
  • Loading branch information
mnitchev authored Feb 14, 2024
1 parent 4f3178e commit ae6b44f
Show file tree
Hide file tree
Showing 5 changed files with 59 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 network-policies helm release.

## [0.61.0] - 2024-02-12

### Changed
Expand Down
1 change: 1 addition & 0 deletions helm/cluster-aws/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ Properties within the `.global.connectivity` object
| `global.connectivity.dns` | **DNS**|**Type:** `object`<br/>|
| `global.connectivity.dns.resolverRulesOwnerAccount` | **Resolver rules owner** - ID of the AWS account that created the resolver rules to be associated with the workload cluster VPC.|**Type:** `string`<br/>|
| `global.connectivity.network` | **Network**|**Type:** `object`<br/>|
| `global.connectivity.network.allowAllEgress` | **Allow all egress**|**Type:** `boolean`<br/>**Default:** `false`|
| `global.connectivity.network.internetGatewayId` | **Internet Gateway ID** - ID of the Internet gateway for the VPC.|**Type:** `string`<br/>|
| `global.connectivity.network.pods` | **Pods**|**Type:** `object`<br/>|
| `global.connectivity.network.pods.cidrBlocks` | **Pod subnets**|**Type:** `array`<br/>**Default:** `["100.64.0.0/12"]`|
Expand Down
48 changes: 48 additions & 0 deletions helm/cluster-aws/templates/netpol-helmrelease.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{{- if not .Values.global.connectivity.network.allowAllEgress }}
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: {{ include "resource.default.name" $ }}-network-policies
namespace: {{ $.Release.Namespace }}
annotations:
cluster.giantswarm.io/description: "{{ .Values.global.metadata.description }}"
labels:
{{- include "labels.common" . | nindent 4 }}
spec:
releaseName: network-policies
targetNamespace: kube-system
storageNamespace: kube-system
chart:
spec:
chart: network-policies
version: 0.0.3
sourceRef:
kind: HelmRepository
name: {{ include "resource.default.name" $ }}-cluster
dependsOn:
- name: {{ include "resource.default.name" $ }}-cilium
namespace: {{ $.Release.Namespace }}
kubeConfig:
secretRef:
name: {{ include "resource.default.name" $ }}-kubeconfig
interval: 1m
install:
remediation:
retries: 30
# Default values
# https://github.com/giantswarm/network-policies-app/blob/main/helm/network-policies-app/values.yaml
# values:
---
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: HelmRepository
metadata:
name: {{ include "resource.default.name" $ }}-cluster
namespace: {{ $.Release.Namespace }}
annotations:
cluster.giantswarm.io/description: "{{ .Values.clusterDescription }}"
labels:
{{- include "labels.common" . | nindent 4 }}
spec:
interval: 10m
url: https://giantswarm.github.io/cluster-catalog
{{- end }}
5 changes: 5 additions & 0 deletions helm/cluster-aws/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,11 @@
"type": "object",
"title": "Network",
"properties": {
"allowAllEgress": {
"type": "boolean",
"title": "Allow all egress",
"default": false
},
"internetGatewayId": {
"type": "string",
"title": "Internet Gateway ID",
Expand Down
1 change: 1 addition & 0 deletions helm/cluster-aws/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ global:
availabilityZoneUsageLimit: 3
dns: {}
network:
allowAllEgress: false
pods:
cidrBlocks:
- 100.64.0.0/12
Expand Down

0 comments on commit ae6b44f

Please sign in to comment.