diff --git a/charts/iam/Chart.yaml b/charts/iam/Chart.yaml index 4a2bdc2..635758a 100644 --- a/charts/iam/Chart.yaml +++ b/charts/iam/Chart.yaml @@ -15,10 +15,10 @@ 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.14 +version: 0.1.15 # 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: "v2" +appVersion: "v3" diff --git a/charts/iam/values.yaml b/charts/iam/values.yaml index 3c8c033..2a2a2c7 100644 --- a/charts/iam/values.yaml +++ b/charts/iam/values.yaml @@ -25,12 +25,6 @@ image: pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. tag: "" - mysql: - repository: mysql - # This sets the pull policy for images. - pullPolicy: IfNotPresent - # Overrides the image tag whose default is the chart appVersion. - tag: "8" # 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: [] @@ -77,7 +71,7 @@ service: # 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: true + enabled: false className: "" annotations: {} hosts: diff --git a/charts/matverseny-backend/Chart.yaml b/charts/matverseny-backend/Chart.yaml index 7fd1ddb..6dd783e 100644 --- a/charts/matverseny-backend/Chart.yaml +++ b/charts/matverseny-backend/Chart.yaml @@ -15,10 +15,10 @@ 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 +version: 0.1.1 # 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" +appVersion: "v1" diff --git a/charts/matverseny-backend/templates/deployment.yaml b/charts/matverseny-backend/templates/deployment.yaml index 207dc22..e098de8 100644 --- a/charts/matverseny-backend/templates/deployment.yaml +++ b/charts/matverseny-backend/templates/deployment.yaml @@ -5,12 +5,15 @@ metadata: labels: {{- include "matverseny-backend.labels" . | nindent 4 }} spec: - {{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCount }} - {{- end }} selector: matchLabels: {{- include "matverseny-backend.selectorLabels" . | nindent 6 }} + strategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 0 + maxUnavailable: 1 template: metadata: {{- with .Values.podAnnotations }} @@ -66,3 +69,10 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} + topologySpreadConstraints: + - maxSkew: 1 + topologyKey: {{ .Values.topologySpreadConstraints.topologyKey }} + whenUnsatisfiable: DoNotSchedule + labelSelector: + matchLabels: + {{- include "iam.selectorLabels" . | nindent 14 }} diff --git a/charts/matverseny-backend/templates/hpa.yaml b/charts/matverseny-backend/templates/hpa.yaml deleted file mode 100644 index eb6e807..0000000 --- a/charts/matverseny-backend/templates/hpa.yaml +++ /dev/null @@ -1,32 +0,0 @@ -{{- if .Values.autoscaling.enabled }} -apiVersion: autoscaling/v2 -kind: HorizontalPodAutoscaler -metadata: - name: {{ include "matverseny-backend.fullname" . }} - labels: - {{- include "matverseny-backend.labels" . | nindent 4 }} -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: {{ include "matverseny-backend.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/charts/matverseny-backend/values.yaml b/charts/matverseny-backend/values.yaml index 21fb382..a651616 100644 --- a/charts/matverseny-backend/values.yaml +++ b/charts/matverseny-backend/values.yaml @@ -3,11 +3,11 @@ # 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 +replicaCount: 3 # This sets the container image more information can be found here: https://kubernetes.io/docs/concepts/containers/images/ image: - repository: nginx + repository: ghcr.io/verseghy/matverseny-backend # This sets the pull policy for images. pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. @@ -38,31 +38,29 @@ podAnnotations: {} # For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ podLabels: {} -podSecurityContext: {} - # fsGroup: 2000 +podSecurityContext: + fsGroup: 2000 -securityContext: {} - # capabilities: - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 +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 + port: 3002 # 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: @@ -88,21 +86,13 @@ resources: {} # 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: / + path: /liveness port: http readinessProbe: httpGet: - path: / + path: /readiness 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 @@ -121,3 +111,12 @@ nodeSelector: {} tolerations: [] affinity: {} + +topologySpreadConstraints: + topologyKey: kubernetes.io/hostname + +database: + main: + storage: 1Gi + backup: + storage: 1Gi diff --git a/charts/matverseny/templates/matverseny-backend.yaml b/charts/matverseny/templates/matverseny-backend.yaml new file mode 100644 index 0000000..8e1336c --- /dev/null +++ b/charts/matverseny/templates/matverseny-backend.yaml @@ -0,0 +1,32 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: matverseny-backend + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + project: default + source: + repoURL: https://verseghy.github.io/charts/ + chart: matverseny-backend + targetRevision: 0.1.1 + helm: + valuesObject: + ingress: + annotations: + cert-manager.io/issuer: letsencrypt-prod + enabled: true + hosts: + - host: api.{{ .Values.hostname }} + paths: + - path: / + pathType: ImplementationSpecific + tls: + - hosts: + - api.{{ .Values.hostname }} + secretName: matverseny-frontend-tls + destination: + server: https://kubernetes.default.svc + namespace: {{ .Values.namespace }} + syncPolicy: + automated: {} diff --git a/charts/matverseny/templates/matverseny-iam.yaml b/charts/matverseny/templates/matverseny-iam.yaml index b8972e5..a80b82d 100644 --- a/charts/matverseny/templates/matverseny-iam.yaml +++ b/charts/matverseny/templates/matverseny-iam.yaml @@ -9,7 +9,7 @@ spec: source: repoURL: https://verseghy.github.io/charts/ chart: iam - targetRevision: 0.1.14 + targetRevision: 0.1.15 helm: valuesObject: ingress: