Helm Components
Helm Components
-
We have the
helm cli.- Used for
helmactions.
- Used for
-
Adds charts and installs the objects listed in the charts.
-
A
Releaseis created - a single application instance coming from ahelmchart.-
Within each
Release, you can have multipleRevision. -
After an upgrade or change of replicas etc is made, a new
Revisionis created.
-
-
Can find
helmcharts in a public repository. -
Helm needs a place to store
metadata–> data about data.-
Helmstores themetadatain the Kubernetes cluster as aSecret.- This way the data survives and the cluster survives. Everyone in the team can access it.
-
-
Chartsare a collection of files.- By using
Chartsto install the objects is done.
- By using
-
Nginx web server and service to expose it - good Hello World example.
- In the Nginx example there are two objects –>
service.yamlanddeployment.yaml.
- In the Nginx example there are two objects –>
service.yaml:
apiVersion: v1
kind: Service
metadata:
name: hello-world
spec:
type: NodePort
ports:
- port: 80
targetPort: http
protocol: TCP
name: http
selector:
app: hello-world
deployment.yaml:
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello-world
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: hello-world
template:
metadata:
labels:
app: hello-world
spec:
containers:
- name: nginx
image: "{{ .Values.image.repository }}"
ports:
- name: http
containerPort: 80
protocol: TCP
There is a values.yaml file:
replicaCount: 1
image:
repository: nginx
-
The
imageandreplicasabove are specified in a different form. This is calledtemplating. -
No need to build charts ourselves.
- What is a good idea however if configuring values in the downloaded chart.
-
The
values.yamlfile is where the configurable values are stored. -
Another good
helm installcommand example:helm install my-site bitnami/wordpress -
The syntax is
helm install [release-name][chart-name] -
Why have a
releasename?-
This allows us to install multiple releases, based on the same chart.
-
Can have another site –>
helm install my-SECOND-site bitnami/wordpress- Therefore you can have two separate sites that are different entities.
-
-
A good example is a release of a customer-facing website and the other version which is internal and only visible by the developers.
- Since the two releases are on the same chart, they can transfer any changes over to the customer-facing application and it looks good.
-
-
What if we want to deploy a new chart? Good
helmchart repositories:- Appscode
- TrueCharts
- Bitnami
-
Community Operators
-
All of the above repositories have listed their charts in a single repository –> ArtifactHub.io.
-
The
Officialstamped charts are the best ones to use.
-