mirror of
https://github.com/jpetazzo/container.training.git
synced 2026-07-25 07:46:27 +00:00
Use Replicated Ship to generate the base and overlays from the kubercoins GitHub repo. The namespaces chapter has been slightly tweaked so that we can use it for either Helm or Kustomize demo.
1.3 KiB
1.3 KiB
Creating a chart
-
We are going to show a way to create a very simplified chart
-
In a real chart, lots of things would be templatized
(Resource names, service types, number of replicas...)
.exercise[
-
Create a sample chart:
helm create dockercoins -
Move away the sample templates and create an empty template directory:
mv dockercoins/templates dockercoins/default-templates mkdir dockercoins/templates
]
Exporting the YAML for our application
- The following section assumes that DockerCoins is currently running
.exercise[
- Create one YAML file for each resource that we need:
.small[
]
while read kind name; do kubectl get -o yaml --export $kind $name > dockercoins/templates/$name-$kind.yaml done <<EOF deployment worker deployment hasher daemonset rng deployment webui deployment redis service hasher service rng service webui service redis EOF
]
Testing our helm chart
.exercise[
- Let's install our helm chart! (
dockercoinsis the path to the chart)helm install dockercoins
]
--
-
Since the application is already deployed, this will fail:
Error: release loitering-otter failed: services "hasher" already exists -
To avoid naming conflicts, we will deploy the application in another namespace