Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature-2: Made chart more configurable #3

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ maintainers:

type: application

version: 0.3.0
version: 0.4.0

appVersion: "latest"

Expand Down
6 changes: 2 additions & 4 deletions templates/k8s_configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@ kind: ConfigMap
metadata:
name: olivetin-config
data:
config.yaml: |
actions:
- title: "Hello world!"
shell: echo 'Hello World!'
config.yaml: |-
{{ .Values.config | indent 4 }}
19 changes: 9 additions & 10 deletions templates/k8s_deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,37 +1,36 @@
apiVersion: apps/v1
kind: Deployment
metadata:
metadata:
name: olivetin
spec:
spec:
replicas: 1
selector:
selector:
matchLabels:
app: olivetin
template:
metadata:
labels:
app: olivetin
spec:
containers:
containers:
- name: olivetin
image: docker.io/jamesread/olivetin:latest
ports:
- containerPort: 1337
- containerPort: {{ .Values.ingress.servicePort }}
volumeMounts:
- name: olivetin-config
mountPath: "/config"
readOnly: true

livenessProbe:
exec:
command:
- curl
- localhost:1337
command:
- curl
- localhost:{{ .Values.ingress.servicePort }}
initialDelaySeconds: 5
periodSeconds: 30

volumes:
- name: olivetin-config
configMap:
configMap:
name: olivetin-config

23 changes: 18 additions & 5 deletions templates/k8s_ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
{{- if .Values.ingress.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
metadata:
name: olivetin-ingress
spec:
defaultBackend:
service:
defaultBackend:
service:
name: olivetin
port:
number: 1337
number: {{ .Values.ingress.servicePort }}
{{- if .Values.ingress.className }}
ingressClassName: {{ .Values.ingress.className }}
{{- end }}
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ tpl . $ | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
- host: {{ .Values.ingress.host }}
http:
Expand All @@ -19,5 +32,5 @@ spec:
service:
name: olivetin
port:
number: 1337
number: {{ .Values.ingress.servicePort }}
{{- end }}
4 changes: 2 additions & 2 deletions templates/k8s_service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ metadata:
name: olivetin
spec:
ports:
- port: 1337
- port: {{ .Values.ingress.servicePort }}
protocol: TCP
targetPort: 1337
targetPort: {{ .Values.ingress.servicePort }}
selector:
app: olivetin
type: ClusterIP
12 changes: 9 additions & 3 deletions values.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
---
config: |-
actions:
- title: "Hello world!"
shell: echo 'Hello World!'

containerVersion: latest

ingress:
enabled: true
host: olivetin.example.com
servicePort: 1337

persisentVolume: true

containerVersion: latest
persistentVolume: true