Onechart docs spike
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
OneChart settings for deploying a cron job:
|
||||
|
||||
```yaml
|
||||
image:
|
||||
repository: debian
|
||||
tag: stable-slim
|
||||
|
||||
schedule: "0 1 0 0 0"
|
||||
command: |
|
||||
echo "hello"
|
||||
```
|
||||
|
||||
Check the Kubernetes manifest:
|
||||
|
||||
```bash
|
||||
cat << EOF > values.yaml
|
||||
image:
|
||||
repository: debian
|
||||
tag: stable-slim
|
||||
|
||||
schedule: "0 1 0 0 0"
|
||||
command: |
|
||||
echo "hello"
|
||||
EOF
|
||||
|
||||
helm template my-release onechart/cron-job -f values.yaml
|
||||
```
|
||||
|
||||
!!! warning
|
||||
Make sure to use the `onechart/cron-job` chart.
|
||||
@@ -0,0 +1,25 @@
|
||||
OneChart settings for overriding the default command to run:
|
||||
|
||||
```yaml
|
||||
image:
|
||||
repository: debian
|
||||
tag: stable-slim
|
||||
|
||||
command: |
|
||||
while true; date; sleep 2; done
|
||||
```
|
||||
|
||||
Check the Kubernetes manifest:
|
||||
|
||||
```bash
|
||||
cat << EOF > values.yaml
|
||||
image:
|
||||
repository: debian
|
||||
tag: stable-slim
|
||||
|
||||
command: |
|
||||
echo "hello"
|
||||
EOF
|
||||
|
||||
helm template my-release onechart/onechart -f values.yaml
|
||||
```
|
||||
@@ -0,0 +1,30 @@
|
||||
OneChart settings for deploying `my-web-app` image from Amazon ECR:
|
||||
|
||||
```yaml
|
||||
image:
|
||||
repository: aws_account_id.dkr.ecr.region.amazonaws.com/my-web-app
|
||||
tag: x.y.z
|
||||
|
||||
imagePullSecrets:
|
||||
- name: regcred
|
||||
```
|
||||
|
||||
Check the Kubernetes manifest:
|
||||
|
||||
```bash
|
||||
cat << EOF > values.yaml
|
||||
image:
|
||||
repository: aws_account_id.dkr.ecr.region.amazonaws.com/my-web-app
|
||||
tag: x.y.z
|
||||
|
||||
imagePullSecrets:
|
||||
- name: regcred
|
||||
EOF
|
||||
|
||||
helm template my-release onechart/onechart -f values.yaml
|
||||
```
|
||||
|
||||
!!! warning
|
||||
The `regcred` image pull credentials must be set up in the cluster.
|
||||
|
||||
See how: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
|
||||
@@ -0,0 +1,19 @@
|
||||
OneChart settings for deploying the Nginx image:
|
||||
|
||||
```yaml
|
||||
image:
|
||||
repository: nginx
|
||||
tag: 1.19.3
|
||||
```
|
||||
|
||||
Check the Kubernetes manifest:
|
||||
|
||||
```bash
|
||||
cat << EOF > values.yaml
|
||||
image:
|
||||
repository: nginx
|
||||
tag: 1.19.3
|
||||
EOF
|
||||
|
||||
helm template my-release onechart/onechart -f values.yaml
|
||||
```
|
||||
@@ -0,0 +1,32 @@
|
||||
OneChart generates an `Ingress` resource for the Nginx ingress controller with the following settings:
|
||||
|
||||
```yaml
|
||||
image:
|
||||
repository: nginx
|
||||
tag: 1.19.3
|
||||
|
||||
ingress:
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: nginx
|
||||
host: chart-example.local
|
||||
```
|
||||
|
||||
Check the Kubernetes manifest:
|
||||
|
||||
```bash
|
||||
cat << EOF > values.yaml
|
||||
image:
|
||||
repository: nginx
|
||||
tag: 1.19.3
|
||||
|
||||
ingress:
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: nginx
|
||||
host: chart-example.local
|
||||
EOF
|
||||
|
||||
helm template my-release onechart/onechart -f values.yaml
|
||||
```
|
||||
|
||||
!!! warning
|
||||
The Nginx ingress controller must be set up in your cluster for this setting to work.
|
||||
@@ -0,0 +1,31 @@
|
||||
OneChart settings for setting environment variables:
|
||||
|
||||
```yaml
|
||||
image:
|
||||
repository: nginx
|
||||
tag: 1.19.3
|
||||
|
||||
vars:
|
||||
VAR_1: "value 1"
|
||||
VAR_2: "value 2"
|
||||
```
|
||||
|
||||
Check the Kubernetes manifest:
|
||||
|
||||
```bash
|
||||
cat << EOF > values.yaml
|
||||
image:
|
||||
repository: nginx
|
||||
tag: 1.19.3
|
||||
|
||||
|
||||
EOF
|
||||
|
||||
helm template my-release onechart/onechart -f values.yaml
|
||||
```
|
||||
|
||||
!!! note
|
||||
|
||||
OneChart creates a `ConfigMap` with all the defined environment variables.
|
||||
|
||||
Then includes all entries with the `EnvFrom` field in the deployment.
|
||||
@@ -0,0 +1,31 @@
|
||||
OneChart can reference an existing secret:
|
||||
|
||||
```yaml
|
||||
image:
|
||||
repository: nginx
|
||||
tag: 1.19.3
|
||||
|
||||
secret:
|
||||
enabled: true
|
||||
```
|
||||
|
||||
Check the Kubernetes manifest:
|
||||
|
||||
```bash
|
||||
cat << EOF > values.yaml
|
||||
image:
|
||||
repository: nginx
|
||||
tag: 1.19.3
|
||||
|
||||
secret:
|
||||
enabled: true
|
||||
EOF
|
||||
|
||||
helm template my-release onechart/onechart -f values.yaml
|
||||
```
|
||||
|
||||
!!! note
|
||||
|
||||
OneChart references an existing Kubernetes `Secret` and includes all entries in the deployment with the `EnvFrom` field.
|
||||
|
||||
The secret name must match the release name. `my-release` in the above example.
|
||||
@@ -0,0 +1,46 @@
|
||||
OneChart settings for setting environment variables:
|
||||
|
||||
```yaml
|
||||
image:
|
||||
repository: nginx
|
||||
tag: 1.19.3
|
||||
|
||||
volumes:
|
||||
- name: data
|
||||
path: /var/lib/1clickinfra/data
|
||||
size: 10Gi
|
||||
storageClass: default
|
||||
```
|
||||
|
||||
Check the Kubernetes manifest:
|
||||
|
||||
```bash
|
||||
cat << EOF > values.yaml
|
||||
image:
|
||||
repository: nginx
|
||||
tag: 1.19.3
|
||||
|
||||
volumes:
|
||||
- name: data
|
||||
path: /var/lib/1clickinfra/data
|
||||
size: 10Gi
|
||||
storageClass: default
|
||||
EOF
|
||||
|
||||
helm template my-release onechart/onechart -f values.yaml
|
||||
```
|
||||
|
||||
!!! warning
|
||||
|
||||
OneChart generates a `PeristentVolumeClaim` with this configuration and mounts it to the given path.
|
||||
|
||||
You have to know what `storageClass` is supported in your cluster.
|
||||
|
||||
- On Google Cloud, `standard` gets you disk
|
||||
- On Azure, `default` gets you a normal block storage
|
||||
- Amazon EKS, `TODO`
|
||||
- Use `do-block-storage` for Digital Ocean
|
||||
|
||||
### Mount an Azure file storage
|
||||
|
||||
TODO
|
||||
@@ -0,0 +1,24 @@
|
||||
|
||||
Add the OneChart Helm repository:
|
||||
|
||||
```bash
|
||||
helm repo add onechart https://chart.onechart.dev
|
||||
```
|
||||
|
||||
Check the generated Kubernetes yaml:
|
||||
|
||||
```bash
|
||||
helm template my-release onechart/onechart \
|
||||
--set image.repository=nginx \
|
||||
--set image.tag=1.19.3
|
||||
```
|
||||
|
||||
Deploy with Helm:
|
||||
|
||||
```bash
|
||||
helm install my-release onechart/onechart \
|
||||
--set image.repository=nginx \
|
||||
--set image.tag=1.19.3
|
||||
```
|
||||
|
||||
See all [Examples](/examples/deploying-an-image)
|
||||
@@ -0,0 +1,4 @@
|
||||
---
|
||||
template: home.html
|
||||
title: Material for MkDocs
|
||||
---
|
||||
Reference in New Issue
Block a user