Skip to content

Commit

Permalink
Geoweb pod affinity and disruption budget (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
petringo authored Oct 16, 2024
1 parent ffc9e14 commit c5530e0
Show file tree
Hide file tree
Showing 30 changed files with 179 additions and 29 deletions.
2 changes: 1 addition & 1 deletion charts/geoweb-cap-backend/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.4.2
version: 1.5.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
7 changes: 4 additions & 3 deletions charts/geoweb-cap-backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@ cap:
Execute the following for testing the chart:
```bash
helm install geoweb-cap-backend fmi/geoweb-cap-backend --dry-run --debug -n geoweb --values=./values.yaml
helm install geoweb-cap-backend fmi/geoweb-cap-backend --dry-run --debug --namespace geoweb --values=./values.yaml
```

# Installing the Chart

Execute the following for installing the chart:

```bash
helm install geoweb-cap-backend fmi/geoweb-cap-backend -n geoweb --values=./values.yaml
helm install geoweb-cap-backend fmi/geoweb-cap-backend --namespace geoweb --values=./values.yaml
```

# Deleting the Chart
Execute the following for deleting the chart:

```bash
## Delete the Helm Chart
helm delete -n geoweb geoweb-cap-backend
helm delete --namespace geoweb geoweb-cap-backend
## Delete the Namespace
kubectl delete namespace geoweb
```
Expand All @@ -53,6 +53,7 @@ The following table lists the configurable parameters of the CAP backend chart a
| `cap.svcPort` | Port used for service | `80` |
| `cap.containerPort` | Port used for container | `8080` |
| `cap.replicas` | Amount of replicas deployed | `1` |
| `cap.minPodsAvailable` | Minimum available pods in pod disruption budget. Value `0` omits the pdb. | `0` |
| `cap.resources` | Configure resource limits & requests | see defaults from `values.yaml` |
| `cap.livenessProbe` | Configure libenessProbe | see defaults from `values.yaml` |
| `cap.readinessProbe` | Configure readinessProbe | see defaults from `values.yaml` |
Expand Down
14 changes: 13 additions & 1 deletion charts/geoweb-cap-backend/templates/cap-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,16 @@ spec:
{{- end }}
{{- if .Values.cap.readinessProbe }}
readinessProbe: {{ toYaml .Values.cap.readinessProbe | nindent 10 }}
{{- end }}
{{- end }}
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- {{ .Values.cap.name }}
topologyKey: topology.kubernetes.io/zone
11 changes: 11 additions & 0 deletions charts/geoweb-cap-backend/templates/cap-disruption-budget.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{- if .Values.cap.minPodsAvailable }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: cap-pdb
spec:
minAvailable: {{ .Values.cap.minPodsAvailable }}
selector:
matchLabels:
app: {{ .Values.cap.name }}
{{- end }}
1 change: 1 addition & 0 deletions charts/geoweb-cap-backend/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ cap:
svcPort: 80
containerPort: 8080
replicas: 1
minPodsAvailable: 0
resources:
requests:
memory: "384Mi"
Expand Down
2 changes: 1 addition & 1 deletion charts/geoweb-frontend/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 3.13.1
version: 3.14.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
7 changes: 4 additions & 3 deletions charts/geoweb-frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,23 +77,23 @@ frontend:
Execute the following for testing the chart:
```bash
helm install geoweb-frontend fmi/geoweb-frontend --dry-run --debug -n geoweb --values=./<yourvaluesfile>.yaml
helm install geoweb-frontend fmi/geoweb-frontend --dry-run --debug --namespace geoweb --values=./<yourvaluesfile>.yaml
```

# Installing the Chart

Execute the following for installing the chart:

```bash
helm install geoweb-frontend fmi/geoweb-frontend -n geoweb --values=./<yourvaluesfile>.yaml
helm install geoweb-frontend fmi/geoweb-frontend --namespace geoweb --values=./<yourvaluesfile>.yaml
```

# Deleting the Chart
Execute the following for deleting the chart:

```bash
## Delete the Helm Chart
helm delete -n geoweb geoweb-frontend
helm delete --namespace geoweb geoweb-frontend
## Delete the Namespace
kubectl delete namespace geoweb
```
Expand All @@ -112,6 +112,7 @@ The following table lists the configurable parameters of the GeoWeb frontend cha
| `frontend.svcPort` | Port used for service | `80` |
| `frontend.containerPort` | Port used for container | `8080` |
| `frontend.replicas` | Amount of replicas deployed | `1` |
| `frontend.minPodsAvailable` | Minimum available pods in pod disruption budget. Value `0` omits the pdb. | `0` |
| `frontend.auth_secret` | Secret containing base64 encoded Basic auth secret | |
| `frontend.auth_secretName` | Name of auth secret | `geoweb-auth` |
| `frontend.auth_secretType` | Type of auth secret | `secretsmanager` |
Expand Down
14 changes: 13 additions & 1 deletion charts/geoweb-frontend/templates/geoweb-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,16 @@ spec:
{{ else }}
secret:
secretName: {{ .Values.frontend.client_id_secretName | quote }}
{{- end }}
{{- end }}
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- {{ .Values.frontend.name }}
topologyKey: topology.kubernetes.io/zone
11 changes: 11 additions & 0 deletions charts/geoweb-frontend/templates/geoweb-disruption-budget.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{- if .Values.frontend.minPodsAvailable }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: frontend-pdb
spec:
minAvailable: {{ .Values.frontend.minPodsAvailable }}
selector:
matchLabels:
app: {{ .Values.frontend.name }}
{{- end }}
1 change: 1 addition & 0 deletions charts/geoweb-frontend/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ frontend:
svcPort: 80
containerPort: 8080
replicas: 1
minPodsAvailable: 0
auth_secretName: geoweb-auth
auth_secretType: secretsmanager
client_id_secretName: geoweb-client-id
Expand Down
2 changes: 1 addition & 1 deletion charts/geoweb-opmet-backend/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 3.4.5
version: 3.5.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
7 changes: 4 additions & 3 deletions charts/geoweb-opmet-backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,23 +85,23 @@ opmet:
Execute the following for testing the chart:
```bash
helm install geoweb-opmet-backend fmi/geoweb-opmet-backend --dry-run --debug -n geoweb --values=./values.yaml
helm install geoweb-opmet-backend fmi/geoweb-opmet-backend --dry-run --debug --namespace geoweb --values=./values.yaml
```

# Installing the Chart

Execute the following for installing the chart:

```bash
helm install geoweb-opmet-backend fmi/geoweb-opmet-backend -n geoweb --values=./values.yaml
helm install geoweb-opmet-backend fmi/geoweb-opmet-backend --namespace geoweb --values=./values.yaml
```

# Deleting the Chart
Execute the following for deleting the chart:

```bash
## Delete the Helm Chart
helm delete -n geoweb geoweb-opmet-backend
helm delete --namespace geoweb geoweb-opmet-backend
## Delete the Namespace
kubectl delete namespace geoweb
```
Expand Down Expand Up @@ -159,6 +159,7 @@ The following table lists the configurable parameters of the Opmet backend chart
| `opmet.messageconverter.registry` | Registry to fetch image | `registry.gitlab.com/opengeoweb/avi-msgconverter/geoweb-knmi-avi-messageservices` |
| `opmet.messageconverter.resources` | Configure resource limits & requests | see defaults from `values.yaml` |
| `opmet.messageconverter.version` | Possibility to override application version | see default from `values.yaml` |
| `opmet.minPodsAvailable` | Minimum available pods in pod disruption budget. Value `0` omits the pdb. | `0` |
| `opmet.name` | Name of backend | `opmet` |
| `opmet.nginx.ALLOW_ANONYMOUS_ACCESS` | Allow/disallow anonymous access. Note that if an access token has been passed, it is checked even if anonymous access is allowed | `"FALSE"` |
| `opmet.nginx.AUD_CLAIM` | Claim name used to get the token audience | `"aud"` |
Expand Down
12 changes: 12 additions & 0 deletions charts/geoweb-opmet-backend/templates/opmet-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -227,3 +227,15 @@ spec:
{{- else }}
emptyDir:
{{- end }}
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- {{ .Values.opmet.name }}
topologyKey: topology.kubernetes.io/zone
11 changes: 11 additions & 0 deletions charts/geoweb-opmet-backend/templates/opmet-disruption-budget.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{- if .Values.opmet.minPodsAvailable }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: opmet-pdb
spec:
minAvailable: {{ .Values.opmet.minPodsAvailable }}
selector:
matchLabels:
app: {{ .Values.opmet.name }}
{{- end }}
1 change: 1 addition & 0 deletions charts/geoweb-opmet-backend/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ opmet:
path: /opmet/(.*)
svcPort: 80
replicas: 1
minPodsAvailable: 0
db_secret: cG9zdGdyZXNxbDovL2dlb3dlYjpwb3N0Z3Jlc0Bsb2NhbGhvc3Q6NTQzMi9vcG1ldA==
db_secretName: opmet-db
db_secretType: secretsmanager
Expand Down
2 changes: 1 addition & 1 deletion charts/geoweb-presets-backend/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 2.11.4
version: 2.12.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
7 changes: 4 additions & 3 deletions charts/geoweb-presets-backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,23 +84,23 @@ presets:
Execute the following for testing the chart:
```bash
helm install geoweb-presets-backend fmi/geoweb-presets-backend --dry-run --debug -n geoweb --values=./values.yaml
helm install geoweb-presets-backend fmi/geoweb-presets-backend --dry-run --debug --namespace geoweb --values=./values.yaml
```

# Installing the Chart

Execute the following for installing the chart:

```bash
helm install geoweb-presets-backend fmi/geoweb-presets-backend -n geoweb --values=./values.yaml
helm install geoweb-presets-backend fmi/geoweb-presets-backend --namespace geoweb --values=./values.yaml
```

# Deleting the Chart
Execute the following for deleting the chart:

```bash
## Delete the Helm Chart
helm delete -n geoweb geoweb-presets-backend
helm delete --namespace geoweb geoweb-presets-backend
## Delete the Namespace
kubectl delete namespace geoweb
```
Expand All @@ -120,6 +120,7 @@ The following table lists the configurable parameters of the Presets backend cha
| `presets.svcPort` | Port used for service | `80` |
| `presets.PRESETS_PORT_HTTP` | Port used for presets-backend container | `8080` |
| `presets.replicas` | Amount of replicas deployed | `1` |
| `presets.minPodsAvailable` | Minimum available pods in pod disruption budget. Value `0` omits the pdb. | `0` |
| `presets.DEPLOY_ENVIRONMENT` | Environment which presets should be seeded to the database | `open` |
| `presets.postStartCommand` | Command to run after presets-backend is started | `bin/admin.sh` |
| `presets.db_secret` | Secret containing base64 encoded Postgresql database connection string | |
Expand Down
14 changes: 13 additions & 1 deletion charts/geoweb-presets-backend/templates/presets-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -180,4 +180,16 @@ spec:
secret:
secretName: {{ .Values.presets.db_secretName | quote }}
{{- end }}
{{- end }}
{{- end }}
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- {{ .Values.presets.name }}
topologyKey: topology.kubernetes.io/zone
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{- if .Values.presets.minPodsAvailable }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: presets-pdb
spec:
minAvailable: {{ .Values.presets.minPodsAvailable }}
selector:
matchLabels:
app: {{ .Values.presets.name }}
{{- end }}
1 change: 1 addition & 0 deletions charts/geoweb-presets-backend/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ presets:
path: /presets/(.*)
svcPort: 80
replicas: 1
minPodsAvailable: 0
PRESETS_PORT_HTTP: 8080
DEPLOY_ENVIRONMENT: open
postStartCommand: bin/admin.sh
Expand Down
2 changes: 1 addition & 1 deletion charts/geoweb-taf-backend/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.5.7
version: 0.6.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
7 changes: 4 additions & 3 deletions charts/geoweb-taf-backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,23 +67,23 @@ taf:
Execute the following for testing the chart:
```bash
helm install geoweb-taf-backend fmi/geoweb-taf-backend --dry-run --debug -n geoweb --values=./<yourvaluesfile>.yaml
helm install geoweb-taf-backend fmi/geoweb-taf-backend --dry-run --debug --namespace geoweb --values=./<yourvaluesfile>.yaml
```

# Installing the Chart

Execute the following for installing the chart:

```bash
helm install geoweb-taf-backend fmi/geoweb-taf-backend -n geoweb --values=./<yourvaluesfile>.yaml
helm install geoweb-taf-backend fmi/geoweb-taf-backend --namespace geoweb --values=./<yourvaluesfile>.yaml
```

# Deleting the Chart
Execute the following for deleting the chart:

```bash
## Delete the Helm Chart
helm delete -n geoweb geoweb-taf-backend
helm delete --namespace geoweb geoweb-taf-backend
## Delete the Namespace
kubectl delete namespace geoweb
```
Expand All @@ -102,6 +102,7 @@ The following table lists the configurable parameters of the Taf backend chart a
| `taf.path` | Path suffix added to url | `/taf/(.*)` |
| `taf.svcPort` | Port used for service | `80` |
| `taf.replicas` | Amount of replicas deployed | `1` |
| `taf.minPodsAvailable` | Minimum available pods in pod disruption budget. Value `0` omits the pdb. | `0` |
| `taf.db_secret` | Secret containing base64 encoded Postgresql database connection string | |
| `taf.db_secretName` | Name of db secret | `taf-db` |
| `taf.db_secretType` | Type to db secret | `secretsmanager` |
Expand Down
14 changes: 13 additions & 1 deletion charts/geoweb-taf-backend/templates/taf-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -252,4 +252,16 @@ spec:
{{- toYaml .Values.taf.publisher.volumeOptions | nindent 8 }}
{{- else }}
emptyDir:
{{- end }}
{{- end }}
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- {{ .Values.taf.name }}
topologyKey: topology.kubernetes.io/zone
Loading

0 comments on commit c5530e0

Please sign in to comment.