Skip to content

Commit

Permalink
F2calv/2024 05 update2 (#32)
Browse files Browse the repository at this point in the history
* update chart

* update ci
  • Loading branch information
f2calv authored May 3, 2024
1 parent b5847cd commit 6f7e7cb
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 13 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
23 changes: 15 additions & 8 deletions charts/multi-arch-container-dotnet/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 }}
Expand Down
10 changes: 7 additions & 3 deletions charts/multi-arch-container-dotnet/templates/hpa.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.autoscaling.enabled }}
apiVersion: autoscaling/v2beta1
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "multi-arch-container-dotnet.fullname" . }}
Expand All @@ -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 }}
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ metadata:
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
automountServiceAccountToken: {{ .Values.serviceAccount.automount }}
{{- end }}
25 changes: 25 additions & 0 deletions charts/multi-arch-container-dotnet/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@ 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.
# If not set and create is true, a name is generated using the fullname template
name: ""

podAnnotations: {}
podLabels: {}

podSecurityContext: {}
# fsGroup: 2000
Expand Down Expand Up @@ -68,13 +71,35 @@ resources: {}
# cpu: 100m
# memory: 128Mi

livenessProbe:
httpGet:
path: /
port: http
readinessProbe:
httpGet:
path: /
port: http

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: []
Expand Down

0 comments on commit 6f7e7cb

Please sign in to comment.