https://github.com/denimar/helm-library-basic-chart-api
helm-library-basic-chart-api
https://github.com/denimar/helm-library-basic-chart-api
Last synced: 7 months ago
JSON representation
helm-library-basic-chart-api
- Host: GitHub
- URL: https://github.com/denimar/helm-library-basic-chart-api
- Owner: denimar
- Created: 2021-09-05T14:46:00.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-09-05T22:14:39.000Z (almost 5 years ago)
- Last Synced: 2025-04-02T18:52:06.342Z (over 1 year ago)
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Simple guide.
This chart is intentionally kept simple to support a web api.
optionally you can specify a `healthCheckPort` which then looks for liveness and readiness probes configured at `/health/live` and `/health/ready`. Rest of the values are explanatory.
### Configuration per environment
- Look at `env` folder.
- create a yaml file such as `config.{env}.yaml`.
### secrets
- secrets are injected as config map
- store them in `env` folder with name such as `secrets.{env}.yaml`
- you will need to use helm secrets to edit encrypted secrets.
### installing the charts
```
helm secrets install bg helm/ --set env=dev --values helm/env/secrets.dev.yaml
```
### Using this chart - help.
1. create a basic helm chart: `helm create `
2. Delete all files under "templates".
3. Create a single file with the following contents. This will import the needed pieces
```
{{ include "basicapi.configmap" .}}
---
{{ include "basicapi.deployment" .}}
---
```
4. Go to Chart.yaml and add the following åt the end.
```
dependencies:
- name : basicapi
version:
repository:
```
Then update using `helm dependency update `.
5. Create a values.yaml, env/config.dev.yaml, env/secrets.dev.yaml
```
#values.yaml
env: dev
labels:
system: oxygen
jobKind: background
replicas: 1
container:
image: krishna/background
tag: latest
#healthCheckPort: 3000
httpPort: 80
resources:
limits:
cpu: 300m
memory: 256Mi
requests:
cpu: 300m
memory: 256Mi
migrations:
image: #if not set, uses the container image itself
command:
args:
ingressHostName: dev-hydrogen-api.shopolive.team
configMapFile: # when specified, this will replace config..yaml. Note that config is still looked for within the env directory.
secretsFile: # when specified, this will replace secrets..yaml. Note that config is still looked for within the env directory.
```
6. You may want to configure `.sops.yaml` for handling secrets. And encrypt using `helm secrets enc helm-chart/env/secrets.dev.yaml`
7. Additional commands that are helpful.
```
helm template chartname/ --debug
helm secrets install bg chartname/ --set env=dev --values deploy/env/secrets.dev.yaml
heml uninstall bg
```
8. Note that this this will automatically enable TLS using LetsEncrypt.
## More changes.
1. Added support for specifying annotations on deployments. For example:
```
#values.yaml
annotations:
dapr.io/enabled: "true"
dapr.io/app-id: "hello"
dapr.io/app-port: "3000"
dapr.io/log-as-json: "true"
```
2. Added support to specify additional ports when creating a service using `morePorts`. Note that the default port will be named as default unless specified in `httpPortName`. For example:
```
httpPort: 3500
morePorts:
- port: 9090
name: metrics
```
3. Updates to the ingress configurations.
- You can override the ingress class through values by setting `ingressClass` value.
- You can configure additional ingresses using the `moreHttpIngresses` array. Each element in the array shall have `ingressHostName`, `ingressPath`, `ingressServiceName`, `ingressServicePort`. For example:
```
moreHttpIngresses:
- ingressHostName: rhone.shopolive.com
ingressPath: / #defaults to / as well.
ingressServiceName: hydrogen-deliveries-service
ingressServicePort: 8080
- ingressHostName: nike.shopolive.com
ingressPath: / #defaults to / as well.
ingressServiceName: hydrogen-deliveries-service
ingressServicePort: 8080
```
- Note that this particular functionality has not been tested.