Skip to content

Commit

Permalink
Feature/agents 522 agents nuxt graphql charts (#11)
Browse files Browse the repository at this point in the history
* new(agents): Add nuxt and graphql charts, AGENTS-686

Changes inside:
notes to nuxt and graphql
nuxt-service: 
set default values and checks
check for keycloak 
graphql-api: 
use proper config and validation for graphql
change config metadata

docs: update how to test charts, AGENTS-686

Co-authored-by: Dominic Jurkic <[email protected]>
  • Loading branch information
dusanscensny and djurkic1 authored Oct 12, 2022
1 parent d758870 commit 953023d
Show file tree
Hide file tree
Showing 12 changed files with 354 additions and 0 deletions.
55 changes: 55 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 EXAMPLES -->

## Usage
Expand All @@ -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"
```
<!-- MARKDOWN LINKS & IMAGES -->
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
Expand Down
20 changes: 20 additions & 0 deletions charts/agents-graphql-api/Chart.yaml
Original file line number Diff line number Diff line change
@@ -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: [email protected]
- name: Dusan Scensny
email: [email protected]
dependencies:
- name: common
repository: https://library-charts.k8s-at-home.com
version: 4.3.0
49 changes: 49 additions & 0 deletions charts/agents-graphql-api/README.md
Original file line number Diff line number Diff line change
@@ -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:** <https://github.com/strg-at/charts/tree/main/charts/agents-graphql-api>

## Maintainers

| Name | Email | Url |
| ---- | ------ | --- |
| Dominic Jurkic | <[email protected]> | |
| Dusan Scensny | <[email protected]> | |

## 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 <id> |
| 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)
1 change: 1 addition & 0 deletions charts/agents-graphql-api/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{- include "common.notes.defaultNotes" . -}}
11 changes: 11 additions & 0 deletions charts/agents-graphql-api/templates/agents-graphql-api-config.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
10 changes: 10 additions & 0 deletions charts/agents-graphql-api/templates/common.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
67 changes: 67 additions & 0 deletions charts/agents-graphql-api/values.yaml
Original file line number Diff line number Diff line change
@@ -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 <id>
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
20 changes: 20 additions & 0 deletions charts/agents-nuxt-service/Chart.yaml
Original file line number Diff line number Diff line change
@@ -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: [email protected]
- name: Dusan Scensny
email: [email protected]
dependencies:
- name: common
repository: https://library-charts.k8s-at-home.com
version: 4.3.0
47 changes: 47 additions & 0 deletions charts/agents-nuxt-service/README.md
Original file line number Diff line number Diff line change
@@ -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:** <https://github.com/strg-at/charts/tree/main/charts/agents-nuxt-service>

## Maintainers

| Name | Email | Url |
| ---- | ------ | --- |
| Dominic Jurkic | <[email protected]> | |
| Dusan Scensny | <[email protected]> | |

## 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 <id> |
| 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)
1 change: 1 addition & 0 deletions charts/agents-nuxt-service/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{- include "common.notes.defaultNotes" . -}}
13 changes: 13 additions & 0 deletions charts/agents-nuxt-service/templates/common.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
60 changes: 60 additions & 0 deletions charts/agents-nuxt-service/values.yaml
Original file line number Diff line number Diff line change
@@ -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 <id>
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

0 comments on commit 953023d

Please sign in to comment.