diff --git a/Dockerfile b/Dockerfile
index c77f1523d022dc34d26dfbd41a6b790ca7241027..94609a5cf05e6e20ce137fcc2d69fce51690110b 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,19 +1,24 @@
-# getting jdk 17 (we use this version in development too)
-FROM eclipse-temurin:17.0.7_7-jdk-focal AS build-backend
+# Stage 1: Build Frontend
+FROM node:20-bullseye-slim AS build-frontend
+WORKDIR /frontend
+COPY frontend/package*.json ./
+RUN npm ci --only=production
+COPY frontend/ .
+RUN npm run build
-# working directory for backend
+# Stage 2: Backend + static frontend files
+FROM eclipse-temurin:17-jdk AS build-backend
WORKDIR /app
-
-# copying backend to root folder in container
-COPY . .
-
-# making maven executable (we had execution issues before adding this)
+COPY --from=build-frontend /frontend/dist src/main/resources/static
+COPY pom.xml mvnw mvnw.cmd ./
+COPY .mvn .mvn
+COPY src src
RUN chmod +x ./mvnw
-
-# building backend with maven wrapper
RUN ./mvnw clean package -DskipTests
-# exposing port, same port as we used in development
+# Stage 3: Image
+FROM eclipse-temurin:17-jre
+WORKDIR /app
+COPY --from=build-backend /app/target/todo-0.0.1-SNAPSHOT.jar app.jar
EXPOSE 9876
-
-ENTRYPOINT ["java", "-jar", "target/todo-0.0.1-SNAPSHOT.jar"]
+ENTRYPOINT ["java", "-jar", "app.jar"]
diff --git a/frontend/Dockerfile b/frontend/Dockerfile
index 5f0b7e51048f4323aed09f2a1e2717fb675d3964..d56290900636351b350a00e9fa6b8ae881bceccd 100644
--- a/frontend/Dockerfile
+++ b/frontend/Dockerfile
@@ -14,7 +14,7 @@ COPY . .
# building frontend
RUN npm run build
-# stage 2: move static frontend stuff to caddys root folder to make caddy serve our frontend instead of spring
+
FROM node:20-alpine
WORKDIR /app
@@ -26,4 +26,4 @@ COPY --from=build-frontend /app/dist /app
EXPOSE 80
# einfacher http-server
-CMD ["http-server", "/app", "-p", "80"]
\ No newline at end of file
+CMD ["http-server", "/app", "-p", "80"]
diff --git a/frontend/src/components/LoginPage.vue b/frontend/src/components/LoginPage.vue
index 88941295b66bf7b7de640c7d7eb925a41b4735f9..6ae93c6ae143cc71b995b2414bf668d6f45a57e6 100644
--- a/frontend/src/components/LoginPage.vue
+++ b/frontend/src/components/LoginPage.vue
@@ -40,7 +40,7 @@ export default {
},
methods: {
async signUp() {
- let url = "/user/signup"
+ let url = "http://127.0.0.1:9876/user/signup"
const response = await fetch(url, {
method: "POST",
@@ -62,7 +62,7 @@ export default {
}
},
async signIn(){
- let url = "/user/signin"
+ let url = "http://127.0.0.1:9876/user/signin"
const response = await fetch(url, {
method: "POST",
diff --git a/frontend/src/components/MainPage.vue b/frontend/src/components/MainPage.vue
index 4200c0983d2e197acee4ba1892aa1b2db038a5ae..8f27a37395db17f89efc38868824b51af422ea35 100644
--- a/frontend/src/components/MainPage.vue
+++ b/frontend/src/components/MainPage.vue
@@ -52,7 +52,7 @@ export default {
// sends fetch-request to check for session validity
async validateSession(){
if(this.$route.name === 'main') {
- let url = "/user/validateSession"
+ let url = "http://127.0.0.1:9876/user/validateSession"
const response = await fetch(url, {
method: 'GET',
@@ -74,7 +74,7 @@ export default {
},
// fetches all todos for the current user
async getAllTodos(){
- let url = `/user/getAllTodos?userId=${localStorage.getItem('userId')}`
+ let url = `http://127.0.0.1:9876/user/getAllTodos?userId=${localStorage.getItem('userId')}`
const response = await fetch(url, {
method: 'GET',
@@ -90,7 +90,7 @@ export default {
},
// creates a todoJsonObject and sends it to backend for persistence
async addTodo(){
- let url = "/user/addTodo"
+ let url = "http://127.0.0.1:9876/user/addTodo"
const response = await fetch(url, {
method: 'POST',
@@ -115,7 +115,7 @@ export default {
},
// deletes given todo
async deleteTodo(todoId){
- let url = `/user/deleteTodo?userId=${localStorage.getItem('userId')}&todoId=${todoId}`
+ let url = `http://127.0.0.1:9876/user/deleteTodo?userId=${localStorage.getItem('userId')}&todoId=${todoId}`
const response = await fetch(url, {
method: 'DELETE',
@@ -132,7 +132,7 @@ export default {
},
// sets the given todo as complete
async setTodoComplete(todoId){
- let url = `/user/setTodoComplete?userId=${localStorage.getItem('userId')}&todoId=${todoId}`
+ let url = `http://127.0.0.1:9876/user/setTodoComplete?userId=${localStorage.getItem('userId')}&todoId=${todoId}`
const response = await fetch(url, {
method: 'PATCH',
@@ -148,7 +148,7 @@ export default {
},
// logs out the current user and resets attributes in storage
async signout(){
- let url = "/user/signout"
+ let url = "http://127.0.0.1:9876/user/signout"
const response = await fetch(url, {
method: 'POST',
diff --git a/helm/backend/Chart.yaml b/helm/backend/Chart.yaml
index c700e89dc2d9a6fc50ff19042435574038659405..8becc96161bb5d09c227634519173aba6664ce82 100644
--- a/helm/backend/Chart.yaml
+++ b/helm/backend/Chart.yaml
@@ -1,24 +1,6 @@
apiVersion: v2
name: backend
-description: A Helm chart for Kubernetes
-
-# A chart can be either an 'application' or a 'library' chart.
-#
-# Application charts are a collection of templates that can be packaged into versioned archives
-# to be deployed.
-#
-# Library charts provide useful utilities or functions for the chart developer. They're included as
-# a dependency of application charts to inject those utilities and functions into the rendering
-# pipeline. Library charts do not define any templates and therefore cannot be deployed.
+description: A Helm chart for deploying the backend application
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.1.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
-# follow Semantic Versioning. They should reflect the version the application is using.
-# It is recommended to use it with quotes.
-appVersion: "1.16.0"
+version: 1.0.0
+appVersion: 1.0.0
diff --git a/helm/backend/templates/deployment.yaml b/helm/backend/templates/deployment.yaml
index 609f291c341c39c2a8cb0505f58f83aff4e2c7dc..5be804ad269fa3207b8e5a565f1fc9308b3794d6 100644
--- a/helm/backend/templates/deployment.yaml
+++ b/helm/backend/templates/deployment.yaml
@@ -1,68 +1,32 @@
apiVersion: apps/v1
kind: Deployment
metadata:
- name: {{ include "backend.fullname" . }}
- labels:
- {{- include "backend.labels" . | nindent 4 }}
+ name: {{ .Release.Name }}-deployment
+ namespace: {{ .Values.namespace }}
spec:
- {{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
- {{- end }}
selector:
matchLabels:
- {{- include "backend.selectorLabels" . | nindent 6 }}
+ app: {{ .Release.Name }}-backend
template:
metadata:
- {{- with .Values.podAnnotations }}
- annotations:
- {{- toYaml . | nindent 8 }}
- {{- end }}
labels:
- {{- include "backend.labels" . | nindent 8 }}
- {{- with .Values.podLabels }}
- {{- toYaml . | nindent 8 }}
- {{- end }}
+ app: {{ .Release.Name }}-backend
spec:
- {{- with .Values.imagePullSecrets }}
- imagePullSecrets:
- {{- toYaml . | nindent 8 }}
- {{- end }}
- serviceAccountName: {{ include "backend.serviceAccountName" . }}
- securityContext:
- {{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- - name: {{ .Chart.Name }}
- securityContext:
- {{- toYaml .Values.securityContext | nindent 12 }}
- image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
+ - name: {{ .Release.Name }}-container
+ image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- - name: http
- containerPort: {{ .Values.service.port }}
- protocol: TCP
- livenessProbe:
- {{- toYaml .Values.livenessProbe | nindent 12 }}
- readinessProbe:
- {{- toYaml .Values.readinessProbe | nindent 12 }}
- resources:
- {{- toYaml .Values.resources | nindent 12 }}
- {{- with .Values.volumeMounts }}
- volumeMounts:
- {{- toYaml . | nindent 12 }}
- {{- end }}
- {{- with .Values.volumes }}
- volumes:
- {{- toYaml . | nindent 8 }}
- {{- end }}
- {{- with .Values.nodeSelector }}
- nodeSelector:
- {{- toYaml . | nindent 8 }}
- {{- end }}
- {{- with .Values.affinity }}
- affinity:
- {{- toYaml . | nindent 8 }}
- {{- end }}
- {{- with .Values.tolerations }}
- tolerations:
- {{- toYaml . | nindent 8 }}
- {{- end }}
+ - containerPort: {{ .Values.service.port }}
+ env:
+ - name: MONGO_USER
+ value: "{{ .Values.mongodb.user }}"
+ - name: MONGO_PASSWORD
+ value: "{{ .Values.mongodb.password }}"
+ - name: MONGO_HOST
+ value: "{{ .Values.mongodb.host }}"
+ - name: MONGO_PORT
+ value: "{{ .Values.mongodb.port }}"
+ - name: MONGO_DB
+ value: "{{ .Values.mongodb.db }}"
diff --git a/helm/backend/templates/hpa.yaml b/helm/backend/templates/hpa.yaml
index c32d92b42dd924a624a8719497ee15952e0dd917..5acc430edb9ba270aba9dd3ad841aea397b9763a 100644
--- a/helm/backend/templates/hpa.yaml
+++ b/helm/backend/templates/hpa.yaml
@@ -1,32 +1,21 @@
-{{- if .Values.autoscaling.enabled }}
+{{- if .Values.autoscaling.enabled | default false }}
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
- name: {{ include "backend.fullname" . }}
- labels:
- {{- include "backend.labels" . | nindent 4 }}
+ name: {{ .Release.Name }}-hpa
+ namespace: {{ .Release.Namespace }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
- name: {{ include "backend.fullname" . }}
+ name: {{ .Release.Name }}-deployment
minReplicas: {{ .Values.autoscaling.minReplicas }}
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
metrics:
- {{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
- {{- end }}
- {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
- - type: Resource
- resource:
- name: memory
- target:
- type: Utilization
- averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
- {{- end }}
{{- end }}
diff --git a/helm/backend/templates/ingress.yaml b/helm/backend/templates/ingress.yaml
index 8b21da7f8ed82ad2bb6447af92a2576aaf4980bc..2730ebdb5c2aeb25bb8f53e3d750bcf7ebf0814d 100644
--- a/helm/backend/templates/ingress.yaml
+++ b/helm/backend/templates/ingress.yaml
@@ -1,43 +1,30 @@
-{{- if .Values.ingress.enabled -}}
+{{- if .Values.ingress.enabled | default false }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
- name: {{ include "backend.fullname" . }}
- labels:
- {{- include "backend.labels" . | nindent 4 }}
- {{- with .Values.ingress.annotations }}
+ name: {{ .Release.Name }}-ingress
annotations:
+ {{- with .Values.ingress.annotations }}
{{- toYaml . | nindent 4 }}
- {{- end }}
-spec:
- {{- with .Values.ingress.className }}
- ingressClassName: {{ . }}
- {{- end }}
- {{- if .Values.ingress.tls }}
- tls:
- {{- range .Values.ingress.tls }}
- - hosts:
- {{- range .hosts }}
- - {{ . | quote }}
- {{- end }}
- secretName: {{ .secretName }}
{{- end }}
- {{- end }}
+spec:
rules:
{{- range .Values.ingress.hosts }}
- - host: {{ .host | quote }}
+ - host: {{ .host }}
http:
paths:
{{- range .paths }}
- path: {{ .path }}
- {{- with .pathType }}
- pathType: {{ . }}
- {{- end }}
+ pathType: {{ .pathType }}
backend:
service:
- name: {{ include "backend.fullname" $ }}
+ name: {{ $.Release.Name }}-service
port:
- number: {{ $.Values.service.port }}
+ number: 80
{{- end }}
{{- end }}
+ {{- with .Values.ingress.tls }}
+ tls:
+ {{- toYaml . | nindent 4 }}
+ {{- end }}
{{- end }}
diff --git a/helm/backend/templates/service.yaml b/helm/backend/templates/service.yaml
index 4fb41865c31cac50a3ce602f0ef97356bbdecca0..00efc26f7f2a9f84becac71479b549e2f5945f3a 100644
--- a/helm/backend/templates/service.yaml
+++ b/helm/backend/templates/service.yaml
@@ -1,15 +1,13 @@
apiVersion: v1
kind: Service
metadata:
- name: {{ include "backend.fullname" . }}
- labels:
- {{- include "backend.labels" . | nindent 4 }}
+ name: {{ .Release.Name }}-service
+ namespace: {{ .Values.namespace }}
spec:
- type: {{ .Values.service.type }}
- ports:
- - port: {{ .Values.service.port }}
- targetPort: http
- protocol: TCP
- name: http
selector:
- {{- include "backend.selectorLabels" . | nindent 4 }}
+ app: {{ .Release.Name }}-backend
+ ports:
+ - protocol: TCP
+ port: {{ .Values.service.port }}
+ targetPort: {{ .Values.service.targetPort }}
+ type: {{ .Values.service.type }}
diff --git a/helm/backend/values.yaml b/helm/backend/values.yaml
index 95db814837745eb29b71859c61c8f88e1f6fc668..fdb1580a9036f9af1a2c70f84b95f9c982eaa631 100644
--- a/helm/backend/values.yaml
+++ b/helm/backend/values.yaml
@@ -1,123 +1,40 @@
-# Default values for backend.
-# This is a YAML-formatted file.
-# Declare variables to be passed into your templates.
-
-# This will set the replicaset count more information can be found here: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/
replicaCount: 1
-# This sets the container image more information can be found here: https://kubernetes.io/docs/concepts/containers/images/
image:
- repository: nginx
- # This sets the pull policy for images.
+ repository: backend
+ tag: latest
pullPolicy: IfNotPresent
- # Overrides the image tag whose default is the chart appVersion.
- tag: ""
-
-# This is for the secretes for pulling an image from a private repository more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
-imagePullSecrets: []
-# This is to override the chart name.
-nameOverride: ""
-fullnameOverride: ""
-
-# This section builds out the service account more information can be found here: https://kubernetes.io/docs/concepts/security/service-accounts/
-serviceAccount:
- # Specifies whether a service account should be created
- create: true
- # Automatically mount a ServiceAccount's API credentials?
- automount: true
- # Annotations to add to the service account
- annotations: {}
- # The name of the service account to use.
- # If not set and create is true, a name is generated using the fullname template
- name: ""
-# This is for setting Kubernetes Annotations to a Pod.
-# For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
-podAnnotations: {}
-# This is for setting Kubernetes Labels to a Pod.
-# For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
-podLabels: {}
+service:
+ type: ClusterIP
+ port: 9876
+ targetPort: 9876
-podSecurityContext: {}
- # fsGroup: 2000
+mongodb:
+ user: tododbuser
+ password: tododbadminpassword
+ host: mongodb-service.todo.svc.cluster.local
+ port: 27017
+ db: todo
-securityContext: {}
- # capabilities:
- # drop:
- # - ALL
- # readOnlyRootFilesystem: true
- # runAsNonRoot: true
- # runAsUser: 1000
+namespace: todo
-# This is for setting up a service more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/
-service:
- # This sets the service type more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types
- type: ClusterIP
- # This sets the ports more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/#field-spec-ports
- port: 80
+serviceAccount:
+ create: true
+ name: backend-serviceaccount
-# This block is for setting up the ingress for more information can be found here: https://kubernetes.io/docs/concepts/services-networking/ingress/
ingress:
- enabled: false
- className: ""
+ enabled: false # Setze 'true', wenn du Ingress nutzen möchtest
annotations: {}
- # kubernetes.io/ingress.class: nginx
- # kubernetes.io/tls-acme: "true"
hosts:
- - host: chart-example.local
+ - host: backend.local
paths:
- path: /
- pathType: ImplementationSpecific
+ pathType: Prefix
tls: []
- # - secretName: chart-example-tls
- # hosts:
- # - chart-example.local
-
-resources: {}
- # We usually recommend not to specify default resources and to leave this as a conscious
- # choice for the user. This also increases chances charts run on environments with little
- # resources, such as Minikube. If you do want to specify resources, uncomment the following
- # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
- # limits:
- # cpu: 100m
- # memory: 128Mi
- # requests:
- # cpu: 100m
- # memory: 128Mi
-# This is to setup the liveness and readiness probes more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
-livenessProbe:
- httpGet:
- path: /
- port: http
-readinessProbe:
- httpGet:
- path: /
- port: http
-
-# This section is for setting up autoscaling more information can be found here: https://kubernetes.io/docs/concepts/workloads/autoscaling/
autoscaling:
- enabled: false
+ enabled: false # Setze 'true', wenn du HPA nutzen möchtest
minReplicas: 1
- maxReplicas: 100
+ maxReplicas: 1
targetCPUUtilizationPercentage: 80
- # targetMemoryUtilizationPercentage: 80
-
-# Additional volumes on the output Deployment definition.
-volumes: []
-# - name: foo
-# secret:
-# secretName: mysecret
-# optional: false
-
-# Additional volumeMounts on the output Deployment definition.
-volumeMounts: []
-# - name: foo
-# mountPath: "/etc/foo"
-# readOnly: true
-
-nodeSelector: {}
-
-tolerations: []
-
-affinity: {}
diff --git a/helm/caddy/.helmignore b/helm/caddy/.helmignore
deleted file mode 100644
index 0e8a0eb36f4ca2c939201c0d54b5d82a1ea34778..0000000000000000000000000000000000000000
--- a/helm/caddy/.helmignore
+++ /dev/null
@@ -1,23 +0,0 @@
-# Patterns to ignore when building packages.
-# This supports shell glob matching, relative path matching, and
-# negation (prefixed with !). Only one pattern per line.
-.DS_Store
-# Common VCS dirs
-.git/
-.gitignore
-.bzr/
-.bzrignore
-.hg/
-.hgignore
-.svn/
-# Common backup files
-*.swp
-*.bak
-*.tmp
-*.orig
-*~
-# Various IDEs
-.project
-.idea/
-*.tmproj
-.vscode/
diff --git a/helm/caddy/Chart.yaml b/helm/caddy/Chart.yaml
deleted file mode 100644
index 164c204c8495ccb2f68134817480a77685b8a8fd..0000000000000000000000000000000000000000
--- a/helm/caddy/Chart.yaml
+++ /dev/null
@@ -1,24 +0,0 @@
-apiVersion: v2
-name: caddy
-description: A Helm chart for Kubernetes
-
-# A chart can be either an 'application' or a 'library' chart.
-#
-# Application charts are a collection of templates that can be packaged into versioned archives
-# to be deployed.
-#
-# Library charts provide useful utilities or functions for the chart developer. They're included as
-# a dependency of application charts to inject those utilities and functions into the rendering
-# pipeline. Library charts do not define any templates and therefore cannot be deployed.
-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.1.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
-# follow Semantic Versioning. They should reflect the version the application is using.
-# It is recommended to use it with quotes.
-appVersion: "1.16.0"
diff --git a/helm/caddy/templates/NOTES.txt b/helm/caddy/templates/NOTES.txt
deleted file mode 100644
index d4ec236ee1d24a604eef45a3790ce9750c6f1c7e..0000000000000000000000000000000000000000
--- a/helm/caddy/templates/NOTES.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-1. Get the application URL by running these commands:
-{{- if .Values.ingress.enabled }}
-{{- range $host := .Values.ingress.hosts }}
- {{- range .paths }}
- http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
- {{- end }}
-{{- end }}
-{{- else if contains "NodePort" .Values.service.type }}
- export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "caddy.fullname" . }})
- export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
- echo http://$NODE_IP:$NODE_PORT
-{{- else if contains "LoadBalancer" .Values.service.type }}
- NOTE: It may take a few minutes for the LoadBalancer IP to be available.
- You can watch its status by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "caddy.fullname" . }}'
- export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "caddy.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
- echo http://$SERVICE_IP:{{ .Values.service.port }}
-{{- else if contains "ClusterIP" .Values.service.type }}
- export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "caddy.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
- export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
- echo "Visit http://127.0.0.1:8080 to use your application"
- kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
-{{- end }}
diff --git a/helm/caddy/templates/_helpers.tpl b/helm/caddy/templates/_helpers.tpl
deleted file mode 100644
index 4d3b78af179ea4dcc1fc1926da1174e3a7a82a4e..0000000000000000000000000000000000000000
--- a/helm/caddy/templates/_helpers.tpl
+++ /dev/null
@@ -1,62 +0,0 @@
-{{/*
-Expand the name of the chart.
-*/}}
-{{- define "caddy.name" -}}
-{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
-{{- end }}
-
-{{/*
-Create a default fully qualified app name.
-We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
-If release name contains chart name it will be used as a full name.
-*/}}
-{{- define "caddy.fullname" -}}
-{{- if .Values.fullnameOverride }}
-{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
-{{- else }}
-{{- $name := default .Chart.Name .Values.nameOverride }}
-{{- if contains $name .Release.Name }}
-{{- .Release.Name | trunc 63 | trimSuffix "-" }}
-{{- else }}
-{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
-{{- end }}
-{{- end }}
-{{- end }}
-
-{{/*
-Create chart name and version as used by the chart label.
-*/}}
-{{- define "caddy.chart" -}}
-{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
-{{- end }}
-
-{{/*
-Common labels
-*/}}
-{{- define "caddy.labels" -}}
-helm.sh/chart: {{ include "caddy.chart" . }}
-{{ include "caddy.selectorLabels" . }}
-{{- if .Chart.AppVersion }}
-app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
-{{- end }}
-app.kubernetes.io/managed-by: {{ .Release.Service }}
-{{- end }}
-
-{{/*
-Selector labels
-*/}}
-{{- define "caddy.selectorLabels" -}}
-app.kubernetes.io/name: {{ include "caddy.name" . }}
-app.kubernetes.io/instance: {{ .Release.Name }}
-{{- end }}
-
-{{/*
-Create the name of the service account to use
-*/}}
-{{- define "caddy.serviceAccountName" -}}
-{{- if .Values.serviceAccount.create }}
-{{- default (include "caddy.fullname" .) .Values.serviceAccount.name }}
-{{- else }}
-{{- default "default" .Values.serviceAccount.name }}
-{{- end }}
-{{- end }}
diff --git a/helm/caddy/templates/deployment.yaml b/helm/caddy/templates/deployment.yaml
deleted file mode 100644
index 00c5998b5c49499a40ddd21e08ab8b127e163ac2..0000000000000000000000000000000000000000
--- a/helm/caddy/templates/deployment.yaml
+++ /dev/null
@@ -1,68 +0,0 @@
-apiVersion: apps/v1
-kind: Deployment
-metadata:
- name: {{ include "caddy.fullname" . }}
- labels:
- {{- include "caddy.labels" . | nindent 4 }}
-spec:
- {{- if not .Values.autoscaling.enabled }}
- replicas: {{ .Values.replicaCount }}
- {{- end }}
- selector:
- matchLabels:
- {{- include "caddy.selectorLabels" . | nindent 6 }}
- template:
- metadata:
- {{- with .Values.podAnnotations }}
- annotations:
- {{- toYaml . | nindent 8 }}
- {{- end }}
- labels:
- {{- include "caddy.labels" . | nindent 8 }}
- {{- with .Values.podLabels }}
- {{- toYaml . | nindent 8 }}
- {{- end }}
- spec:
- {{- with .Values.imagePullSecrets }}
- imagePullSecrets:
- {{- toYaml . | nindent 8 }}
- {{- end }}
- serviceAccountName: {{ include "caddy.serviceAccountName" . }}
- securityContext:
- {{- toYaml .Values.podSecurityContext | nindent 8 }}
- containers:
- - name: {{ .Chart.Name }}
- securityContext:
- {{- toYaml .Values.securityContext | nindent 12 }}
- image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
- imagePullPolicy: {{ .Values.image.pullPolicy }}
- ports:
- - name: http
- containerPort: {{ .Values.service.port }}
- protocol: TCP
- livenessProbe:
- {{- toYaml .Values.livenessProbe | nindent 12 }}
- readinessProbe:
- {{- toYaml .Values.readinessProbe | nindent 12 }}
- resources:
- {{- toYaml .Values.resources | nindent 12 }}
- {{- with .Values.volumeMounts }}
- volumeMounts:
- {{- toYaml . | nindent 12 }}
- {{- end }}
- {{- with .Values.volumes }}
- volumes:
- {{- toYaml . | nindent 8 }}
- {{- end }}
- {{- with .Values.nodeSelector }}
- nodeSelector:
- {{- toYaml . | nindent 8 }}
- {{- end }}
- {{- with .Values.affinity }}
- affinity:
- {{- toYaml . | nindent 8 }}
- {{- end }}
- {{- with .Values.tolerations }}
- tolerations:
- {{- toYaml . | nindent 8 }}
- {{- end }}
diff --git a/helm/caddy/templates/hpa.yaml b/helm/caddy/templates/hpa.yaml
deleted file mode 100644
index bbae00731243fcf07b71b4dac40d8846a01d8726..0000000000000000000000000000000000000000
--- a/helm/caddy/templates/hpa.yaml
+++ /dev/null
@@ -1,32 +0,0 @@
-{{- if .Values.autoscaling.enabled }}
-apiVersion: autoscaling/v2
-kind: HorizontalPodAutoscaler
-metadata:
- name: {{ include "caddy.fullname" . }}
- labels:
- {{- include "caddy.labels" . | nindent 4 }}
-spec:
- scaleTargetRef:
- apiVersion: apps/v1
- kind: Deployment
- name: {{ include "caddy.fullname" . }}
- minReplicas: {{ .Values.autoscaling.minReplicas }}
- maxReplicas: {{ .Values.autoscaling.maxReplicas }}
- metrics:
- {{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
- - type: Resource
- resource:
- name: cpu
- target:
- type: Utilization
- averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
- {{- end }}
- {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
- - type: Resource
- resource:
- name: memory
- target:
- type: Utilization
- averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
- {{- end }}
-{{- end }}
diff --git a/helm/caddy/templates/ingress.yaml b/helm/caddy/templates/ingress.yaml
deleted file mode 100644
index 21b51446d2b4efbca301ed099b75b7b4d42f8aa2..0000000000000000000000000000000000000000
--- a/helm/caddy/templates/ingress.yaml
+++ /dev/null
@@ -1,43 +0,0 @@
-{{- if .Values.ingress.enabled -}}
-apiVersion: networking.k8s.io/v1
-kind: Ingress
-metadata:
- name: {{ include "caddy.fullname" . }}
- labels:
- {{- include "caddy.labels" . | nindent 4 }}
- {{- with .Values.ingress.annotations }}
- annotations:
- {{- toYaml . | nindent 4 }}
- {{- end }}
-spec:
- {{- with .Values.ingress.className }}
- ingressClassName: {{ . }}
- {{- end }}
- {{- if .Values.ingress.tls }}
- tls:
- {{- range .Values.ingress.tls }}
- - hosts:
- {{- range .hosts }}
- - {{ . | quote }}
- {{- end }}
- secretName: {{ .secretName }}
- {{- end }}
- {{- end }}
- rules:
- {{- range .Values.ingress.hosts }}
- - host: {{ .host | quote }}
- http:
- paths:
- {{- range .paths }}
- - path: {{ .path }}
- {{- with .pathType }}
- pathType: {{ . }}
- {{- end }}
- backend:
- service:
- name: {{ include "caddy.fullname" $ }}
- port:
- number: {{ $.Values.service.port }}
- {{- end }}
- {{- end }}
-{{- end }}
diff --git a/helm/caddy/templates/service.yaml b/helm/caddy/templates/service.yaml
deleted file mode 100644
index 21811f10331e84be0adf3e36312611029163867e..0000000000000000000000000000000000000000
--- a/helm/caddy/templates/service.yaml
+++ /dev/null
@@ -1,15 +0,0 @@
-apiVersion: v1
-kind: Service
-metadata:
- name: {{ include "caddy.fullname" . }}
- labels:
- {{- include "caddy.labels" . | nindent 4 }}
-spec:
- type: {{ .Values.service.type }}
- ports:
- - port: {{ .Values.service.port }}
- targetPort: http
- protocol: TCP
- name: http
- selector:
- {{- include "caddy.selectorLabels" . | nindent 4 }}
diff --git a/helm/caddy/templates/serviceaccount.yaml b/helm/caddy/templates/serviceaccount.yaml
deleted file mode 100644
index 9a6ad7ba8c8b29d7215e7eb813f4e185bc49b50c..0000000000000000000000000000000000000000
--- a/helm/caddy/templates/serviceaccount.yaml
+++ /dev/null
@@ -1,13 +0,0 @@
-{{- if .Values.serviceAccount.create -}}
-apiVersion: v1
-kind: ServiceAccount
-metadata:
- name: {{ include "caddy.serviceAccountName" . }}
- labels:
- {{- include "caddy.labels" . | nindent 4 }}
- {{- with .Values.serviceAccount.annotations }}
- annotations:
- {{- toYaml . | nindent 4 }}
- {{- end }}
-automountServiceAccountToken: {{ .Values.serviceAccount.automount }}
-{{- end }}
diff --git a/helm/caddy/templates/tests/test-connection.yaml b/helm/caddy/templates/tests/test-connection.yaml
deleted file mode 100644
index ae2d6b2a5ec531c769e6c2d07584d5d461b032f4..0000000000000000000000000000000000000000
--- a/helm/caddy/templates/tests/test-connection.yaml
+++ /dev/null
@@ -1,15 +0,0 @@
-apiVersion: v1
-kind: Pod
-metadata:
- name: "{{ include "caddy.fullname" . }}-test-connection"
- labels:
- {{- include "caddy.labels" . | nindent 4 }}
- annotations:
- "helm.sh/hook": test
-spec:
- containers:
- - name: wget
- image: busybox
- command: ['wget']
- args: ['{{ include "caddy.fullname" . }}:{{ .Values.service.port }}']
- restartPolicy: Never
diff --git a/helm/caddy/values.yaml b/helm/caddy/values.yaml
deleted file mode 100644
index 780769775950e5af998a0ec0d5d410f25ec2e8dd..0000000000000000000000000000000000000000
--- a/helm/caddy/values.yaml
+++ /dev/null
@@ -1,123 +0,0 @@
-# Default values for caddy.
-# This is a YAML-formatted file.
-# Declare variables to be passed into your templates.
-
-# This will set the replicaset count more information can be found here: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/
-replicaCount: 1
-
-# This sets the container image more information can be found here: https://kubernetes.io/docs/concepts/containers/images/
-image:
- repository: nginx
- # This sets the pull policy for images.
- pullPolicy: IfNotPresent
- # Overrides the image tag whose default is the chart appVersion.
- tag: ""
-
-# This is for the secretes for pulling an image from a private repository more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
-imagePullSecrets: []
-# This is to override the chart name.
-nameOverride: ""
-fullnameOverride: ""
-
-# This section builds out the service account more information can be found here: https://kubernetes.io/docs/concepts/security/service-accounts/
-serviceAccount:
- # Specifies whether a service account should be created
- create: true
- # Automatically mount a ServiceAccount's API credentials?
- automount: true
- # Annotations to add to the service account
- annotations: {}
- # The name of the service account to use.
- # If not set and create is true, a name is generated using the fullname template
- name: ""
-
-# This is for setting Kubernetes Annotations to a Pod.
-# For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
-podAnnotations: {}
-# This is for setting Kubernetes Labels to a Pod.
-# For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
-podLabels: {}
-
-podSecurityContext: {}
- # fsGroup: 2000
-
-securityContext: {}
- # capabilities:
- # drop:
- # - ALL
- # readOnlyRootFilesystem: true
- # runAsNonRoot: true
- # runAsUser: 1000
-
-# This is for setting up a service more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/
-service:
- # This sets the service type more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types
- type: ClusterIP
- # This sets the ports more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/#field-spec-ports
- port: 80
-
-# This block is for setting up the ingress for more information can be found here: https://kubernetes.io/docs/concepts/services-networking/ingress/
-ingress:
- enabled: false
- className: ""
- annotations: {}
- # kubernetes.io/ingress.class: nginx
- # kubernetes.io/tls-acme: "true"
- hosts:
- - host: chart-example.local
- paths:
- - path: /
- pathType: ImplementationSpecific
- tls: []
- # - secretName: chart-example-tls
- # hosts:
- # - chart-example.local
-
-resources: {}
- # We usually recommend not to specify default resources and to leave this as a conscious
- # choice for the user. This also increases chances charts run on environments with little
- # resources, such as Minikube. If you do want to specify resources, uncomment the following
- # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
- # limits:
- # cpu: 100m
- # memory: 128Mi
- # requests:
- # cpu: 100m
- # memory: 128Mi
-
-# This is to setup the liveness and readiness probes more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
-livenessProbe:
- httpGet:
- path: /
- port: http
-readinessProbe:
- httpGet:
- path: /
- port: http
-
-# This section is for setting up autoscaling more information can be found here: https://kubernetes.io/docs/concepts/workloads/autoscaling/
-autoscaling:
- enabled: false
- minReplicas: 1
- maxReplicas: 100
- targetCPUUtilizationPercentage: 80
- # targetMemoryUtilizationPercentage: 80
-
-# Additional volumes on the output Deployment definition.
-volumes: []
-# - name: foo
-# secret:
-# secretName: mysecret
-# optional: false
-
-# Additional volumeMounts on the output Deployment definition.
-volumeMounts: []
-# - name: foo
-# mountPath: "/etc/foo"
-# readOnly: true
-
-nodeSelector: {}
-
-tolerations: []
-
-affinity: {}
diff --git a/helm/frontend/.helmignore b/helm/frontend/.helmignore
deleted file mode 100644
index 0e8a0eb36f4ca2c939201c0d54b5d82a1ea34778..0000000000000000000000000000000000000000
--- a/helm/frontend/.helmignore
+++ /dev/null
@@ -1,23 +0,0 @@
-# Patterns to ignore when building packages.
-# This supports shell glob matching, relative path matching, and
-# negation (prefixed with !). Only one pattern per line.
-.DS_Store
-# Common VCS dirs
-.git/
-.gitignore
-.bzr/
-.bzrignore
-.hg/
-.hgignore
-.svn/
-# Common backup files
-*.swp
-*.bak
-*.tmp
-*.orig
-*~
-# Various IDEs
-.project
-.idea/
-*.tmproj
-.vscode/
diff --git a/helm/frontend/Chart.yaml b/helm/frontend/Chart.yaml
deleted file mode 100644
index 147b26cad70d1c3370a97db492898772f5618acb..0000000000000000000000000000000000000000
--- a/helm/frontend/Chart.yaml
+++ /dev/null
@@ -1,24 +0,0 @@
-apiVersion: v2
-name: frontend
-description: A Helm chart for Kubernetes
-
-# A chart can be either an 'application' or a 'library' chart.
-#
-# Application charts are a collection of templates that can be packaged into versioned archives
-# to be deployed.
-#
-# Library charts provide useful utilities or functions for the chart developer. They're included as
-# a dependency of application charts to inject those utilities and functions into the rendering
-# pipeline. Library charts do not define any templates and therefore cannot be deployed.
-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.1.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
-# follow Semantic Versioning. They should reflect the version the application is using.
-# It is recommended to use it with quotes.
-appVersion: "1.16.0"
diff --git a/helm/frontend/templates/NOTES.txt b/helm/frontend/templates/NOTES.txt
deleted file mode 100644
index 0df49655c5e456687757f817d7926a3a8638a8a0..0000000000000000000000000000000000000000
--- a/helm/frontend/templates/NOTES.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-1. Get the application URL by running these commands:
-{{- if .Values.ingress.enabled }}
-{{- range $host := .Values.ingress.hosts }}
- {{- range .paths }}
- http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
- {{- end }}
-{{- end }}
-{{- else if contains "NodePort" .Values.service.type }}
- export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "frontend.fullname" . }})
- export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
- echo http://$NODE_IP:$NODE_PORT
-{{- else if contains "LoadBalancer" .Values.service.type }}
- NOTE: It may take a few minutes for the LoadBalancer IP to be available.
- You can watch its status by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "frontend.fullname" . }}'
- export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "frontend.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
- echo http://$SERVICE_IP:{{ .Values.service.port }}
-{{- else if contains "ClusterIP" .Values.service.type }}
- export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "frontend.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
- export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
- echo "Visit http://127.0.0.1:8080 to use your application"
- kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
-{{- end }}
diff --git a/helm/frontend/templates/_helpers.tpl b/helm/frontend/templates/_helpers.tpl
deleted file mode 100644
index 92c6c3b2d9767e8d3b5946956b841661a2c0ce5a..0000000000000000000000000000000000000000
--- a/helm/frontend/templates/_helpers.tpl
+++ /dev/null
@@ -1,62 +0,0 @@
-{{/*
-Expand the name of the chart.
-*/}}
-{{- define "frontend.name" -}}
-{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
-{{- end }}
-
-{{/*
-Create a default fully qualified app name.
-We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
-If release name contains chart name it will be used as a full name.
-*/}}
-{{- define "frontend.fullname" -}}
-{{- if .Values.fullnameOverride }}
-{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
-{{- else }}
-{{- $name := default .Chart.Name .Values.nameOverride }}
-{{- if contains $name .Release.Name }}
-{{- .Release.Name | trunc 63 | trimSuffix "-" }}
-{{- else }}
-{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
-{{- end }}
-{{- end }}
-{{- end }}
-
-{{/*
-Create chart name and version as used by the chart label.
-*/}}
-{{- define "frontend.chart" -}}
-{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
-{{- end }}
-
-{{/*
-Common labels
-*/}}
-{{- define "frontend.labels" -}}
-helm.sh/chart: {{ include "frontend.chart" . }}
-{{ include "frontend.selectorLabels" . }}
-{{- if .Chart.AppVersion }}
-app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
-{{- end }}
-app.kubernetes.io/managed-by: {{ .Release.Service }}
-{{- end }}
-
-{{/*
-Selector labels
-*/}}
-{{- define "frontend.selectorLabels" -}}
-app.kubernetes.io/name: {{ include "frontend.name" . }}
-app.kubernetes.io/instance: {{ .Release.Name }}
-{{- end }}
-
-{{/*
-Create the name of the service account to use
-*/}}
-{{- define "frontend.serviceAccountName" -}}
-{{- if .Values.serviceAccount.create }}
-{{- default (include "frontend.fullname" .) .Values.serviceAccount.name }}
-{{- else }}
-{{- default "default" .Values.serviceAccount.name }}
-{{- end }}
-{{- end }}
diff --git a/helm/frontend/templates/deployment.yaml b/helm/frontend/templates/deployment.yaml
deleted file mode 100644
index 606065cb49e35e0619dfa8d3bb44f09973333bc0..0000000000000000000000000000000000000000
--- a/helm/frontend/templates/deployment.yaml
+++ /dev/null
@@ -1,26 +0,0 @@
-apiVersion: apps/v1
-kind: Deployment
-metadata:
- name: {{ .Release.Name }}-frontend
-spec:
- replicas: {{ .Values.replicaCount }}
- selector:
- matchLabels:
- app: {{ .Release.Name }}-frontend
- template:
- metadata:
- labels:
- app: {{ .Release.Name }}-frontend
- spec:
- containers:
- - name: frontend
- image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
- ports:
- - containerPort: 80
- volumeMounts:
- - name: frontend-build
- mountPath: /usr/share/caddy
- volumes:
- - name: frontend-build
-
- emptyDir: {}
diff --git a/helm/frontend/templates/hpa.yaml b/helm/frontend/templates/hpa.yaml
deleted file mode 100644
index 535b34773c9c5179ea3666abacbd753f4c375193..0000000000000000000000000000000000000000
--- a/helm/frontend/templates/hpa.yaml
+++ /dev/null
@@ -1,32 +0,0 @@
-{{- if .Values.autoscaling.enabled }}
-apiVersion: autoscaling/v2
-kind: HorizontalPodAutoscaler
-metadata:
- name: {{ include "frontend.fullname" . }}
- labels:
- {{- include "frontend.labels" . | nindent 4 }}
-spec:
- scaleTargetRef:
- apiVersion: apps/v1
- kind: Deployment
- name: {{ include "frontend.fullname" . }}
- minReplicas: {{ .Values.autoscaling.minReplicas }}
- maxReplicas: {{ .Values.autoscaling.maxReplicas }}
- metrics:
- {{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
- - type: Resource
- resource:
- name: cpu
- target:
- type: Utilization
- averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
- {{- end }}
- {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
- - type: Resource
- resource:
- name: memory
- target:
- type: Utilization
- averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
- {{- end }}
-{{- end }}
diff --git a/helm/frontend/templates/ingress.yaml b/helm/frontend/templates/ingress.yaml
deleted file mode 100644
index 820eca4f11960472fa4665217391d972c1ae4040..0000000000000000000000000000000000000000
--- a/helm/frontend/templates/ingress.yaml
+++ /dev/null
@@ -1,43 +0,0 @@
-{{- if .Values.ingress.enabled -}}
-apiVersion: networking.k8s.io/v1
-kind: Ingress
-metadata:
- name: {{ include "frontend.fullname" . }}
- labels:
- {{- include "frontend.labels" . | nindent 4 }}
- {{- with .Values.ingress.annotations }}
- annotations:
- {{- toYaml . | nindent 4 }}
- {{- end }}
-spec:
- {{- with .Values.ingress.className }}
- ingressClassName: {{ . }}
- {{- end }}
- {{- if .Values.ingress.tls }}
- tls:
- {{- range .Values.ingress.tls }}
- - hosts:
- {{- range .hosts }}
- - {{ . | quote }}
- {{- end }}
- secretName: {{ .secretName }}
- {{- end }}
- {{- end }}
- rules:
- {{- range .Values.ingress.hosts }}
- - host: {{ .host | quote }}
- http:
- paths:
- {{- range .paths }}
- - path: {{ .path }}
- {{- with .pathType }}
- pathType: {{ . }}
- {{- end }}
- backend:
- service:
- name: {{ include "frontend.fullname" $ }}
- port:
- number: {{ $.Values.service.port }}
- {{- end }}
- {{- end }}
-{{- end }}
diff --git a/helm/frontend/templates/service.yaml b/helm/frontend/templates/service.yaml
deleted file mode 100644
index dc78c20c75668b30faec024534e9e4ebb836b4fe..0000000000000000000000000000000000000000
--- a/helm/frontend/templates/service.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
-apiVersion: v1
-kind: Service
-metadata:
- name: {{ .Release.Name }}-frontend
-spec:
- ports:
- - port: 80
- targetPort: 80
- selector:
- app: {{ .Release.Name }}-frontend
diff --git a/helm/frontend/templates/serviceaccount.yaml b/helm/frontend/templates/serviceaccount.yaml
deleted file mode 100644
index 22facbdb061fe954663abf4c8141529b62300aa7..0000000000000000000000000000000000000000
--- a/helm/frontend/templates/serviceaccount.yaml
+++ /dev/null
@@ -1,13 +0,0 @@
-{{- if .Values.serviceAccount.create -}}
-apiVersion: v1
-kind: ServiceAccount
-metadata:
- name: {{ include "frontend.serviceAccountName" . }}
- labels:
- {{- include "frontend.labels" . | nindent 4 }}
- {{- with .Values.serviceAccount.annotations }}
- annotations:
- {{- toYaml . | nindent 4 }}
- {{- end }}
-automountServiceAccountToken: {{ .Values.serviceAccount.automount }}
-{{- end }}
diff --git a/helm/frontend/templates/tests/test-connection.yaml b/helm/frontend/templates/tests/test-connection.yaml
deleted file mode 100644
index 372ac5eba9f3100b6644a4e3aa575df8f7380d1c..0000000000000000000000000000000000000000
--- a/helm/frontend/templates/tests/test-connection.yaml
+++ /dev/null
@@ -1,15 +0,0 @@
-apiVersion: v1
-kind: Pod
-metadata:
- name: "{{ include "frontend.fullname" . }}-test-connection"
- labels:
- {{- include "frontend.labels" . | nindent 4 }}
- annotations:
- "helm.sh/hook": test
-spec:
- containers:
- - name: wget
- image: busybox
- command: ['wget']
- args: ['{{ include "frontend.fullname" . }}:{{ .Values.service.port }}']
- restartPolicy: Never
diff --git a/helm/frontend/values.yaml b/helm/frontend/values.yaml
deleted file mode 100644
index 3a8f5cda71a71847d5ffecf035f74c4c05e0fbbc..0000000000000000000000000000000000000000
--- a/helm/frontend/values.yaml
+++ /dev/null
@@ -1,18 +0,0 @@
-replicaCount: 1
-
-image:
- repository: todo-app-jan-schnaidt-and-abdullah-kiran-frontend
- tag: latest
-
-service:
- type: ClusterIP
-
-resources: {}
-
-serviceAccount:
- create: false
-
-ingress:
- enabled: false
- host: localhost
-
diff --git a/helm/mongodb/Chart.yaml b/helm/mongodb/Chart.yaml
index 202c1abbb3f9bb4fe7f670793e3a106d7ad05ad1..2352a598596607b1b2dc6ea5dafdffa59b2a91da 100644
--- a/helm/mongodb/Chart.yaml
+++ b/helm/mongodb/Chart.yaml
@@ -1,24 +1,6 @@
apiVersion: v2
name: mongodb
-description: A Helm chart for Kubernetes
-
-# A chart can be either an 'application' or a 'library' chart.
-#
-# Application charts are a collection of templates that can be packaged into versioned archives
-# to be deployed.
-#
-# Library charts provide useful utilities or functions for the chart developer. They're included as
-# a dependency of application charts to inject those utilities and functions into the rendering
-# pipeline. Library charts do not define any templates and therefore cannot be deployed.
+description: A Helm Chart for MongoDB Deployment
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.1.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
-# follow Semantic Versioning. They should reflect the version the application is using.
-# It is recommended to use it with quotes.
-appVersion: "1.16.0"
+version: 1.0.0
+appVersion: 1.0.0
diff --git a/helm/mongodb/templates/configmap.yaml b/helm/mongodb/templates/configmap.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..0e7c064268a33fdc4e5af9455e804e71cab06df1
--- /dev/null
+++ b/helm/mongodb/templates/configmap.yaml
@@ -0,0 +1,16 @@
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: {{ .Values.configMap.name }}
+ namespace: {{ .Values.namespace }}
+data:
+ init-mongo.js: |
+ db = db.getSiblingDB('{{ .Values.mongodb.database }}');
+ db.createUser({
+ user: '{{ .Values.mongodb.rootUser }}',
+ pwd: '{{ .Values.mongodb.rootPassword }}',
+ roles: [
+ { role: 'readWrite', db: '{{ .Values.mongodb.database }}' },
+ { role: 'dbAdmin', db: '{{ .Values.mongodb.database }}' }
+ ]
+ });
diff --git a/helm/mongodb/templates/deployment.yaml b/helm/mongodb/templates/deployment.yaml
index 97feb412e8d968f88bf8b89ed0ffa78a39fd763d..54c88b70c51e90f8c68bbd7fed1f290d25eb0c32 100644
--- a/helm/mongodb/templates/deployment.yaml
+++ b/helm/mongodb/templates/deployment.yaml
@@ -1,68 +1,39 @@
apiVersion: apps/v1
kind: Deployment
metadata:
- name: {{ include "mongodb.fullname" . }}
- labels:
- {{- include "mongodb.labels" . | nindent 4 }}
+ name: {{ .Release.Name }}-mongodb
+ namespace: {{ .Values.namespace }}
spec:
- {{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
- {{- end }}
selector:
matchLabels:
- {{- include "mongodb.selectorLabels" . | nindent 6 }}
+ app: {{ .Release.Name }}-mongodb
template:
metadata:
- {{- with .Values.podAnnotations }}
- annotations:
- {{- toYaml . | nindent 8 }}
- {{- end }}
labels:
- {{- include "mongodb.labels" . | nindent 8 }}
- {{- with .Values.podLabels }}
- {{- toYaml . | nindent 8 }}
- {{- end }}
+ app: {{ .Release.Name }}-mongodb
spec:
- {{- with .Values.imagePullSecrets }}
- imagePullSecrets:
- {{- toYaml . | nindent 8 }}
- {{- end }}
- serviceAccountName: {{ include "mongodb.serviceAccountName" . }}
- securityContext:
- {{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- - name: {{ .Chart.Name }}
- securityContext:
- {{- toYaml .Values.securityContext | nindent 12 }}
- image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
- imagePullPolicy: {{ .Values.image.pullPolicy }}
+ - name: mongodb
+ image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
ports:
- - name: http
- containerPort: {{ .Values.service.port }}
- protocol: TCP
- livenessProbe:
- {{- toYaml .Values.livenessProbe | nindent 12 }}
- readinessProbe:
- {{- toYaml .Values.readinessProbe | nindent 12 }}
- resources:
- {{- toYaml .Values.resources | nindent 12 }}
- {{- with .Values.volumeMounts }}
+ - containerPort: {{ .Values.service.port }}
+ env:
+ - name: MONGO_INITDB_DATABASE
+ value: "{{ .Values.mongodb.database }}"
+ - name: MONGO_INITDB_ROOT_USERNAME
+ value: "{{ .Values.mongodb.rootUser }}"
+ - name: MONGO_INITDB_ROOT_PASSWORD
+ value: "{{ .Values.mongodb.rootPassword }}"
volumeMounts:
- {{- toYaml . | nindent 12 }}
- {{- end }}
- {{- with .Values.volumes }}
+ - mountPath: /data/db
+ name: mongo-data
+ - name: init-script
+ mountPath: /docker-entrypoint-initdb.d
volumes:
- {{- toYaml . | nindent 8 }}
- {{- end }}
- {{- with .Values.nodeSelector }}
- nodeSelector:
- {{- toYaml . | nindent 8 }}
- {{- end }}
- {{- with .Values.affinity }}
- affinity:
- {{- toYaml . | nindent 8 }}
- {{- end }}
- {{- with .Values.tolerations }}
- tolerations:
- {{- toYaml . | nindent 8 }}
- {{- end }}
+ - name: mongo-data
+ persistentVolumeClaim:
+ claimName: {{ .Release.Name }}-mongo-pvc
+ - name: init-script
+ configMap:
+ name: {{ .Values.configMap.name }}
diff --git a/helm/mongodb/templates/hpa.yaml b/helm/mongodb/templates/hpa.yaml
index 8a161cb665427218433380f234cedf1f45de361f..aef91af4db8dc2293d0ca296cf61216bba8a05df 100644
--- a/helm/mongodb/templates/hpa.yaml
+++ b/helm/mongodb/templates/hpa.yaml
@@ -1,32 +1,20 @@
-{{- if .Values.autoscaling.enabled }}
+{{- if .Values.autoscaling.enabled | default false }}
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
- name: {{ include "mongodb.fullname" . }}
- labels:
- {{- include "mongodb.labels" . | nindent 4 }}
+ name: {{ .Release.Name }}-hpa
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
- name: {{ include "mongodb.fullname" . }}
+ name: {{ .Release.Name }}-mongodb
minReplicas: {{ .Values.autoscaling.minReplicas }}
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
metrics:
- {{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
- {{- end }}
- {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
- - type: Resource
- resource:
- name: memory
- target:
- type: Utilization
- averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
- {{- end }}
{{- end }}
diff --git a/helm/mongodb/templates/ingress.yaml b/helm/mongodb/templates/ingress.yaml
index bf8739f21bd5584edc84e0a87e8ff4b3bb7b5bd6..2d77c25865027e992ee6d06798d234c2dd241761 100644
--- a/helm/mongodb/templates/ingress.yaml
+++ b/helm/mongodb/templates/ingress.yaml
@@ -1,43 +1,30 @@
-{{- if .Values.ingress.enabled -}}
+{{- if .Values.ingress.enabled | default false }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
- name: {{ include "mongodb.fullname" . }}
- labels:
- {{- include "mongodb.labels" . | nindent 4 }}
- {{- with .Values.ingress.annotations }}
+ name: {{ .Release.Name }}-ingress
annotations:
+ {{- with .Values.ingress.annotations }}
{{- toYaml . | nindent 4 }}
- {{- end }}
-spec:
- {{- with .Values.ingress.className }}
- ingressClassName: {{ . }}
- {{- end }}
- {{- if .Values.ingress.tls }}
- tls:
- {{- range .Values.ingress.tls }}
- - hosts:
- {{- range .hosts }}
- - {{ . | quote }}
- {{- end }}
- secretName: {{ .secretName }}
{{- end }}
- {{- end }}
+spec:
rules:
{{- range .Values.ingress.hosts }}
- - host: {{ .host | quote }}
+ - host: {{ .host }}
http:
paths:
{{- range .paths }}
- path: {{ .path }}
- {{- with .pathType }}
- pathType: {{ . }}
- {{- end }}
+ pathType: {{ .pathType }}
backend:
service:
- name: {{ include "mongodb.fullname" $ }}
+ name: {{ $.Release.Name }}-mongodb-service
port:
- number: {{ $.Values.service.port }}
+ number: 27017
{{- end }}
{{- end }}
+ {{- with .Values.ingress.tls }}
+ tls:
+ {{- toYaml . | nindent 4 }}
+ {{- end }}
{{- end }}
diff --git a/helm/mongodb/templates/pv.yaml b/helm/mongodb/templates/pv.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..a3d41e494bba8018f2de5549978fe8d574ca94e1
--- /dev/null
+++ b/helm/mongodb/templates/pv.yaml
@@ -0,0 +1,12 @@
+apiVersion: v1
+kind: PersistentVolume
+metadata:
+ name: {{ .Release.Name }}-mongo-pv
+ namespace: {{ .Values.namespace }}
+spec:
+ capacity:
+ storage: {{ .Values.storage.size }}
+ accessModes:
+ - ReadWriteOnce
+ hostPath:
+ path: {{ .Values.storage.path }}
diff --git a/helm/mongodb/templates/pvc.yaml b/helm/mongodb/templates/pvc.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..f5f21f3310f44eaf44c498796bd0f0f5ee87cf3f
--- /dev/null
+++ b/helm/mongodb/templates/pvc.yaml
@@ -0,0 +1,11 @@
+apiVersion: v1
+kind: PersistentVolumeClaim
+metadata:
+ name: {{ .Release.Name }}-mongo-pvc
+ namespace: {{ .Values.namespace }}
+spec:
+ accessModes:
+ - ReadWriteOnce
+ resources:
+ requests:
+ storage: {{ .Values.storage.size }}
diff --git a/helm/mongodb/templates/service.yaml b/helm/mongodb/templates/service.yaml
index b31075dd4255e72809f1d1357cb19048643b796a..885b5ecc41abab491dec10b6379f912ad27bd1bc 100644
--- a/helm/mongodb/templates/service.yaml
+++ b/helm/mongodb/templates/service.yaml
@@ -1,15 +1,13 @@
apiVersion: v1
kind: Service
metadata:
- name: {{ include "mongodb.fullname" . }}
- labels:
- {{- include "mongodb.labels" . | nindent 4 }}
+ name: {{ .Values.service.name }}
+ namespace: {{ .Values.namespace }}
spec:
- type: {{ .Values.service.type }}
- ports:
- - port: {{ .Values.service.port }}
- targetPort: http
- protocol: TCP
- name: http
selector:
- {{- include "mongodb.selectorLabels" . | nindent 4 }}
+ app: {{ .Release.Name }}-mongodb
+ ports:
+ - protocol: TCP
+ port: {{ .Values.service.port }}
+ targetPort: {{ .Values.service.port }}
+ type: {{ .Values.service.type }}
diff --git a/helm/mongodb/values.yaml b/helm/mongodb/values.yaml
index 3821f6384641217b3069fea04b0ca1b377e1ab1b..afd0b21a54864330300102bfd27f04001815a680 100644
--- a/helm/mongodb/values.yaml
+++ b/helm/mongodb/values.yaml
@@ -1,123 +1,47 @@
-# Default values for mongodb.
-# This is a YAML-formatted file.
-# Declare variables to be passed into your templates.
-
-# This will set the replicaset count more information can be found here: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/
replicaCount: 1
-# This sets the container image more information can be found here: https://kubernetes.io/docs/concepts/containers/images/
image:
- repository: nginx
- # This sets the pull policy for images.
+ repository: mongo
+ tag: latest
pullPolicy: IfNotPresent
- # Overrides the image tag whose default is the chart appVersion.
- tag: ""
-# This is for the secretes for pulling an image from a private repository more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
-imagePullSecrets: []
-# This is to override the chart name.
-nameOverride: ""
-fullnameOverride: ""
+mongodb:
+ database: todo
+ rootUser: tododbuser
+ rootPassword: tododbadminpassword
-# This section builds out the service account more information can be found here: https://kubernetes.io/docs/concepts/security/service-accounts/
-serviceAccount:
- # Specifies whether a service account should be created
- create: true
- # Automatically mount a ServiceAccount's API credentials?
- automount: true
- # Annotations to add to the service account
- annotations: {}
- # The name of the service account to use.
- # If not set and create is true, a name is generated using the fullname template
- name: ""
+service:
+ name: mongodb-service
+ type: ClusterIP
+ port: 27017
-# This is for setting Kubernetes Annotations to a Pod.
-# For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
-podAnnotations: {}
-# This is for setting Kubernetes Labels to a Pod.
-# For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
-podLabels: {}
+storage:
+ size: 1Gi
+ path: /data/mongo
-podSecurityContext: {}
- # fsGroup: 2000
+configMap:
+ name: mongo-init-script
-securityContext: {}
- # capabilities:
- # drop:
- # - ALL
- # readOnlyRootFilesystem: true
- # runAsNonRoot: true
- # runAsUser: 1000
+namespace: todo
-# This is for setting up a service more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/
-service:
- # This sets the service type more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types
- type: ClusterIP
- # This sets the ports more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/#field-spec-ports
- port: 80
+serviceAccount:
+ create: true
+ name: mongodb-serviceaccount
+ automount: true
+ annotations: {}
-# This block is for setting up the ingress for more information can be found here: https://kubernetes.io/docs/concepts/services-networking/ingress/
ingress:
enabled: false
- className: ""
annotations: {}
- # kubernetes.io/ingress.class: nginx
- # kubernetes.io/tls-acme: "true"
hosts:
- - host: chart-example.local
+ - host: mongodb.local
paths:
- path: /
- pathType: ImplementationSpecific
+ pathType: Prefix
tls: []
- # - secretName: chart-example-tls
- # hosts:
- # - chart-example.local
-
-resources: {}
- # We usually recommend not to specify default resources and to leave this as a conscious
- # choice for the user. This also increases chances charts run on environments with little
- # resources, such as Minikube. If you do want to specify resources, uncomment the following
- # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
- # limits:
- # cpu: 100m
- # memory: 128Mi
- # requests:
- # cpu: 100m
- # memory: 128Mi
-
-# This is to setup the liveness and readiness probes more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
-livenessProbe:
- httpGet:
- path: /
- port: http
-readinessProbe:
- httpGet:
- path: /
- port: http
-# This section is for setting up autoscaling more information can be found here: https://kubernetes.io/docs/concepts/workloads/autoscaling/
autoscaling:
enabled: false
minReplicas: 1
- maxReplicas: 100
- targetCPUUtilizationPercentage: 80
- # targetMemoryUtilizationPercentage: 80
-
-# Additional volumes on the output Deployment definition.
-volumes: []
-# - name: foo
-# secret:
-# secretName: mysecret
-# optional: false
-
-# Additional volumeMounts on the output Deployment definition.
-volumeMounts: []
-# - name: foo
-# mountPath: "/etc/foo"
-# readOnly: true
-
-nodeSelector: {}
-
-tolerations: []
-
-affinity: {}
+ maxReplicas: 1
+ targetCPUUtilizationPercentage: 80
\ No newline at end of file
diff --git a/minikube/frontend.yaml b/minikube/frontend.yaml
index 0555ad01bbbc59e8befe84916bd6bc2aa7cf8b08..5446721e5bbd13fc3ee3c696f71cf5ab568a0eed 100644
--- a/minikube/frontend.yaml
+++ b/minikube/frontend.yaml
@@ -18,18 +18,19 @@ spec:
image: frontend
imagePullPolicy: IfNotPresent # ohne diesen wert versucht minikube wieso auch immer images von dockerhub zu ziehen
ports:
- - containerPort: 32222
+ - containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: frontend-service
+ namespace: todo
spec:
selector:
app: frontend
ports:
- protocol: TCP
port: 32222
- targetPort: 32222
+ targetPort: 80
nodePort: 32222
- type: LoadBalancer
+ type: NodePort
diff --git a/run.sh b/run.sh
new file mode 100755
index 0000000000000000000000000000000000000000..3bdb36271f8bad9862e50f77b9e95347f81e7987
--- /dev/null
+++ b/run.sh
@@ -0,0 +1,31 @@
+#!/bin/sh
+# cluster löschen
+minikube delete --all
+
+# cluster erstellen
+minikube start --cpus=4 --memory=6g
+
+# zu minikube-docker switchen
+eval $(minikube docker-env)
+
+# images erstellen
+docker build -t backend:latest -f Dockerfile .
+#cd frontend
+#docker build -t frontend:latest -f Dockerfile .
+#cd ..
+
+# namespace erstellen
+kubectl create namespace todo
+
+# kubernetes files anwenden
+kubectl apply -f minikube/backend.yaml
+#kubectl apply -f minikube/frontend.yaml
+kubectl apply -f minikube/mongodb.yaml
+kubectl apply -f minikube/mongodb-pv.yaml
+kubectl apply -f minikube/mongodb-pvc.yaml
+
+# checking pods
+kubectl get pods -n todo
+
+# checking services
+kubectl get svc -n todo
\ No newline at end of file