Skip to content

Commit

Permalink
kubernetes-4
Browse files Browse the repository at this point in the history
  • Loading branch information
Baykanurov committed Dec 2, 2023
1 parent c01afd1 commit 33c855a
Show file tree
Hide file tree
Showing 82 changed files with 2,783 additions and 216 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -476,3 +476,11 @@ yc compute disk create \
--size 4 \
--description "disk for k8s"
```
## Kubernetes-4
### Что было сделано:
1. Установил и настроил helm
2. Написал helm чарты для компонентов приложения
3. Разобрался с управлением зависимостями в helm
4. Установил Gitlab в Kubernetes
5. Настроил CI и выстроил пайплайн
1 change: 0 additions & 1 deletion gitlab-ci/.env.example

This file was deleted.

71 changes: 0 additions & 71 deletions gitlab-ci/.gitlab-ci.yml

This file was deleted.

15 changes: 0 additions & 15 deletions gitlab-ci/docker-compose.yml

This file was deleted.

9 changes: 9 additions & 0 deletions kubernetes/Charts/comment/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
apiVersion: v2
appVersion: "1.0.0"
name: comment
version: 1.0.0
description: OTUS reddit application COMMENT
maintainers:
- name: Baykanurov
email: [email protected]
3 changes: 3 additions & 0 deletions kubernetes/Charts/comment/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{- define "comment.fullname" -}}
{{- printf "%s-%s" .Release.Name .Chart.Name }}
{{- end -}}
34 changes: 34 additions & 0 deletions kubernetes/Charts/comment/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "comment.fullname" . }}
labels:
app: reddit
component: comment
release: {{ .Release.Name }}
spec:
replicas: 1
selector:
matchLabels:
app: reddit
component: comment
release: {{ .Release.Name }}
template:
metadata:
name: comment
labels:
app: reddit
component: comment
release: {{ .Release.Name }}
spec:
containers:
- image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
name: comment
ports:
- containerPort: {{ .Values.service.internalPort }}
name: comment
protocol: TCP
env:
- name: COMMENT_DATABASE_HOST
value: {{ .Values.databaseHost | default (printf "%s-mongodb" .Release.Name) }}
19 changes: 19 additions & 0 deletions kubernetes/Charts/comment/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
apiVersion: v1
kind: Service
metadata:
name: {{ template "comment.fullname" . }}
labels:
app: reddit
component: comment
release: {{ .Release.Name }}
spec:
type: ClusterIP
ports:
- port: {{ .Values.service.externalPort }}
protocol: TCP
targetPort: {{ .Values.service.internalPort }}
selector:
app: reddit
component: comment
release: {{ .Release.Name }}
10 changes: 10 additions & 0 deletions kubernetes/Charts/comment/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
service:
internalPort: 9292
externalPort: 9292

image:
repository: baykanurov/comment
tag: latest

databaseHost:
Loading

0 comments on commit 33c855a

Please sign in to comment.