Skip to content
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 Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM nginx:latest
FROM nginx:1.23

COPY public /usr/share/nginx/html
23 changes: 23 additions & 0 deletions charts/pez-sh/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
24 changes: 24 additions & 0 deletions charts/pez-sh/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v2
name: pez-sh
description: A Helm chart for Kubernetes

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.0.1"
47 changes: 47 additions & 0 deletions charts/pez-sh/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Chart.Name }}
spec:
selector:
matchLabels:
app: {{ .Chart.Name }}
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
app: {{ .Chart.Name }}
spec:
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
livenessProbe:
tcpSocket:
port: {{ .Values.service.port }}
initialDelaySeconds: 5
timeoutSeconds: 5
successThreshold: 1
failureThreshold: 3
periodSeconds: 10
readinessProbe:
httpGet:
path: /
port: {{ .Values.service.port }}
initialDelaySeconds: 5
timeoutSeconds: 2
successThreshold: 1
failureThreshold: 3
periodSeconds: 10
ports:
- containerPort: {{ .Values.service.port }}
name: http
restartPolicy: Always
12 changes: 12 additions & 0 deletions charts/pez-sh/templates/hpa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: {{ .Chart.Name }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ .Chart.Name }}
minReplicas: {{ .Values.autoscaling.minReplicas }}
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
targetCPUUtilizationPercentage: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
27 changes: 27 additions & 0 deletions charts/pez-sh/templates/rollout.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
name: {{ .Chart.Name }}
spec:
selector:
matchLabels:
app: {{ .Chart.Name }}
workloadRef:
apiVersion: apps/v1
kind: Deployment
name: {{ .Chart.Name }}
replicas: {{ .Values.rollouts.replicas }}
strategy:
canary:
{{- with .Values.rollouts.steps }}
steps:
{{- toYaml . | nindent 6 }}
{{- end }}
canaryService: {{ .Values.rollouts.canaryService }}
stableService: {{ .Values.rollouts.stableService }}
trafficRouting:
istio:
virtualServices:
- name: {{ .Chart.Name }}
routes:
- {{ .Chart.Name }}
13 changes: 13 additions & 0 deletions charts/pez-sh/templates/service-canary.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Values.rollouts.canaryService }}
spec:
ports:
- name: {{ .Values.rollouts.canaryService }}
port: {{ .Values.service.port }}
protocol: TCP
targetPort: {{ .Values.service.port }}
selector:
app: {{ .Chart.Name }}
type: ClusterIP
13 changes: 13 additions & 0 deletions charts/pez-sh/templates/service-stable.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Values.rollouts.stableService }}
spec:
ports:
- name: {{ .Values.rollouts.stableService }}
port: {{ .Values.service.port }}
protocol: TCP
targetPort: {{ .Values.service.port }}
selector:
app: {{ .Chart.Name }}
type: ClusterIP
23 changes: 23 additions & 0 deletions charts/pez-sh/templates/virtualservice.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
name: {{ .Chart.Name }}
spec:
{{- with .Values.virtualService.hosts }}
hosts:
{{- toYaml . | nindent 2 }}
{{- end }}
{{- with .Values.virtualService.gateways }}
gateways:
{{- toYaml . | nindent 2 }}
{{- end }}
http:
- name: {{ .Chart.Name }}
route:
- destination:
host: {{ .Values.rollouts.stableService }}
weight: 100
- destination:
host: {{ .Values.rollouts.canaryService }}
weight: 0

53 changes: 53 additions & 0 deletions charts/pez-sh/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
image:
repository: rwejlgaard/pez.sh
pullPolicy: IfNotPresent
tag: ""

service:
port: 80

deploymentLabels: {}

podAnnotations: {}
labels:
autoscaling:
enabled: true
minReplicas: 1
maxReplicas: 100
targetCPUUtilizationPercentage: 80

resources:
requests:
cpu: 50m
memory: 20Mi
limits:
cpu: 100m
memory: 100Mi

rollouts:
replicas: 1
canaryService: pez-sh-canary
stableService: pez-sh-stable
steps:
- setWeight: 10
- pause:
duration: "5m"
- setWeight: 20
- pause:
duration: "5m"
- setWeight: 40
- pause:
duration: "5m"
- setWeight: 50
- pause:
duration: "5m"

virtualService:
hosts:
- pez-sh.london.pez.sh
- pez-sh.paris.pez.sh
- pez-sh.copenhagen.pez.sh
gateways:
- istio-system/london-pez-sh
- istio-system/paris-pez-sh
- istio-system/copenhagen-pez-sh