31 Commits

Author SHA1 Message Date
a8a206e5d4 Initial commit.
All checks were successful
Releasing charts / upload_helm (pgbouncer) (push) Successful in 24s
Releasing charts / upload_helm (py-app) (push) Successful in 14s
2025-07-08 04:10:26 +02:00
cf5d24cd73 Merge pull request #15 from Intreecom/fix/externalsecrets-apiversion
fix: corrected apiVersion for ExternalSecret
2025-06-20 14:50:09 +05:30
3d62a1324d fix: corrected apiVersion for ExternalSecret 2025-06-20 14:45:31 +05:30
2018449215 Merge pull request #13 from Intreecom/fix/removed-unnecessary-label
fix: removed unnecessary label from secret
2025-04-17 16:51:45 +05:30
fb5af722dd fix: removed unnecessary label from secret 2025-04-17 16:15:29 +05:30
391114cafd Merge pull request #12 from Intreecom/fix/extra-label-externalsecrets
fix: added an extra label on ExternalSecrets
2025-03-28 11:03:15 +05:30
15f5226914 corrected label path 2025-03-27 16:16:10 +05:30
ee95a47268 fix: added an extra label on ExternalSecrets
- this label will provide filtration for resource exclusion
2025-03-27 16:13:11 +05:30
81ec16a4ce Merge pull request #11 from Intreecom/fix/static-svc-port-name
fix: corrected targetPort value
2025-03-21 16:56:04 +05:30
67b6ff256a fix: corrected targetPort value
finding: The `targetPort` name is the same as
`containers[*].ports[*].name` from deployment/pod definition and not
`spec.ports[*].name` from service definition
2025-03-21 16:45:42 +05:30
961123728d Merge pull request #10 from Intreecom/feature/static-service
feature: service with a static name across envs
2025-03-20 15:06:23 +05:30
2e3a6197bb fix: simplified conditional static service 2025-03-20 11:30:27 +05:30
10c3178d54 added default value used when staticServiceName is absent 2025-03-18 19:25:44 +05:30
c61fe1c59e [wip] feature: service with a static name across envs 2025-03-18 17:23:01 +05:30
8f8d22e187 Merge pull request #2 from Intreecom/update-readme
add: oci chart usage instructions
2025-02-25 17:16:35 +01:00
d87501f660 Merge pull request #8 from Intreecom/feature/extra-manifests
feature: capability to add extra kubernetes manifests
2025-02-13 11:28:33 +05:30
cb7070ac1d features: revisionHistoryLimit and taskiq specific resources specification 2025-02-12 12:22:36 +05:30
474c501d56 added startupProbe support 2025-02-12 11:33:08 +05:30
e412a20dd6 feature: added limitrange object support 2025-02-11 20:39:53 +05:30
2a1be9740e feature: capability to add extra kubernetes manifests
example usage:

```yaml
extraManifests:
  - apiVersion: v1
    kind: LimitRange
    metadata:
      annotations:
        argocd.argoproj.io/sync-wave: "10"
      name: default-limit-range
    spec:
      limits:
      - default:
          memory: 700Mi
        defaultRequest:
          cpu: 50m
          memory: 500Mi
        type: Container
```
2025-02-11 19:43:48 +05:30
827118e89b Merge pull request #7 from Intreecom/feature/targetport-capability
feature: capability to add targetport (optional)
2025-02-11 17:41:45 +05:30
089c279bad feature: capability to add targetport (optional) 2025-02-11 17:32:55 +05:30
ef7d437225 Merge pull request #6 from Intreecom/feature/nodeport-service-type
feature/nodeport service type
2025-02-05 20:20:47 +05:30
8b2c941cd9 feature: nodeport service type compatibility 2025-02-05 20:16:48 +05:30
8af820d6ad feature: added compatibility of nodeport service type 2025-02-05 20:15:09 +05:30
0982ed7716 Merge pull request #5 from Intreecom/bugfix/command 2025-02-04 19:42:31 +01:00
2d2f306765 Fixed container command. 2025-02-04 19:40:31 +01:00
a6ca9f84d6 Merge pull request #4 from Intreecom/feature/cmd-for-deployment
feature: capability to add a `cmd` in main deployment created by chart
2025-01-16 17:30:25 +05:30
eaca6b70c1 feature: capability to add a cmd in main deployment created by chart 2025-01-16 17:27:32 +05:30
987fde8006 Merge pull request #3 from Intreecom/fix/handling-template-in-values
fix: handling template in values files
2025-01-16 13:47:14 +05:30
04ec234f70 add: oci chart usage instructions 2024-12-24 13:46:21 +05:30
15 changed files with 98 additions and 18 deletions

View File

@ -14,9 +14,6 @@ jobs:
chart: chart:
- py-app - py-app
- pgbouncer - pgbouncer
permissions:
contents: read
packages: write
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: azure/setup-helm@v4.2.0 - uses: azure/setup-helm@v4.2.0
@ -26,7 +23,7 @@ jobs:
run: | run: |
helm package --dependency-update ./charts/${{ matrix.chart }} helm package --dependency-update ./charts/${{ matrix.chart }}
helm show chart *.tgz helm show chart *.tgz
helm registry login -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} ghcr.io helm registry login -u ${{ gitea.actor }} -p ${{ secrets.UPLOADER_PAT }} gitea.le-memese.com
helm push *.tgz oci://ghcr.io/intreecom/charts helm push *.tgz oci://gitea.le-memese.com/common/charts
env: env:
HELM_EXPERIMENTAL_OCI: 1 HELM_EXPERIMENTAL_OCI: 1

View File

@ -2,3 +2,17 @@
You can find charts in charts folder and oci images for every chart in github packages. You can find charts in charts folder and oci images for every chart in github packages.
## How to use (example)
#### yaml rendering
```bash
helm template oci://ghcr.io/intreecom/charts/py-app --version 0.1.0
```
#### show chart values
```bash
helm show values oci://ghcr.io/intreecom/charts/py-app --version 0.1.0
```
#### install chart
```bash
helm install py-app oci://ghcr.io/intreecom/charts/py-app --version 0.1.0
```

View File

@ -1,6 +1,6 @@
{{- range $name, $val := .Values.externalSecrets }} {{- range $name, $val := .Values.externalSecrets }}
--- ---
apiVersion: external-secrets.io/v1beta1 apiVersion: external-secrets.io/v1
kind: ExternalSecret kind: ExternalSecret
metadata: metadata:
name: "{{include "pgbouncer.name" $ }}-{{ $name }}" name: "{{include "pgbouncer.name" $ }}-{{ $name }}"

View File

@ -11,5 +11,8 @@ spec:
targetPort: pg targetPort: pg
protocol: TCP protocol: TCP
name: pg name: pg
{{- if eq .Values.service.type "NodePort" }}
nodePort: {{ .Values.service.nodePort }}
{{- end }}
selector: selector:
{{- include "pgbouncer.selectorLabels" . | nindent 4 }} {{- include "pgbouncer.selectorLabels" . | nindent 4 }}

View File

@ -64,9 +64,12 @@ securityContext: {}
# This is for setting up a service more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/ # This is for setting up a service more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/
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 # This sets the service type more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types
# allowed values: ClusterIP (default), NodePort
type: ClusterIP type: ClusterIP
# This sets the ports more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/#field-spec-ports # This sets the ports more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/#field-spec-ports
port: 5432 port: 5432
# nodePort property is required when the .Values.service.type is NodePort
# nodePort: "35432"
resources: {} resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious # We usually recommend not to specify default resources and to leave this as a conscious

View File

@ -8,6 +8,7 @@ metadata:
spec: spec:
{{- if not .Values.autoscaling.enabled }} {{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }} replicas: {{ .Values.replicaCount }}
revisionHistoryLimit: {{ .Values.revisionHistoryLimit | default 5 }}
{{- end }} {{- end }}
{{- with .Values.updateStrategy }} {{- with .Values.updateStrategy }}
strategy: strategy:
@ -35,6 +36,9 @@ spec:
containers: containers:
- name: {{ .Chart.Name }} - name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
{{- if .Values.command }}
command: {{ .Values.command }}
{{- end}}
imagePullPolicy: {{ .Values.image.pullPolicy }} imagePullPolicy: {{ .Values.image.pullPolicy }}
ports: ports:
- name: http - name: http
@ -46,7 +50,13 @@ spec:
{{- with .Values.probes.readiness }} {{- with .Values.probes.readiness }}
readinessProbe: {{ . | toYaml | nindent 12 }} readinessProbe: {{ . | toYaml | nindent 12 }}
{{- end }} {{- end }}
{{- with .Values.probes.startup }}
startupProbe: {{ . | toYaml | nindent 12 }}
{{- end }}
{{- include "py-app.envs" . | indent 10 -}} {{- include "py-app.envs" . | indent 10 -}}
{{- with .Values.securityContext }}
securityContext: {{ . | toYaml | nindent 12 }}
{{- end }}
resources: resources:
{{- toYaml .Values.resources | nindent 12 }} {{- toYaml .Values.resources | nindent 12 }}

View File

@ -1,19 +1,20 @@
{{- range $name, $val := .Values.externalSecrets }} {{- range $name, $val := .Values.externalSecrets }}
--- ---
apiVersion: external-secrets.io/v1beta1 apiVersion: external-secrets.io/v1
kind: ExternalSecret kind: ExternalSecret
metadata: metadata:
name: "{{include "py-app.name" $ }}-{{ $name }}" name: "{{include "py-app.name" $ }}-{{ $name }}"
labels: labels:
{{- include "py-app.labels" $ | nindent 4 }} {{- include "py-app.labels" $ | nindent 4 }}
annotations: annotations:
argocd.argoproj.io/hook: PreSync,Sync "helm.sh/hook": pre-install,pre-upgrade
argocd.argoproj.io/sync-wave: "-1" "helm.sh/hook-delete-policy": before-hook-creation
"helm.sh/hook-weight": "-1"
spec: spec:
refreshInterval: {{ default "1h" $val.refreshInterval }} # rate SecretManager pulls GCPSM refreshInterval: {{ default "1h" $val.refreshInterval }}
secretStoreRef: secretStoreRef:
kind: ClusterSecretStore kind: ClusterSecretStore
name: {{ $val.secretStoreName }} # name of the SecretStore (or kind specified) name: {{ $val.secretStoreName }}
target: target:
name: {{ $val.targetName }} name: {{ $val.targetName }}
creationPolicy: {{ default "Owner" $val.targetCreationPolicy }} creationPolicy: {{ default "Owner" $val.targetCreationPolicy }}

View File

@ -0,0 +1,6 @@
{{- if .Values.extraManifests }}
{{- range .Values.extraManifests }}
---
{{ toYaml . }}
{{- end }}
{{- end }}

View File

@ -0,0 +1,12 @@
{{- if .Values.limitRange.create }}
apiVersion: v1
kind: LimitRange
metadata:
name: {{ include "py-app.fullname" . }}
labels:
{{- include "py-app.labels" . | nindent 4 }}
spec:
{{- with .Values.limitRange.limits }}
limits: {{ . | toYaml | nindent 2 }}
{{- end }}
{{- end -}}

View File

@ -5,12 +5,12 @@
apiVersion: batch/v1 apiVersion: batch/v1
kind: Job kind: Job
metadata: metadata:
generateName: "{{ include "py-app.fullname" $ }}-{{ $name }}-mj" name: "{{ include "py-app.fullname" $ }}-{{ $name }}-mj"
labels: labels:
{{- include "py-app.labels" $ | nindent 4 }} {{- include "py-app.labels" $ | nindent 4 }}
annotations: annotations:
argocd.argoproj.io/hook: PreSync "helm.sh/hook": pre-install,pre-upgrade
argocd.argoproj.io/hook-delete-policy: HookSucceeded "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
{{- with $val.annotations }} {{- with $val.annotations }}
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}

View File

@ -9,9 +9,12 @@ spec:
type: {{ .Values.service.type }} type: {{ .Values.service.type }}
ports: ports:
- port: {{ .Values.service.port }} - port: {{ .Values.service.port }}
targetPort: http targetPort: {{ .Values.service.targetPort | default "http" }}
protocol: TCP protocol: TCP
name: http name: http
{{- if eq .Values.service.type "NodePort" }}
nodePort: {{ .Values.service.nodePort }}
{{- end }}
selector: selector:
{{- include "py-app.selectorLabels" . | nindent 4 }} {{- include "py-app.selectorLabels" . | nindent 4 }}
deployment_type: web deployment_type: web

View File

@ -0,0 +1,18 @@
{{- if and .Values.service.enabled .Values.service.staticServiceName -}}
apiVersion: v1
kind: Service
metadata:
name: {{ .Values.service.staticServiceName }}
labels:
{{- include "py-app.labels" . | nindent 4 }}
spec:
type: ClusterIP
ports:
- port: {{ .Values.service.port }}
targetPort: {{ .Values.service.targetPort | default .Values.service.port }}
protocol: TCP
name: static-service
selector:
{{- include "py-app.selectorLabels" . | nindent 4 }}
deployment_type: web
{{- end }}

View File

@ -33,5 +33,5 @@ spec:
command: {{ .Values.taskiq.schedulerCmd | toYaml | nindent 10 }} command: {{ .Values.taskiq.schedulerCmd | toYaml | nindent 10 }}
{{- include "py-app.envs" . | indent 10 -}} {{- include "py-app.envs" . | indent 10 -}}
resources: resources:
{{- toYaml .Values.resources | nindent 12 }} {{- toYaml .Values.taskiq.resources | nindent 12 }}
{{- end }} {{- end }}

View File

@ -39,5 +39,5 @@ spec:
command: {{ .Values.taskiq.workerCmd | toYaml | nindent 10 }} command: {{ .Values.taskiq.workerCmd | toYaml | nindent 10 }}
{{- include "py-app.envs" . | indent 10 -}} {{- include "py-app.envs" . | indent 10 -}}
resources: resources:
{{- toYaml .Values.resources | nindent 12 }} {{- toYaml .Values.taskiq.resources | nindent 12 }}
{{- end }} {{- end }}

View File

@ -20,7 +20,7 @@ migrators: {}
# pg: # pg:
# # Job's additional annotations # # Job's additional annotations
# annotations: # annotations:
# argocd.argoproj.io/sync-wave: "5" # "helm.sh/hook-weight": "-1"
# command: ["alembic", "upgrade", "head"] # command: ["alembic", "upgrade", "head"]
# # You can specify limits for every migrator Job. # # You can specify limits for every migrator Job.
# resources: {} # resources: {}
@ -30,6 +30,7 @@ ttlSecondsAfterFinished: 3600
taskiq: taskiq:
workerCmd: [] workerCmd: []
schedulerCmd: [] schedulerCmd: []
resources: {}
workers: 1 workers: 1
autoscaling: autoscaling:
enabled: false enabled: false
@ -86,6 +87,7 @@ service:
enabled: true enabled: true
type: ClusterIP type: ClusterIP
port: 80 port: 80
staticServiceName: ""
ingress: ingress:
enabled: false enabled: false
@ -125,3 +127,14 @@ autoscaling:
maxReplicas: 20 maxReplicas: 20
targetCPUUtilizationPercentage: 80 targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80 # targetMemoryUtilizationPercentage: 80
limitRange:
create: false
# limits:
# - default:
# memory: 700Mi
# defaultRequest:
# cpu: 50m
# memory: 500Mi
# type: Container
extraManifests: []