-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: enable istio and netpols for everything (#37)
## Description This PR enables Istio and adds netpols for everything. > [!IMPORTANT] >⚠️ **BREAKING CHANGES** > > - `postgres.ingress` within the `uds-postgres-config` chart is now an array of objects instead of a single entry - please update accordingly (single objects will still function but this is now deprecated). > - _All_ clients must be behind Istio now. This should already be happening for clients built as UDS packages but may not be for others. ## Related Issue Fixes #N/A ## Type of change - [ ] Bug fix (non-breaking change which fixes an issue) - [X] New feature (non-breaking change which adds functionality) - [ ] Other (security config, docs update, etc) ## Checklist before merging - [X] Test, docs, adr added or updated as needed - [X] [Contributor Guide Steps](https://github.com/defenseunicorns/uds-package-postgres-operator/blob/main/CONTRIBUTING.md#developer-workflow) followed
- Loading branch information
Showing
16 changed files
with
144 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +0,0 @@ | ||
variables: | ||
postgres-operator: | ||
postgresql: | ||
enabled: true # Set to false to not create the PostgreSQL resource | ||
teamId: "uds" | ||
volume: | ||
size: "10Gi" | ||
numberOfInstances: 2 | ||
users: | ||
gitlab.gitlab: [] # database owner | ||
sonarqube.sonarqube: [] # database owner | ||
mattermost.mattermost: [] # database owner | ||
databases: | ||
gitlabdb: gitlab.gitlab | ||
mattermostdb: mattermost.mattermost | ||
sonarqubedb: sonarqube.sonarqube | ||
version: "13" | ||
ingress: | ||
remoteGenerated: Anywhere | ||
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{{- if .Values.postgresql.enabled }} | ||
apiVersion: uds.dev/v1alpha1 | ||
kind: Package | ||
metadata: | ||
name: postgres | ||
namespace: postgres | ||
spec: | ||
network: | ||
allow: | ||
- direction: Ingress | ||
remoteGenerated: IntraNamespace | ||
|
||
- direction: Egress | ||
remoteGenerated: IntraNamespace | ||
|
||
{{- if kindIs "slice" .Values.postgresql.ingress -}} | ||
{{- range .Values.postgresql.ingress }} | ||
- direction: Ingress | ||
selector: | ||
cluster-name: pg-cluster | ||
{{ . | toYaml | nindent 8 }} | ||
{{- end }} | ||
{{- else }} | ||
- direction: Ingress | ||
selector: | ||
cluster-name: pg-cluster | ||
{{- .Values.postgresql.ingress | toYaml | nindent 8 }} | ||
{{- end }} | ||
|
||
- direction: Ingress | ||
selector: | ||
app.kubernetes.io/name: postgres-operator | ||
remoteNamespace: {{ .Release.Namespace }} | ||
remoteSelector: | ||
app.kubernetes.io/name: postgres-operator | ||
|
||
- direction: Egress | ||
selector: | ||
cluster-name: pg-cluster | ||
remoteGenerated: KubeAPI | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,37 @@ | ||
{{- if .Values.postgresql.enabled }} | ||
apiVersion: uds.dev/v1alpha1 | ||
kind: Package | ||
metadata: | ||
name: postgres | ||
name: postgres-operator | ||
namespace: {{ .Release.Namespace }} | ||
spec: | ||
network: | ||
allow: | ||
- direction: Ingress | ||
remoteGenerated: IntraNamespace | ||
{{- if .Values.postgresql.enabled }} | ||
- direction: Egress | ||
remoteGenerated: IntraNamespace | ||
{{- if .Values.postgresql.ingress }} | ||
- direction: Ingress | ||
selector: | ||
app.kubernetes.io/name: postgres-operator | ||
remoteNamespace: postgres | ||
remoteSelector: | ||
cluster-name: pg-cluster | ||
{{- .Values.postgresql.ingress | toYaml | nindent 8 }} | ||
{{- end }} | ||
|
||
- direction: Egress | ||
selector: | ||
cluster-name: pg-cluster | ||
app.kubernetes.io/name: postgres-operator | ||
remoteGenerated: KubeAPI | ||
{{- end }} | ||
|
||
# Custom rules for other scenarios (such as connecting to a non-default pg cluster) | ||
{{- range .Values.custom }} | ||
- direction: {{ .direction }} | ||
selector: | ||
{{ .selector | toYaml | nindent 10 }} | ||
{{- if not .remoteGenerated }} | ||
remoteNamespace: {{ .remoteNamespace }} | ||
remoteSelector: | ||
{{ .remoteSelector | toYaml | nindent 10 }} | ||
port: {{ .port }} | ||
{{- else }} | ||
remoteGenerated: {{ .remoteGenerated }} | ||
{{- end }} | ||
description: {{ .description }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,8 @@ kind: Job | |
metadata: | ||
name: db-seed-job | ||
namespace: gitlab | ||
labels: | ||
app: gitlab | ||
spec: | ||
template: | ||
spec: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,8 @@ kind: Job | |
metadata: | ||
name: db-seed-job | ||
namespace: acid | ||
labels: | ||
app: acid | ||
spec: | ||
template: | ||
spec: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters