Skip to content

Commit

Permalink
add kubernates and helm templates
Browse files Browse the repository at this point in the history
  • Loading branch information
vadlvs committed Jan 26, 2024
1 parent 1a06e95 commit aeb371d
Show file tree
Hide file tree
Showing 15 changed files with 166 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
.myvenv/
__pycache__/
.vagrant/
project/techtrends/database.db
9 changes: 9 additions & 0 deletions project/helm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
name: techtrends
description: Install a techtrends deployment
keywords:
- techtrends
version: 1.0.0
maintainers:
- name: Srikar
email: [email protected]
38 changes: 38 additions & 0 deletions project/helm/templates/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: techtrends
labels:
app: techtrends-{{ .Values.namespace.name }}
namespace: {{ .Values.namespace.name }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: techtrends-{{ .Values.namespace.name }}
template:
metadata:
labels:
app: techtrends-{{ .Values.namespace.name }}
spec:
containers:
- name: techtrends-{{ .Values.namespace.name }}
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- containerPort: {{ .Values.containerPort }}
resources:
requests:
memory: {{ .Values.resources.requests.memory }}
cpu: {{ .Values.resources.requests.cpu }}
limits:
memory: {{ .Values.resources.limits.memory }}
cpu: {{ .Values.resources.limits.cpu }}
livenessProbe:
httpGet:
path: {{ .Values.livenessProbe.path }}
port: {{ .Values.containerPort }}
readinessProbe:
httpGet:
path: {{ .Values.readinessProbe.path }}
port: {{ .Values.containerPort }}
4 changes: 4 additions & 0 deletions project/helm/templates/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: {{ .Values.namespace.name }}
13 changes: 13 additions & 0 deletions project/helm/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: techtrends
namespace: {{ .Values.namespace.name }}
spec:
selector:
app: techtrends-{{ .Values.namespace.name }}
ports:
- protocol: {{ .Values.service.protocol }}
port: {{ .Values.service.port }}
targetPort: {{ .Values.service.targetPort }}
type: {{ .Values.service.type }}
14 changes: 14 additions & 0 deletions project/helm/values-prod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace:
name: prod
service:
port: 7111
image:
pullPolicy: Always
replicaCount: 5
resources:
requests:
memory: '128Mi'
cpu: '350m'
limits:
memory: '356Mi'
cpu: '500m'
9 changes: 9 additions & 0 deletions project/helm/values-staging.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace:
name: staging
service:
port: 5111
replicaCount: 3
resources:
requests:
memory: '90Mi'
cpu: '300m'
24 changes: 24 additions & 0 deletions project/helm/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
namespace:
name: sandbox
service:
port: 4111
targetPort: 3111
protocol: TCP
type: ClusterIP
image:
repository: vadlvs/techtrends
tag: latest
pullPolicy: IfNotPresent
replicaCount: 1
resources:
requests:
memory: '64Mi'
cpu: '250m'
limits:
memory: '128Mi'
cpu: '500m'
containerPort: 3111
livenessProbe:
path: /healthz
readinessProbe:
path: /healthz
37 changes: 37 additions & 0 deletions project/kubernetes/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: techtrends
labels:
app: techtrends-sandbox
namespace: sandbox
spec:
replicas: 1
selector:
matchLabels:
app: techtrends-sandbox
template:
metadata:
labels:
app: techtrends-sandbox
spec:
containers:
- name: techtrends-sandbox
image: vadlvs/techtrends:latest
ports:
- containerPort: 3111
resources:
requests:
memory: "64Mi"
cpu: "250m"
limits:
memory: "128Mi"
cpu: "500m"
livenessProbe:
httpGet:
path: /healthz
port: 3111
readinessProbe:
httpGet:
path: /healthz
port: 3111
4 changes: 4 additions & 0 deletions project/kubernetes/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: sandbox
13 changes: 13 additions & 0 deletions project/kubernetes/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: techtrends
namespace: sandbox
spec:
selector:
app: techtrends-sandbox
ports:
- protocol: TCP
port: 4111
targetPort: 3111
type: ClusterIP
Binary file added project/screenshots/ci-dockerhub.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added project/screenshots/ci-github-actions.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added project/screenshots/k8s-nodes.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit aeb371d

Please sign in to comment.