Skip to content

Commit

Permalink
refactor: Replace target with development in values.yaml
Browse files Browse the repository at this point in the history
Resolves #770
This commit adds support for local production deployments,
see #800.
  • Loading branch information
MoritzWeber0 committed Sep 25, 2023
1 parent 10271b3 commit 0f10c45
Show file tree
Hide file tree
Showing 16 changed files with 20 additions and 25 deletions.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ helm-deploy:
--set docker.registry.internal=k3d-$(CLUSTER_REGISTRY_NAME):$(REGISTRY_PORT) \
--set docker.images.guacamole.guacamole=k3d-$(CLUSTER_REGISTRY_NAME):$(REGISTRY_PORT)/capella/collab/guacamole \
--set mocks.oauth=True \
--set target=local \
--set general.port=8080 \
--set development=$(DEVELOPMENT_MODE) \
--set cluster.ingressClassName=traefik \
Expand Down
4 changes: 2 additions & 2 deletions helm/templates/backend/backend.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ spec:
path: /healthcheck
port: http
resources:
{{ if eq .Values.target "local" }}
{{ if .Values.development }}
limits:
cpu: "0.25"
memory: 150Mi
Expand Down Expand Up @@ -105,7 +105,7 @@ spec:
containerPort: 3101
protocol: TCP
resources:
{{ if eq .Values.target "local" }}
{{ if .Values.development }}
limits:
cpu: "0.1"
memory: 50Mi
Expand Down
6 changes: 3 additions & 3 deletions helm/templates/backend/postgres.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
labels:
id: {{ .Release.Name }}-deployment-backend-postgres
spec:
{{ if ne .Values.target "local" }}
{{ if not .Values.development }}
volumes:
- name: {{ .Release.Name }}-data
persistentVolumeClaim:
Expand Down Expand Up @@ -54,7 +54,7 @@ spec:
initialDelaySeconds: 45
timeoutSeconds: 2
resources:
{{ if eq .Values.target "local" }}
{{ if .Values.development }}
limits:
cpu: "0.25"
memory: 150Mi
Expand All @@ -69,7 +69,7 @@ spec:
memory: "1Gi"
cpu: "1"
{{ end }}
{{ if ne .Values.target "local" }}
{{ if not .Values.development }}
volumeMounts:
- name: {{ .Release.Name }}-data
mountPath: /var/lib/postgresql/data
Expand Down
2 changes: 1 addition & 1 deletion helm/templates/backend/postgres.volume.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: Apache-2.0

{{ if .Values.database.backend.deploy }}
{{ if ne .Values.target "local" }}
{{ if not .Values.development }}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
Expand Down
2 changes: 1 addition & 1 deletion helm/templates/docs/docs.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
path: /
port: http
resources:
{{ if eq .Values.target "local" }}
{{ if .Values.development }}
limits:
cpu: "0.2"
memory: 20Mi
Expand Down
4 changes: 2 additions & 2 deletions helm/templates/frontend/frontend.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ spec:
path: /
port: http
resources:
{{ if eq .Values.target "local" }}
{{ if .Values.development }}
limits:
cpu: "0.25"
memory: 150Mi
Expand Down Expand Up @@ -82,7 +82,7 @@ spec:
containerPort: 3101
protocol: TCP
resources:
{{ if eq .Values.target "local" }}
{{ if .Values.development }}
limits:
cpu: "0.1"
memory: 50Mi
Expand Down
2 changes: 1 addition & 1 deletion helm/templates/grafana/grafana.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ spec:
ports:
- containerPort: 3000
resources:
{{ if eq .Values.target "local" }}
{{ if .Values.development }}
limits:
cpu: "0.5"
memory: 500Mi
Expand Down
2 changes: 1 addition & 1 deletion helm/templates/grafana/nginx.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ spec:
containerPort: 3118
protocol: TCP
resources:
{{ if eq .Values.target "local" }}
{{ if .Values.development }}
limits:
cpu: "0.1"
memory: 50Mi
Expand Down
4 changes: 2 additions & 2 deletions helm/templates/guacamole/guacamole.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ spec:
mountPath: /home/guacamole/tomcat/logs
{{ end }}
resources:
{{ if eq .Values.target "local" }}
{{ if .Values.development }}
requests:
cpu: "0.1"
memory: 20Mi
Expand Down Expand Up @@ -117,7 +117,7 @@ spec:
containerPort: 3101
protocol: TCP
resources:
{{ if eq .Values.target "local" }}
{{ if .Values.development }}
limits:
cpu: "0.1"
memory: 50Mi
Expand Down
4 changes: 2 additions & 2 deletions helm/templates/guacamole/guacd.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ spec:
initialDelaySeconds: 15
periodSeconds: 20
resources:
{{ if eq .Values.target "local" }}
{{ if .Values.development }}
limits:
cpu: "0.2"
memory: 100Mi
Expand Down Expand Up @@ -89,7 +89,7 @@ spec:
containerPort: 3101
protocol: TCP
resources:
{{ if eq .Values.target "local" }}
{{ if .Values.development }}
limits:
cpu: "0.1"
memory: 50Mi
Expand Down
2 changes: 1 addition & 1 deletion helm/templates/guacamole/postgres.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ spec:
initialDelaySeconds: 45
timeoutSeconds: 2
resources:
{{ if eq .Values.target "local" }}
{{ if .Values.development }}
limits:
cpu: "0.15"
memory: 100Mi
Expand Down
2 changes: 1 addition & 1 deletion helm/templates/prometheus/nginx.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ spec:
containerPort: 9118
protocol: TCP
resources:
{{ if eq .Values.target "local" }}
{{ if .Values.development }}
limits:
cpu: "0.1"
memory: 50Mi
Expand Down
2 changes: 1 addition & 1 deletion helm/templates/prometheus/prometheus.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ spec:
ports:
- containerPort: 9118
resources:
{{ if eq .Values.target "local" }}
{{ if .Values.development }}
limits:
cpu: "0.1"
memory: 50Mi
Expand Down
2 changes: 1 addition & 1 deletion helm/templates/promtail/promtail.nodeport.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# Expose Grafana Loki API on development systems for direct access

{{ if eq .Values.target "local" }}
{{ if .Values.development }}
apiVersion: v1
kind: Service
metadata:
Expand Down
2 changes: 1 addition & 1 deletion helm/templates/routing/nginx.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ spec:
containerPort: 8080
protocol: TCP
resources:
{{ if eq .Values.target "local" }}
{{ if .Values.development }}
limits:
cpu: "0.1"
memory: 50Mi
Expand Down
4 changes: 0 additions & 4 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,6 @@ guacamole:
### KUBERNETES RELATED CONFIGURATION ###
########################################

# target: local | azure | other
# Never use 'local' in production!
target: other

# Activate the development mode.
# NEVER use this in production, it will make your application unsafe.
# The development mode changes the following options:
Expand Down

0 comments on commit 0f10c45

Please sign in to comment.