diff --git a/README.md b/README.md index 8a88836..5373369 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,26 @@ A collection of charts we use in our projects. - [Helm 3][helm-url] installed, please check the [official documentation][helm-docu-url]. +### pre-commit + +To use pre-commit ensure that all dependencies are installed locally. + +### helm-docs + +To install helm-docs follow-up steps in https://github.com/norwoodj/helm-docs#installation +Docs are generating documentation like README in each chart module. +To generate or regenerate it locally you can call (you can see also logs) + +```bash +helm-docs +``` + +or call (it will validate all files not just changes) + +```bash +pre-commit run --all-files +``` + ## Usage @@ -26,6 +46,41 @@ A collection of charts we use in our projects. helm repo add gh-strg https://strg-at.github.io/charts/ ``` +## Test template + +Go to module dir f.e. charts/agents-graphql-api + +```bash +helm dependency build +``` + +Test all templates for module + +```bash +helm template agents-graphql-api . +``` + +If you need to define some values you can do it with additional file, that will be set on top of values.yaml + +```bash +helm template agents-graphql-api . --values test-values.yaml +``` + +Example of test-values for agents-graphql-api + +```yaml +config: + app: + # -- The application port where it will be acessible + port: "0" + # -- host for graphql + host: "1" + + authService: + # -- base url for authentication service + baseUrl: "2" +``` + diff --git a/charts/agents-graphql-api/Chart.yaml b/charts/agents-graphql-api/Chart.yaml new file mode 100644 index 0000000..7f98635 --- /dev/null +++ b/charts/agents-graphql-api/Chart.yaml @@ -0,0 +1,20 @@ +apiVersion: v2 +type: application +appVersion: 1.0.0 +description: STRG.BeHave agents-graphql-api +name: agents-graphql-api +version: 0.1.0 +kubeVersion: ">=1.16.0-0" +keywords: + - agents + - graphql-api +home: https://github.com/strg-at/charts/tree/main/charts/agents-graphql-api +maintainers: + - name: Dominic Jurkic + email: dominic.jurkic@strg.at + - name: Dusan Scensny + email: dusan.scensny@smilingwords.eu +dependencies: + - name: common + repository: https://library-charts.k8s-at-home.com + version: 4.3.0 diff --git a/charts/agents-graphql-api/README.md b/charts/agents-graphql-api/README.md new file mode 100644 index 0000000..5d60269 --- /dev/null +++ b/charts/agents-graphql-api/README.md @@ -0,0 +1,49 @@ +# agents-graphql-api + +![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.0.0](https://img.shields.io/badge/AppVersion-1.0.0-informational?style=flat-square) + +STRG.BeHave agents-graphql-api + +**Homepage:** + +## Maintainers + +| Name | Email | Url | +| ---- | ------ | --- | +| Dominic Jurkic | | | +| Dusan Scensny | | | + +## Requirements + +Kubernetes: `>=1.16.0-0` + +| Repository | Name | Version | +|------------|------|---------| +| https://library-charts.k8s-at-home.com | common | 4.3.0 | + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| config.app.host | string | `""` | host for graphql | +| config.app.port | string | `""` | The application port where it will be acessible | +| config.authService.baseUrl | string | `""` | base url for authentication service | +| controller.replicas | int | `3` | Number of desired pods. We use 3 minimum to assure no outage durring rollout/preemtible node restarts | +| env.NODE_ENV | string | `"production"` | The default node environment | +| env.TZ | string | `"UTC"` | The timezone in the container | +| image.repository | string | `"eu.gcr.io/logical-sled-220910/strg-at/agents-graphql-api"` | image repository | +| image.tag | string | `""` | image tag | +| persistence.config.enabled | bool | `true` | | +| persistence.config.mountPath | string | `"/app/config.yaml"` | | +| persistence.config.name | string | `"agents-graphql-api-config"` | | +| persistence.config.type | string | `"configMap"` | | +| securityContext.allowPrivilegeEscalation | bool | `false` | do not allow privilege escalation for security reasons | +| securityContext.capabilities.drop[0] | string | `"ALL"` | drop all privileges as we dont need them | +| securityContext.readOnlyRootFilesystem | bool | `true` | set root fs to read only for security reasons | +| securityContext.runAsNonRoot | bool | `true` | do not run as root for security reasons | +| securityContext.runAsUser | int | `1000` | run as user with | +| service.main.ports.http.port | int | `3000` | | +| service.main.primary | bool | `true` | | + +---------------------------------------------- +Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0) diff --git a/charts/agents-graphql-api/templates/NOTES.txt b/charts/agents-graphql-api/templates/NOTES.txt new file mode 100644 index 0000000..90f7b65 --- /dev/null +++ b/charts/agents-graphql-api/templates/NOTES.txt @@ -0,0 +1 @@ +{{- include "common.notes.defaultNotes" . -}} diff --git a/charts/agents-graphql-api/templates/agents-graphql-api-config.yaml b/charts/agents-graphql-api/templates/agents-graphql-api-config.yaml new file mode 100644 index 0000000..610aba4 --- /dev/null +++ b/charts/agents-graphql-api/templates/agents-graphql-api-config.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.names.name" . }}-config + labels: + {{- include "common.labels" . | nindent 4 }} +data: + config.yaml: | + {{- with .Values.config }} + {{- toYaml . | nindent 4 }} + {{- end }} diff --git a/charts/agents-graphql-api/templates/common.yaml b/charts/agents-graphql-api/templates/common.yaml new file mode 100644 index 0000000..4557a56 --- /dev/null +++ b/charts/agents-graphql-api/templates/common.yaml @@ -0,0 +1,10 @@ +{{ include "common.all" . }} +{{- if eq .Values.config.app.port "" }} +{{- fail "value for .Values.config.app.port must be set" }} +{{- end }} +{{- if eq .Values.config.app.host "" }} +{{- fail "value for .Values.config.app.host must be set" }} +{{- end }} +{{- if eq .Values.config.app.baseUrl "" }} +{{- fail "value for .Values.config.app.baseUrl must be set" }} +{{- end }} diff --git a/charts/agents-graphql-api/values.yaml b/charts/agents-graphql-api/values.yaml new file mode 100644 index 0000000..75608c0 --- /dev/null +++ b/charts/agents-graphql-api/values.yaml @@ -0,0 +1,67 @@ +# Default values for agents-graphql-api. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. +# +# IMPORTANT NOTE +# +# This chart inherits from k8s-at-home common library chart. You can check the default values/options here: +# https://github.com/k8s-at-home/library-charts/tree/main/charts/stable/common/values.yaml +# + +controller: + # -- Number of desired pods. + # We use 3 minimum to assure no outage durring rollout/preemtible node restarts + replicas: 3 + +image: + # -- image repository + repository: "eu.gcr.io/logical-sled-220910/strg-at/agents-graphql-api" + # -- image tag + tag: "" + # -- image pull policy + # pullPolicy: IfNotPresent + +securityContext: + capabilities: + drop: + # -- drop all privileges as we dont need them + - ALL + # -- set root fs to read only for security reasons + readOnlyRootFilesystem: true + # -- do not allow privilege escalation for security reasons + allowPrivilegeEscalation: false + # -- do not run as root for security reasons + runAsNonRoot: true + # -- run as user with + runAsUser: 1000 + +env: + # -- The timezone in the container + TZ: UTC + # -- The default node environment + NODE_ENV: "production" + +config: + app: + # -- The application port where it will be acessible + port: "" + # -- host for graphql + host: "" + + authService: + # -- base url for authentication service + baseUrl: "" + +service: + main: + primary: true + ports: + http: + port: 3000 + +persistence: + config: + enabled: true + type: configMap + name: agents-graphql-api-config + mountPath: /app/config.yaml diff --git a/charts/agents-nuxt-service/Chart.yaml b/charts/agents-nuxt-service/Chart.yaml new file mode 100644 index 0000000..b1c9f18 --- /dev/null +++ b/charts/agents-nuxt-service/Chart.yaml @@ -0,0 +1,20 @@ +apiVersion: v2 +type: application +appVersion: 1.0.0 +description: STRG.BeHave agents-nuxt-service +name: agents-nuxt-service +version: 0.1.0 +kubeVersion: ">=1.16.0-0" +keywords: + - agents + - nuxt-service +home: https://github.com/strg-at/charts/tree/main/charts/agents-nuxt-service +maintainers: + - name: Dominic Jurkic + email: dominic.jurkic@strg.at + - name: Dusan Scensny + email: dusan.scensny@smilingwords.eu +dependencies: + - name: common + repository: https://library-charts.k8s-at-home.com + version: 4.3.0 diff --git a/charts/agents-nuxt-service/README.md b/charts/agents-nuxt-service/README.md new file mode 100644 index 0000000..97747d0 --- /dev/null +++ b/charts/agents-nuxt-service/README.md @@ -0,0 +1,47 @@ +# agents-nuxt-service + +![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.0.0](https://img.shields.io/badge/AppVersion-1.0.0-informational?style=flat-square) + +STRG.BeHave agents-nuxt-service + +**Homepage:** + +## Maintainers + +| Name | Email | Url | +| ---- | ------ | --- | +| Dominic Jurkic | | | +| Dusan Scensny | | | + +## Requirements + +Kubernetes: `>=1.16.0-0` + +| Repository | Name | Version | +|------------|------|---------| +| https://library-charts.k8s-at-home.com | common | 4.3.0 | + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| controller.replicas | int | `3` | Number of desired pods. We use 3 minimum to assure no outage durring rollout/preemtible node restarts | +| env.GRAPHQL_URL | string | `""` | | +| env.HOME_URI | string | `""` | | +| env.KEYCLOAK_CLIENT_ID | string | `""` | | +| env.KEYCLOAK_HOST | string | `""` | | +| env.NODE_ENV | string | `"production"` | The default node environment | +| env.PORT | string | `"3000"` | The application port | +| env.TZ | string | `"UTC"` | The timezone in the container | +| image.repository | string | `"eu.gcr.io/logical-sled-220910/strg-at/agents-nuxt-service"` | image repository | +| image.tag | string | `""` | image tag | +| securityContext.allowPrivilegeEscalation | bool | `false` | do not allow privilege escalation for security reasons | +| securityContext.capabilities.drop[0] | string | `"ALL"` | drop all privileges as we dont need them | +| securityContext.readOnlyRootFilesystem | bool | `true` | set root fs to read only for security reasons | +| securityContext.runAsNonRoot | bool | `true` | do not run as root for security reasons | +| securityContext.runAsUser | int | `1000` | run as user with | +| service.main.ports.http.port | int | `3000` | | +| service.main.primary | bool | `true` | | + +---------------------------------------------- +Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0) diff --git a/charts/agents-nuxt-service/templates/NOTES.txt b/charts/agents-nuxt-service/templates/NOTES.txt new file mode 100644 index 0000000..90f7b65 --- /dev/null +++ b/charts/agents-nuxt-service/templates/NOTES.txt @@ -0,0 +1 @@ +{{- include "common.notes.defaultNotes" . -}} diff --git a/charts/agents-nuxt-service/templates/common.yaml b/charts/agents-nuxt-service/templates/common.yaml new file mode 100644 index 0000000..ad6d978 --- /dev/null +++ b/charts/agents-nuxt-service/templates/common.yaml @@ -0,0 +1,13 @@ +{{ include "common.all" . }} +{{- if eq .Values.env.GRAPHQL_URL "" }} +{{- fail "value for .Values.env.GRAPHQL_URL must be set" }} +{{- end }} +{{- if eq .Values.env.KEYCLOAK_HOST "" }} +{{- fail "value for .Values.env.KEYCLOAK_HOST must be set" }} +{{- end }} +{{- if eq .Values.env.KEYCLOAK_CLIENT_ID "" }} +{{- fail "value for .Values.env.KEYCLOAK_CLIENT_ID must be set" }} +{{- end }} +{{- if eq .Values.env.HOME_URI "" }} +{{- fail "value for .Values.env.HOME_URI must be set" }} +{{- end }} diff --git a/charts/agents-nuxt-service/values.yaml b/charts/agents-nuxt-service/values.yaml new file mode 100644 index 0000000..9c97635 --- /dev/null +++ b/charts/agents-nuxt-service/values.yaml @@ -0,0 +1,60 @@ +# Default values for agents-nuxt-service. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. +# +# IMPORTANT NOTE +# +# This chart inherits from k8s-at-home common library chart. You can check the default values/options here: +# https://github.com/k8s-at-home/library-charts/tree/main/charts/stable/common/values.yaml +# + +controller: + # -- Number of desired pods. + # We use 3 minimum to assure no outage durring rollout/preemtible node restarts + replicas: 3 + +image: + # -- image repository + repository: "eu.gcr.io/logical-sled-220910/strg-at/agents-nuxt-service" + # -- image tag + tag: "" + # -- image pull policy + # pullPolicy: IfNotPresent + +securityContext: + capabilities: + drop: + # -- drop all privileges as we dont need them + - ALL + # -- set root fs to read only for security reasons + readOnlyRootFilesystem: true + # -- do not allow privilege escalation for security reasons + allowPrivilegeEscalation: false + # -- do not run as root for security reasons + runAsNonRoot: true + # -- run as user with + runAsUser: 1000 + +env: + # -- The timezone in the container + TZ: UTC + # -- The application port + PORT: "3000" + # -- The default node environment + NODE_ENV: "production" + # Url for connection to graphql + GRAPHQL_URL: "" + # Host for keycloak authentication + KEYCLOAK_HOST: "" + # Identifier for client + KEYCLOAK_CLIENT_ID: "" + # Home url for login page + HOME_URI: "" + + +service: + main: + primary: true + ports: + http: + port: 3000