Files
container.training/slides/k8s/create-chart.md
Jerome Petazzoni c367ad1156 Show quick demo of Kustomize
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.
2019-04-22 05:18:45 -05:00

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! (dockercoins is 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