mirror of
https://github.com/Dannecron/netology-devops-gw-infra.git
synced 2025-12-25 15:22:36 +03:00
[stage-3] add helm chart for simple application
This commit is contained in:
23
k8s/helm/simple-app/.helmignore
Normal file
23
k8s/helm/simple-app/.helmignore
Normal file
@@ -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
k8s/helm/simple-app/Chart.yaml
Normal file
24
k8s/helm/simple-app/Chart.yaml
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
apiVersion: v2
|
||||||
|
name: simple-app
|
||||||
|
description: application helm chart
|
||||||
|
|
||||||
|
# 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: "latest"
|
||||||
6
k8s/helm/simple-app/templates/NOTES.txt
Normal file
6
k8s/helm/simple-app/templates/NOTES.txt
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
---------------------------------------------------------
|
||||||
|
|
||||||
|
Content of NOTES.txt appears after deploy.
|
||||||
|
Deployed version {{ .Chart.AppVersion }}.
|
||||||
|
|
||||||
|
---------------------------------------------------------
|
||||||
30
k8s/helm/simple-app/templates/deployment.yaml
Normal file
30
k8s/helm/simple-app/templates/deployment.yaml
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: {{ .Chart.Name }}-{{ .Values.environment }}
|
||||||
|
service: application
|
||||||
|
name: {{ .Chart.Name }}-{{ .Values.environment }}-application
|
||||||
|
spec:
|
||||||
|
replicas: {{ .Values.application.replicasCount }}
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: {{ .Chart.Name }}-{{ .Values.environment }}
|
||||||
|
service: application
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: {{ .Chart.Name }}-{{ .Values.environment }}
|
||||||
|
service: application
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- image: {{ .Values.image.name }}:{{ .Chart.AppVersion }}
|
||||||
|
imagePullPolicy: Always
|
||||||
|
name: application
|
||||||
|
ports:
|
||||||
|
- name: web
|
||||||
|
containerPort: 80
|
||||||
|
resources:
|
||||||
|
{{- toYaml .Values.application.resources | nindent 12 }}
|
||||||
|
terminationGracePeriodSeconds: 30
|
||||||
20
k8s/helm/simple-app/templates/ingress.yaml
Normal file
20
k8s/helm/simple-app/templates/ingress.yaml
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: {{ .Chart.Name }}-{{ .Values.environment }}-application-ingress
|
||||||
|
annotations:
|
||||||
|
kubernetes.io/ingress.class: nginx
|
||||||
|
ingress.kubernetes.io/rewrite-target: /
|
||||||
|
spec:
|
||||||
|
rules:
|
||||||
|
- host: app-gw.my.to
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
pathType: Prefix
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: {{ .Chart.Name }}-{{ .Values.environment }}-application
|
||||||
|
port:
|
||||||
|
number: 80
|
||||||
12
k8s/helm/simple-app/templates/service.yaml
Normal file
12
k8s/helm/simple-app/templates/service.yaml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: {{ .Chart.Name }}-{{ .Values.environment }}-application
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- name: web
|
||||||
|
port: 80
|
||||||
|
selector:
|
||||||
|
app: {{ .Chart.Name }}-{{ .Values.environment }}
|
||||||
|
service: application
|
||||||
14
k8s/helm/simple-app/values.yaml
Normal file
14
k8s/helm/simple-app/values.yaml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
environment: production
|
||||||
|
|
||||||
|
image:
|
||||||
|
name: dannecron/parcel-example-neko
|
||||||
|
|
||||||
|
application:
|
||||||
|
replicasCount: 1
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 200m
|
||||||
|
memory: 256Mi
|
||||||
|
requests:
|
||||||
|
cpu: 100m
|
||||||
|
memory: 128Mi
|
||||||
Reference in New Issue
Block a user