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

Dev #3

Open
wants to merge 120 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
3931f07
added depploy code for vote and redis
johnkk84 Feb 1, 2022
408fe30
Added README.md for deploy
johnkk84 Feb 1, 2022
5ef15b5
Update README.md
johnkk84 Feb 1, 2022
f0168b5
added a new label to vote app
johnkk84 Feb 1, 2022
6b79f27
Merge pull request #1 from johnkk84/featureA
johnkk84 Feb 1, 2022
7e5d245
updated README.md
johnkk84 Feb 1, 2022
92b1fc8
updated README.md
johnkk84 Feb 1, 2022
ca3bebe
testing feature branch protection
johnkk84 Feb 1, 2022
479476e
Merge pull request #2 from johnkk84/feature
johnkk84 Feb 1, 2022
0816207
Increased number of replicas
johnkk84 Feb 2, 2022
1f37180
Merge pull request #3 from johnkk84/dev
johnkk84 Feb 2, 2022
892c19e
Changed app version from v1 to v2
johnkk84 Feb 2, 2022
8253311
Merge pull request #4 from johnkk84/dev
johnkk84 Feb 2, 2022
6ada37b
Added not exist image
johnkk84 Feb 2, 2022
9622637
Merge pull request #5 from johnkk84/dev
johnkk84 Feb 2, 2022
43e2b80
image version set to v3
johnkk84 Feb 2, 2022
ae73dd5
Merge pull request #6 from johnkk84/dev
johnkk84 Feb 2, 2022
871e098
delete service for vault
johnkk84 Feb 2, 2022
7122b8c
Merge pull request #7 from johnkk84/dev
marcink84 Feb 2, 2022
8aaf82a
revert service for vote app
johnkk84 Feb 2, 2022
b87c777
Merge pull request #8 from johnkk84/dev
marcink84 Feb 2, 2022
8106c58
Added annotation for not delete deployment and service frontend vote app
johnkk84 Feb 2, 2022
23cc628
Merge pull request #9 from johnkk84/dev
johnkk84 Feb 2, 2022
b84d48d
Service has removed for vote however shouldn't be removed during reco…
johnkk84 Feb 2, 2022
fec6245
Merge pull request #10 from johnkk84/dev
marcink84 Feb 2, 2022
175846d
Revert service for vote app
johnkk84 Feb 2, 2022
d3f651e
Merge pull request #11 from johnkk84/dev
marcink84 Feb 2, 2022
c218b2b
Added kustomization overlays
johnkk84 Feb 2, 2022
d5e3dcb
Merge pull request #12 from johnkk84/dev
marcink84 Feb 2, 2022
7f62614
fix issue with subelements
johnkk84 Feb 2, 2022
1099460
Merge pull request #13 from johnkk84/dev
marcink84 Feb 2, 2022
c290a0e
fix typos
johnkk84 Feb 2, 2022
797d584
Merge pull request #14 from johnkk84/dev
marcink84 Feb 2, 2022
85e11ea
adding staging overlays for kustomize
johnkk84 Feb 2, 2022
7a9902e
Merge pull request #15 from johnkk84/dev
marcink84 Feb 2, 2022
e375dd0
adding staging overlays for kustomize
johnkk84 Feb 2, 2022
86c66f5
Merge pull request #16 from johnkk84/dev
marcink84 Feb 2, 2022
f43b32b
Added services to kustomize
johnkk84 Feb 2, 2022
3da4bbe
Merge pull request #17 from johnkk84/dev
marcink84 Feb 2, 2022
9f1d15c
Staging vote switch back to nodeport
johnkk84 Feb 2, 2022
f0f0955
Merge pull request #18 from johnkk84/dev
johnkk84 Feb 2, 2022
f350aa7
reorganize redis to support customiza overlay
johnkk84 Feb 2, 2022
780c510
Merge pull request #19 from johnkk84/dev
marcink84 Feb 2, 2022
c127f01
Added additional customization
johnkk84 Feb 2, 2022
744afea
Merge pull request #20 from johnkk84/dev
marcink84 Feb 2, 2022
cef49f5
Added additional customization
johnkk84 Feb 2, 2022
945aa21
Merge pull request #21 from johnkk84/dev
marcink84 Feb 2, 2022
059389b
Testing rollout
johnkk84 Feb 2, 2022
f2c1b20
Merge pull request #22 from johnkk84/dev
marcink84 Feb 2, 2022
53b8d6e
Testing rollout - attempt2
johnkk84 Feb 2, 2022
d060f1a
Merge pull request #23 from johnkk84/dev
marcink84 Feb 2, 2022
e095671
Added worker to woting app
johnkk84 Feb 3, 2022
b67196f
Merge pull request #24 from johnkk84/dev
marcink84 Feb 3, 2022
73e5be4
Added result app
johnkk84 Feb 3, 2022
eb7c26e
Merge pull request #25 from johnkk84/dev
marcink84 Feb 3, 2022
cbea555
Fixed port number
johnkk84 Feb 3, 2022
a3e3287
Fixed port number
johnkk84 Feb 3, 2022
beb42d9
Merge pull request #26 from johnkk84/dev
marcink84 Feb 3, 2022
806cd18
Fixed port number - modified helmchart
johnkk84 Feb 3, 2022
8bf4570
Merge pull request #27 from johnkk84/dev
marcink84 Feb 3, 2022
e1d7f07
Fixed port number - modified helmchart
johnkk84 Feb 3, 2022
739d05f
Merge pull request #28 from johnkk84/dev
marcink84 Feb 3, 2022
772410a
Changed image voteapp to v5
johnkk84 Feb 5, 2022
79e102f
Merge pull request #29 from johnkk84/dev
marcink84 Feb 5, 2022
e51fa6e
Changes for voteapp image
johnkk84 Feb 5, 2022
c3247cd
Merge pull request #30 from johnkk84/dev
marcink84 Feb 5, 2022
78502ec
Update kustomization.yaml
johnkk84 Feb 5, 2022
83ec487
Merge pull request #32 from johnkk84/dev
johnkk84 Feb 5, 2022
0147f61
Update kustomization.yaml
johnkk84 Feb 5, 2022
baa263a
Update kustomization.yaml
johnkk84 Feb 5, 2022
e1e9970
Update service.yaml
johnkk84 Feb 5, 2022
532938d
Create service.yaml
johnkk84 Feb 5, 2022
e9e3dec
Update service.yaml
johnkk84 Feb 5, 2022
80f9e40
Update kustomization.yaml
johnkk84 Feb 5, 2022
4f89bf8
lets brake something
johnkk84 Feb 5, 2022
8ce993b
changed vote app version
johnkk84 Feb 6, 2022
ec3c9ac
Let's screw up something
johnkk84 Feb 6, 2022
38b71df
Let's fix up
johnkk84 Feb 6, 2022
37a0192
Let's screw up something
johnkk84 Feb 6, 2022
634a0ff
Change voteapp version to v5
johnkk84 Feb 6, 2022
ef2f86c
Change image version to 6 - vote app
johnkk84 Feb 6, 2022
78c07a6
Merge pull request #33 from johnkk84/dev
johnkk84 Feb 6, 2022
1476770
Changed support mail for vote app
johnkk84 Feb 6, 2022
d030357
Merge pull request #34 from johnkk84/dev
marcink84 Feb 6, 2022
8f246d2
Changed image version
johnkk84 Feb 6, 2022
cbb82c7
Merge pull request #35 from johnkk84/dev
marcink84 Feb 6, 2022
111379e
Changed image version
johnkk84 Feb 6, 2022
5b720e9
Merge pull request #36 from johnkk84/dev
marcink84 Feb 6, 2022
289d014
Changed image version
johnkk84 Feb 6, 2022
5034d97
Merge pull request #37 from johnkk84/dev
johnkk84 Feb 6, 2022
45bb308
Changed image version
johnkk84 Feb 6, 2022
9e25ed8
Merge pull request #38 from johnkk84/dev
johnkk84 Feb 6, 2022
1a322b4
destroy customization
johnkk84 Feb 6, 2022
bd1dc58
Merge pull request #39 from johnkk84/dev
johnkk84 Feb 6, 2022
96705f3
fix customization
johnkk84 Feb 6, 2022
03b8db2
Merge pull request #40 from johnkk84/dev
johnkk84 Feb 6, 2022
1d5e02a
fix customization
johnkk84 Feb 6, 2022
5f9456d
Merge pull request #41 from johnkk84/dev
marcink84 Feb 6, 2022
30bd18d
brake vote app
johnkk84 Feb 6, 2022
02e2256
Merge pull request #42 from johnkk84/dev
marcink84 Feb 6, 2022
9d2a9ae
brake vote app
johnkk84 Feb 6, 2022
55f8367
Merge pull request #43 from johnkk84/dev
marcink84 Feb 6, 2022
a792d45
brake vote app
johnkk84 Feb 6, 2022
e78db85
Merge pull request #44 from johnkk84/dev
marcink84 Feb 6, 2022
3bee869
Fix vote-app customization
johnkk84 Feb 6, 2022
6dc126b
Merge pull request #45 from johnkk84/dev
marcink84 Feb 6, 2022
dede026
Testing triggers
johnkk84 Feb 17, 2022
f7a97b1
Merge pull request #46 from johnkk84/dev
johnkk84 Feb 17, 2022
0d67d50
Update kustomization.yaml
johnkk84 Feb 17, 2022
0f60fa1
Merge pull request #47 from johnkk84/dev
johnkk84 Feb 17, 2022
6022be8
Adding placeholder for image tags
johnkk84 Feb 21, 2022
13799dd
Merge pull request #48 from johnkk84/dev
johnkk84 Feb 21, 2022
3b7f9b7
januszkujawa84/vote:main-0f60fa1f-1645461871
Feb 21, 2022
3fc81aa
Update kustomization.yaml
johnkk84 Feb 21, 2022
2d6dc90
Merge branch 'main' into dev
johnkk84 Feb 21, 2022
b056b63
Update app.py
johnkk84 Feb 21, 2022
d68e3d2
Update app.py
johnkk84 Feb 21, 2022
37ed869
Update values.yaml
johnkk84 Feb 21, 2022
a953c45
Update values.yaml
johnkk84 Feb 21, 2022
8d6117f
Update Chart.yaml
johnkk84 Feb 21, 2022
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
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
Example Voting (Instavote) App
=========

Getting started
---------------

Expand Down
2 changes: 2 additions & 0 deletions deploy/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This is deployment code for Kubernetes.
This code would be ised by Flux to deploy Kubernetes Environment.
23 changes: 23 additions & 0 deletions deploy/charts/result/.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 deploy/charts/result/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v2
name: result
description: A Helm chart for result NodeJS app

# 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.2

# 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.0"
22 changes: 22 additions & 0 deletions deploy/charts/result/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
1. Get the application URL by running these commands:
{{- if .Values.ingress.enabled }}
{{- range $host := .Values.ingress.hosts }}
{{- range .paths }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
{{- end }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "result.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "result.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "result.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "result.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
{{- end }}
62 changes: 62 additions & 0 deletions deploy/charts/result/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "result.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).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "result.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "result.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "result.labels" -}}
helm.sh/chart: {{ include "result.chart" . }}
{{ include "result.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "result.selectorLabels" -}}
app.kubernetes.io/name: {{ include "result.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "result.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "result.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
61 changes: 61 additions & 0 deletions deploy/charts/result/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "result.fullname" . }}
labels:
{{- include "result.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "result.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "result.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "result.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: 80
protocol: TCP
livenessProbe:
httpGet:
path: /
port: http
readinessProbe:
httpGet:
path: /
port: http
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
28 changes: 28 additions & 0 deletions deploy/charts/result/templates/hpa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{{- if .Values.autoscaling.enabled }}
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "result.fullname" . }}
labels:
{{- include "result.labels" . | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "result.fullname" . }}
minReplicas: {{ .Values.autoscaling.minReplicas }}
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
metrics:
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}
61 changes: 61 additions & 0 deletions deploy/charts/result/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "result.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
{{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}
{{- end }}
{{- end }}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{- include "result.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
ingressClassName: {{ .Values.ingress.className }}
{{- end }}
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ .path }}
{{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
pathType: {{ .pathType }}
{{- end }}
backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
service:
name: {{ $fullName }}
port:
number: {{ $svcPort }}
{{- else }}
serviceName: {{ $fullName }}
servicePort: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
18 changes: 18 additions & 0 deletions deploy/charts/result/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "result.fullname" . }}
labels:
{{- include "result.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
name: http
{{- if .Values.service.nodePort }}
nodePort: {{ .Values.service.nodePort }}
{{- end }}
selector:
{{- include "result.selectorLabels" . | nindent 4 }}
12 changes: 12 additions & 0 deletions deploy/charts/result/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "result.serviceAccountName" . }}
labels:
{{- include "result.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
15 changes: 15 additions & 0 deletions deploy/charts/result/templates/tests/test-connection.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Pod
metadata:
name: "{{ include "result.fullname" . }}-test-connection"
labels:
{{- include "result.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": test
spec:
containers:
- name: wget
image: busybox
command: ['wget']
args: ['{{ include "result.fullname" . }}:{{ .Values.service.port }}']
restartPolicy: Never
Loading