Skip to content

Commit

Permalink
feat(k8s): Add chart
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejsika committed Apr 12, 2024
1 parent 3bbbb59 commit e50fd38
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 0 deletions.
5 changes: 5 additions & 0 deletions chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v2
name: cro-php
description: An example PHP app for Rozhlas
type: application
version: 0.0.0
1 change: 1 addition & 0 deletions chart/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
See: https://{{ .Values.host }}
22 changes: 22 additions & 0 deletions chart/templates/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name}}
spec:
revisionHistoryLimit: 0
replicas: {{ .Values.replicas }}
selector:
matchLabels:
app: {{ .Release.Name}}
template:
metadata:
labels:
app: {{ .Release.Name}}
spec:
containers:
- name: php
image: {{ .Values.phpImage }}
- name: nginx
image: {{ .Values.nginxImage }}
ports:
- containerPort: 80
23 changes: 23 additions & 0 deletions chart/templates/ing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ .Release.Name}}
annotations:
cert-manager.io/cluster-issuer: letsencrypt
spec:
ingressClassName: nginx
tls:
- hosts:
- {{ .Values.host }}
secretName: {{ .Values.host }}-tls
rules:
- host: {{ required ".Values.host is required" .Values.host }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ .Release.Name}}
port:
number: 80
9 changes: 9 additions & 0 deletions chart/templates/svc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name}}
spec:
selector:
app: {{ .Release.Name}}
ports:
- port: 80
7 changes: 7 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Required
host:

# Optional
replicas: 2
phpImage: ghcr.io/sika-training-examples/cro-php-example:php
nginxImage: ghcr.io/sika-training-examples/cro-php-example:nginx

0 comments on commit e50fd38

Please sign in to comment.