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 charts/servicechart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
name: servicechart
name: deployer
description: A Helm chart for Kubernetes

# A chart can be either an 'application' or a 'library' chart.
Expand Down
77 changes: 77 additions & 0 deletions charts/servicechart/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@

# ui server

apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down Expand Up @@ -68,3 +71,77 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}

---

# odin
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "servicechart.fullname" . }}-backend
labels:
{{- include "servicechart.labels" . | nindent 4 }}-backend
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "servicechart.selectorLabels" . | nindent 6 }}-backend
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "servicechart.selectorLabels" . | nindent 8 }}-backend
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "servicechart.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repositoryBackend }}:{{ .Values.image.tagBackend | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
{{- range .Values.image.envBackend }}
- name: {{ .name }}
value: {{ .value }}
{{- end }}
ports:
- name: http
containerPort: {{ .Values.serviceBackend.targetPort }}
protocol: TCP
livenessProbe:
initialDelaySeconds: {{ .Values.livenessBackend.initialDelaySeconds }}
periodSeconds: {{ .Values.livenessBackend.periodSeconds }}
httpGet:
path: {{ .Values.livenessBackend.endpoint }}
port: http
readinessProbe:
initialDelaySeconds: {{ .Values.readinessBackend.initialDelaySeconds }}
periodSeconds: {{ .Values.readinessBackend.periodSeconds }}
httpGet:
path: {{ .Values.readinessBackend.endpoint }}
port: http
resources:
{{- toYaml .Values.resourcesBackend | 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 }}
143 changes: 143 additions & 0 deletions charts/servicechart/templates/etcd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
# storage-class.yaml
---

#kind: StorageClass
#apiVersion: storage.k8s.io/v1
#metadata:
# name: etcd-sc
#provisioner: kubernetes.io/no-provisioner
#volumeBindingMode: WaitForFirstConsumer
#reclaimPolicy: Retain

---

#kind: PersistentVolume
#apiVersion: v1
#metadata:
# name: etcd-pv
# labels:
# type: local
#spec:
# storageClassName: manual
# capacity:
# storage: 3Gi
# accessModes:
# - ReadWriteOnce
# hostPath:
# path: "/var/tmp/etcd"

---

#apiVersion: v1
#kind: PersistentVolumeClaim
#metadata:
# name: etcd-pvc
# labels:
# app: etcd-pvc
#spec:
# accessModes:
# - ReadWriteOnce
# storageClassName: manual
# resources:
# requests:
# storage: 1Gi


---

apiVersion: v1
kind: Service
metadata:
name: etcd-client
spec:
type: LoadBalancer
ports:
- name: etcd-client
port: 2379
protocol: TCP
targetPort: 2379
selector:
app: etcd

---

apiVersion: v1
kind: Service
metadata:
name: etcd-svc
spec:
clusterIP: None
ports:
- port: 2379
name: client
- port: 2380
name: peer
selector:
app: etcd

---

#apiVersion: v1
#kind: Pod
#metadata:
# name: etcd
# labels:
# app: etcd
#spec:
# selector:
# matchLabels:
# app: etcd
# #serviceName: e#tcd-svc
# #replicas: 1
## template:
## metadata:
## name: etcd
## labels:
## app: etcd
# spec:
# persistent: true
# containers:
# - name: etcd
# image: quay.io/coreos/etcd:latest
# ports:
# - containerPort: 2379
# name: client
# - containerPort: 2380
# name: peer
## volumeMounts:
## - mountPath: "/var/tmp/etcd"
## name: etcd-data
# command:
# - /bin/sh
# - -c
# - |
# PEERS="etcd-0=http://etcd-0:2380"
# exec etcd --name ${HOSTNAME} \
# --listen-peer-urls http://0.0.0.0:2380 \
# --listen-client-urls http://0.0.0.0:2379 \
# --advertise-client-urls http://${HOSTNAME}:2379 \
# --initial-advertise-peer-urls http://${HOSTNAME}:2380 \
# --initial-cluster-token etcd-cluster-1 \
# --initial-cluster ${PEERS} \
# --initial-cluster-state new
# --data-dir /var/run/etcd/default.etcd
# volumes:
# - name: etcd-data
# persistentVolumeClaim:
# claimName: etcd-pvc

apiVersion: v1
kind: Pod
metadata:
name: etcd
labels:
app: etcd-pod
spec:
containers:
- name: etcd
image: quay.io/coreos/etcd:latest
ports:
- containerPort: 2379
name: client
- containerPort: 2380
name: peer
31 changes: 31 additions & 0 deletions charts/servicechart/templates/hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,34 @@ spec:
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}

---

{{- if .Values.autoscaling.enabled }}
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "servicechart.fullname" . }}-backend
labels:
{{- include "servicechart.labels" . | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "servicechart.fullname" . }}-backend
minReplicas: {{ .Values.autoscalingBackend.minReplicas }}
maxReplicas: {{ .Values.autoscalingBackend.maxReplicas }}
metrics:
{{- if .Values.autoscalingBackend.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
targetAverageUtilization: {{ .Values.autoscalingBackend.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.autoscalingBackend.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
targetAverageUtilization: {{ .Values.autoscalingBackend.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}
18 changes: 18 additions & 0 deletions charts/servicechart/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,21 @@ spec:
name: http
selector:
{{- include "servicechart.selectorLabels" . | nindent 4 }}

---

apiVersion: v1
kind: Service
metadata:
name: {{ include "servicechart.fullname" . }}-backend
labels:
{{- include "servicechart.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.serviceBackend.port }}
targetPort: {{ .Values.serviceBackend.targetPort }}
protocol: TCP
name: http
selector:
{{- include "servicechart.selectorLabels" . | nindent 4 }}
49 changes: 42 additions & 7 deletions charts/servicechart/values.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
replicaCount: int_replica_initial
replicaCount: 1

# Replace all the - with _ in the tags and labels
image:
repository: container-repo
repository: anishks1997/kaiyo-titan-ui
repositoryBackend: anuragsarkar250/public
pullPolicy: IfNotPresent
tag: version_you_want_to_deploy
tag: latest
tagBackend: 1
env:
- name: key
value: value

envBackend:
- name: ETCD3_URL
value: http://etcd-svc
imagePullSecrets:
- name : regcred
- name : ""
nameOverride: ""
fullnameOverride: ""

Expand All @@ -20,7 +25,7 @@ serviceAccount:
annotations: {}
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name: "your service name"
name: "titan"

podAnnotations: {}

Expand All @@ -37,7 +42,12 @@ securityContext: {}

service:
type: LoadBalancer
port: 80
port: 8083
targetPort: 8083

serviceBackend:
type: LoadBalancer
port: 5000
targetPort: 5000

ingress:
Expand All @@ -61,13 +71,28 @@ resources:
cpu: 700m
memory: 512Mi

resourcesBackend:
limits:
cpu: 1500m
memory: 800Mi
requests:
cpu: 700m
memory: 512Mi

autoscaling:
enabled: true
minReplicas: 1
maxReplicas: 100
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80

autoscalingBackend:
enabled: true
minReplicas: 1
maxReplicas: 100
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80

nodeSelector: {}

tolerations: []
Expand All @@ -80,6 +105,16 @@ liveness:
periodSeconds: 5

readiness:
endpoint: /health
initialDelaySeconds: 10
periodSeconds: 5

livenessBackend:
endpoint: /health
initialDelaySeconds: 10
periodSeconds: 5

readinessBackend:
endpoint: /health
initialDelaySeconds: 10
periodSeconds: 5