charts.Chart: Bitnami Secure Images Helm chart for NGINX Open Source
The Helm manifest defining the chart (identity, version, dependencies, and metadata)
1
2
3
4
5
6
7
8
9
10
annotations:
images: |
- name: git
image: docker.io/bitnami/git:2.51.0-debian-12-r0
- name: nginx
image: docker.io/bitnami/nginx:1.29.1-debian-12-r0
- name: nginx-exporter
image: docker.io/bitnami/nginx-exporter:1.4.2-debian-12-r9
licenses: Apache-2.0
tanzuCategory: clusterUtility
images: a list of container images used by this chartlicenses: declares the chart’s open-source license.tanzuCategory: a VMware Tanzu-specific tag grouping the chart (here: cluster utilities).
1
apiVersion: v2
1
appVersion: 1.29.1
1
2
3
4
5
6
dependencies:
- name: common
repository: oci://registry-1.docker.io/bitnamicharts
tags:
- bitnami-common
version: 2.x.x
Chart.yaml, description, home, icon, keywords are more for descriptive/categorical purposes.
1
helm template my-nginx oci://registry-1.docker.io/bitnamicharts/nginx
templates directory depends on how the application needs to be deployed.
1
2
3
4
5
6
7
8
apiVersion:
kind: Deployment
metadata:
name:
namespace:
labels:
annotations:
labels:: Standard YAML key, indicating that the following lines will define labels.-: tells the template engine to remove any extra white space (like blank lines or spaces) immediately before or after this command to keep the final output clean.include "common.labels.standard": fetches pre-defined text from another part (a “partial template”) of the Helm chart named “common.labels.standard”. This is a way to reuse the same set of labels across many different files. common chart is used.( dict "customLabels" .Values.commonLabels "context" $ ): Creates a new, specific package of data (a dictionary or map) for that template to use. This package contains two items: "customLabels" .Values.commonLabels: Creates a field named “customLabels” and fills it with values found in the main configuration under .Values.commonLabels (See values.yaml)."context" $: Creates a field named “context” and assigns it the value of $. In Helm, the dollar sign ($) is a special variable that always refers to the main, top-level set of all data in the chart (the “root context”). This ensures the included template can still access global information like the Chart name or Release name, even though we are primarily passing it a limited dictionary.| nindent 4: Is a “pipe” command that takes the output of the include function and applies an operation to it. nindent 4 function adds a new line before the included text and indents every single line of that text by 4 spaces.--values flag.values.yaml.values.yaml prior to deployment.Helm is already installed in CloudLab’s class profile. The installation script is located in install_helm.sh. This script needs to be run as root.
1
helm version
1
2
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
1
kubectl create namespace web
1
2
3
4
mkdir my-nginx
cd my-nginx
helm template my-nginx bitnami/nginx -n web > nginx-template.yaml
cat nginx-template.yaml
1
helm install my-nginx bitnami/nginx -n web
1
helm status my-nginx -n web
1
2
kubectl get pods -n web
kubectl get svc -n web
1
helm uninstall my-nginx -n web
my-nginx directory, create a file called my-values.yaml with the following content
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
image:
registry: docker.io
repository: nginx
tag: "1.25.5"
pullPolicy: IfNotPresent
containerPorts:
http: 80
service:
type: NodePort
ports:
http: 8080 # Service port inside cluster (arbitrary)
nodePorts:
http: 32080 # External NodePort (within default range)
containerSecurityContext:
enabled: true
runAsNonRoot: false
runAsUser: 0
1
helm template my-nginx bitnami/nginx -n web -f my-values.yaml > nginx-rendered.yaml
1
diff nginx-template.yaml nginx-rendered.yaml
1
helm install my-nginx bitnami/nginx -n web -f my-values.yaml
1
kubectl get svc my-nginx -n web