Skip to content

Commit

Permalink
hello
Browse files Browse the repository at this point in the history
  • Loading branch information
Rein-Vanbelleghem committed Apr 26, 2024
1 parent f621d21 commit 5db0e49
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 0 deletions.
4 changes: 4 additions & 0 deletions charts/hello/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v2
name: hello
description: A Helm chart for Kubernetes to deploy a simple Nginx server displaying "Hello World"
version: 0.1.0
1 change: 1 addition & 0 deletions charts/hello/site.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
imageUrl: "https://i.pinimg.com/originals/c4/a2/05/c4a2050a1cbbd8158e717f29185d9ab1.jpg"
16 changes: 16 additions & 0 deletions charts/hello/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
10 changes: 10 additions & 0 deletions charts/hello/templates/configmap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "hello-nginx.fullname" . }}-config
data:
index.html: |
<html>
<head><title>Hello World</title></head>
<body><h1>Hello World</h1></body>
</html>
28 changes: 28 additions & 0 deletions charts/hello/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "hello-nginx.fullname" . }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "hello-nginx.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "hello-nginx.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
containers:
- name: nginx
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
ports:
- containerPort: 80
volumeMounts:
- name: html
mountPath: /usr/share/nginx/html
volumes:
- name: html
configMap:
name: {{ include "hello-nginx.fullname" . }}-config
12 changes: 12 additions & 0 deletions charts/hello/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: { { include "hello-nginx.fullname" . } }
spec:
type: { { .Values.service.type } }
ports:
- port: { { .Values.service.port } }
targetPort: 80
selector:
app.kubernetes.io/name: { { include "hello-nginx.name" . } }
app.kubernetes.io/instance: { { .Release.Name } }
9 changes: 9 additions & 0 deletions charts/hello/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
replicaCount: 1
image:
repository: nginx
pullPolicy: IfNotPresent
tag: stable

service:
type: LoadBalancer
port: 80

0 comments on commit 5db0e49

Please sign in to comment.