diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index af99582..1f14607 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,16 +33,19 @@ jobs: image: uses: f2calv/gha-workflows/.github/workflows/container-image-build.yml@v1 + permissions: + packages: write #for pushing container image + contents: read #note: for private repos setting packages to write, will reset all other permissions to none (weird?) needs: [versioning, app] with: tag: ${{ needs.versioning.outputs.semVer }} chart: - uses: f2calv/gha-workflows/.github/workflows/helm-chart-build.yml@v1 + uses: f2calv/gha-workflows/.github/workflows/helm-chart-package.yml@v1 needs: [versioning, app, image] if: github.ref == 'refs/heads/main' with: - semVer: ${{ needs.versioning.outputs.semVer }} + tag: ${{ needs.versioning.outputs.semVer }} release: needs: [versioning, app, image, chart] diff --git a/charts/multi-arch-container-dotnet/templates/deployment.yaml b/charts/multi-arch-container-dotnet/templates/deployment.yaml index 4a51989..e3b95e5 100644 --- a/charts/multi-arch-container-dotnet/templates/deployment.yaml +++ b/charts/multi-arch-container-dotnet/templates/deployment.yaml @@ -18,7 +18,10 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- include "multi-arch-container-dotnet.selectorLabels" . | nindent 8 }} + {{- include "multi-arch-container-dotnet.labels" . | nindent 8 }} + {{- with .Values.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: @@ -35,18 +38,22 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - name: http - containerPort: 80 + containerPort: {{ .Values.service.port }} protocol: TCP livenessProbe: - httpGet: - path: / - port: http + {{- toYaml .Values.livenessProbe | nindent 12 }} readinessProbe: - httpGet: - path: / - port: http + {{- 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 }} diff --git a/charts/multi-arch-container-dotnet/templates/hpa.yaml b/charts/multi-arch-container-dotnet/templates/hpa.yaml index 53b1b91..b25bc06 100644 --- a/charts/multi-arch-container-dotnet/templates/hpa.yaml +++ b/charts/multi-arch-container-dotnet/templates/hpa.yaml @@ -1,5 +1,5 @@ {{- if .Values.autoscaling.enabled }} -apiVersion: autoscaling/v2beta1 +apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: {{ include "multi-arch-container-dotnet.fullname" . }} @@ -17,12 +17,16 @@ spec: - type: Resource resource: name: cpu - targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} {{- end }} {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - type: Resource resource: name: memory - targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} {{- end }} {{- end }} diff --git a/charts/multi-arch-container-dotnet/templates/serviceaccount.yaml b/charts/multi-arch-container-dotnet/templates/serviceaccount.yaml index aca8c58..532a830 100644 --- a/charts/multi-arch-container-dotnet/templates/serviceaccount.yaml +++ b/charts/multi-arch-container-dotnet/templates/serviceaccount.yaml @@ -9,4 +9,5 @@ metadata: annotations: {{- toYaml . | nindent 4 }} {{- end }} +automountServiceAccountToken: {{ .Values.serviceAccount.automount }} {{- end }} diff --git a/charts/multi-arch-container-dotnet/values.yaml b/charts/multi-arch-container-dotnet/values.yaml index b6b7119..46d91c4 100644 --- a/charts/multi-arch-container-dotnet/values.yaml +++ b/charts/multi-arch-container-dotnet/values.yaml @@ -17,6 +17,8 @@ fullnameOverride: "" 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. @@ -24,6 +26,7 @@ serviceAccount: name: "" podAnnotations: {} +podLabels: {} podSecurityContext: {} # fsGroup: 2000 @@ -68,6 +71,15 @@ resources: {} # cpu: 100m # memory: 128Mi +livenessProbe: + httpGet: + path: / + port: http +readinessProbe: + httpGet: + path: / + port: http + autoscaling: enabled: false minReplicas: 1 @@ -75,6 +87,19 @@ autoscaling: 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: []