Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Aaron Baideme

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
4 changes: 2 additions & 2 deletions charts/generic-helm-chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: generic-helm-chart
description: A Generic Helm Chart to support easy deployment of micro-services
icon: "https://helm.sh/img/helm.svg"
type: application
version: "0.3.7"
appVersion: "0.0.1"
version: "0.4.2"
appVersion: "0.4.2"
keywords:
- generic-helm-chart
- micro-service
Expand Down
27 changes: 7 additions & 20 deletions charts/generic-helm-chart/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generic-helm-chart

![Version: 0.3.7](https://img.shields.io/badge/Version-0.3.7-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.0.1](https://img.shields.io/badge/AppVersion-0.0.1-informational?style=flat-square)
![Version: 0.4.2](https://img.shields.io/badge/Version-0.4.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.4.2](https://img.shields.io/badge/AppVersion-0.4.2-informational?style=flat-square)

A Generic Helm Chart to support easy deployment of micro-services

Expand All @@ -26,7 +26,7 @@ A Generic Helm Chart to support easy deployment of micro-services
| autoscaling.scaleTarget | object | `{}` | |
| autoscaling.targetCPUScaling | int | `80` | |
| autoscaling.targetMemScaling | int | `80` | |
| cluster | string | `"cluster"` | |
| cluster | string | `""` | |
| configMap.config.data | object | `{}` | |
| configMap.config.name | string | `""` | |
| configMap.config.suffix | string | `"config"` | |
Expand All @@ -37,21 +37,17 @@ A Generic Helm Chart to support easy deployment of micro-services
| deployment.image.pullPolicy | string | `"IfNotPresent"` | |
| deployment.image.repository | string | `""` | |
| deployment.image.tag | string | `""` | |
| deployment.imagePullSecrets[0].name | string | `"regcred"` | |
| deployment.imagePullSecrets | list | `[]` | |
| deployment.livenessProbe | object | `{}` | |
| deployment.nodeSelector | object | `{}` | |
| deployment.podAnnotations | object | `{}` | |
| deployment.podSecurityContext | object | `{}` | |
| deployment.readinessProbe | object | `{}` | |
| deployment.replicaCount | int | `1` | |
| deployment.resources.limits.cpu | string | `"200m"` | |
| deployment.resources.limits.memory | string | `"400Mi"` | |
| deployment.resources.requests.cpu | string | `"200m"` | |
| deployment.resources.requests.memory | string | `"400Mi"` | |
| deployment.securityContext | object | `{}` | |
| deployment.startupProbe | object | `{}` | |
| deployment.tolerations | list | `[]` | |
| environment | string | `"environment"` | |
| environment | string | `""` | |
| externalSecret.enabled | bool | `false` | |
| fullnameOverride | string | `"generic-helm-chart"` | |
| goDBMigration.enabled | bool | `false` | |
Expand All @@ -60,23 +56,14 @@ A Generic Helm Chart to support easy deployment of micro-services
| ingress[0].name | string | `"example"` | |
| ingress[1].enabled | bool | `false` | |
| ingress[1].name | string | `"another-example"` | |
| jobs | list | `[]` | |
| nameOverride | string | `"generic-helm-chart"` | |
| pdb.enabled | bool | `false` | |
| pdb.minAvailable | string | `"50%"` | |
| podMonitor.enabled | bool | `false` | |
| rustDBMigration.enabled | bool | `false` | |
| rustDBMigration.podAnnotations | object | `{}` | |
| service.enabled | bool | `true` | |
| service.multiServices.enabled | bool | `false` | |
| service.port[0].name | string | `"http"` | |
| service.port[0].port | int | `8080` | |
| service.port[0].protocol | string | `"TCP"` | |
| service.port[0].targetPort | string | `"http"` | |
| service.port[1].name | string | `"http"` | |
| service.port[1].port | int | `8081` | |
| service.port[1].protocol | string | `"TCP"` | |
| service.port[1].targetPort | string | `"http-metric"` | |
| service.type | string | `"ClusterIP"` | |
| service.enabled | bool | `false` | |
| serviceAccount.annotations | object | `{}` | |
| serviceAccount.create | bool | `true` | |
| serviceAccount.multiServiceAccounts.enabled | bool | `false` | |
Expand All @@ -85,4 +72,4 @@ A Generic Helm Chart to support easy deployment of micro-services
| volumes.enabled | bool | `false` | |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.11.3](https://github.com/norwoodj/helm-docs/releases/v1.11.3)
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)
6 changes: 2 additions & 4 deletions charts/generic-helm-chart/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,8 @@ Common labels
{{ toYaml .Values.commonLabels }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
hextrust.platform/chart-version: {{ .Chart.Version | quote }}
hextrust.platform/chart-name: generic-helm-chart
hextrust.platform/cluster: {{ .Values.cluster | quote }}
hextrust.platform/environment: {{ .Values.environment | quote }}
platform/chart-version: {{ .Chart.Version | quote }}
platform/chart-name: generic-helm-chart
{{- end }}

{{/*
Expand Down
2 changes: 2 additions & 0 deletions charts/generic-helm-chart/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{{- $fullname := include "app.fullname" . }}
{{- $labels := include "app.labels" . }}
{{- range $val := .Values.configMap }}
{{- if $val.data }}
---
apiVersion: v1
kind: ConfigMap
Expand All @@ -22,4 +23,5 @@ data:
{{ $v }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
11 changes: 11 additions & 0 deletions charts/generic-helm-chart/templates/cronjobs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{- $jobs := .Values.cronJobs }}
{{- range $jobs }}
apiVersion: batch/v1
kind: CronJob
metadata:
{{ toYaml .metadata | nindent 4 }}
spec:
schedule: {{ .schedule }}
template:
{{ toYaml .template | nindent 6 }}
{{- end }}
39 changes: 38 additions & 1 deletion charts/generic-helm-chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "app.fullname" . }}
{{- if .Values.goDBMigration.enabled }}
{{- if or .Values.goDBMigration.enabled .Values.deployment.annotations}}
annotations:
{{- if .Values.goDBMigration.enabled }}
argocd.argoproj.io/sync-wave: "4"
{{- end }}
{{- if .Values.deployment.annotations }}
{{- toYaml .Values.deployment.annotations | nindent 4 }}
{{- end }}
{{- end }}
labels:
{{- include "app.labels" . | nindent 4 }}
spec:
Expand Down Expand Up @@ -55,6 +60,38 @@ spec:
volumeMounts:
{{- toYaml .volumeMounts | nindent 12 }}
{{- end }}
{{- if .env }}
env:
{{- range $k, $v := .env }}
- name: {{ $k }}
value: {{ $v }}
{{- end }}
{{- end }}
{{- if .envFrom }}
envFrom:
{{- $fullname := include "app.fullname" $ }}
{{- range $v := .envFrom }}
{{- if eq $v.type "configmap" }}
- configMapRef:
{{- if $v.name }}
name: {{ $v.name }}
{{- else if $v.suffix }}
name: {{ $fullname }}-{{ $v.suffix }}
{{- else }}
name: {{$fullname}}
{{- end }}
{{- else if eq $v.type "secret" }}
- secretRef:
{{- if $v.name }}
name: {{ $v.name }}
{{- else if $v.suffix }}
name: {{ $fullname }}-{{ $v.suffix }}
{{- else }}
name: {{$fullname}}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
Expand Down
6 changes: 3 additions & 3 deletions charts/generic-helm-chart/templates/hpa.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.autoscaling.enabled }}
apiVersion: autoscaling/v2beta2
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
annotations:
Expand All @@ -21,14 +21,14 @@ spec:
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage | default 80 }}
{{- end }}
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage | default 80 }}
{{- end }}
{{- end }}
11 changes: 11 additions & 0 deletions charts/generic-helm-chart/templates/job.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{- $jobs := .Values.jobs }}
{{- range $jobs }}
apiVersion: batch/v1
kind: Job
metadata:
{{ toYaml .metadata | nindent 4 }}
spec:
backoffLimit: 0
template:
{{ toYaml .template | nindent 6 }}
{{- end }}
48 changes: 24 additions & 24 deletions charts/generic-helm-chart/values.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
nameOverride: "generic-helm-chart"
fullnameOverride: "generic-helm-chart"

cluster: "cluster"
environment: "environment"
cluster: ""
environment: ""

## Labels attach to all resources
# commonLabels:
Expand All @@ -18,6 +18,7 @@ serviceAccount:
# names:
# - metric

jobs: []

pdb:
enabled: false
Expand All @@ -26,8 +27,7 @@ pdb:
deployment:
enabled: true
replicaCount: 1
imagePullSecrets:
- name: regcred
imagePullSecrets: []
image:
repository: ""
pullPolicy: IfNotPresent
Expand All @@ -38,13 +38,13 @@ deployment:
podAnnotations: {}
podSecurityContext: {}
securityContext: {}
resources:
requests:
memory: 400Mi
cpu: 200m
limits:
memory: 400Mi
cpu: 200m
# resources:
# requests:
# memory: 400Mi
# cpu: 200m
# limits:
# memory: 400Mi
# cpu: 200m
nodeSelector: {}
tolerations: []
affinity: {}
Expand Down Expand Up @@ -225,19 +225,19 @@ customConfigMap: {}
# "hs2_initiateTransaction": "${SVC_TX_REQ}"

service:
enabled: true
type: ClusterIP
port:
- port: 8080
targetPort: http
protocol: TCP
name: http
- port: 8081
targetPort: http-metric
protocol: TCP
name: http
multiServices:
enabled: false
enabled: false
# type: ClusterIP
# port:
# - port: 8080
# targetPort: http
# protocol: TCP
# name: http
# - port: 8081
# targetPort: http-metric
# protocol: TCP
# name: http
# multiServices:
# enabled: false
#### Example ####
# port:
# - port: 8082
Expand Down