Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
devops-intern-training
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nguyễn Văn Vũ
devops-intern-training
Commits
c0d76144
Commit
c0d76144
authored
Feb 27, 2024
by
Nguyễn Văn Vũ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Week8 - Deploy minio application by helm
parent
7673cec2
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
426 additions
and
0 deletions
+426
-0
helm-command.sh
week8/helm-command.sh
+14
-0
Chart.lock
week8/web-app-minio/Chart.lock
+6
-0
Chart.yaml
week8/web-app-minio/Chart.yaml
+29
-0
.helmignore
week8/web-app-minio/charts/minio/.helmignore
+23
-0
Chart.yaml
week8/web-app-minio/charts/minio/Chart.yaml
+24
-0
NOTES.txt
week8/web-app-minio/charts/minio/templates/NOTES.txt
+1
-0
_helpers.tpl
week8/web-app-minio/charts/minio/templates/_helpers.tpl
+33
-0
minio-cm.yml
week8/web-app-minio/charts/minio/templates/minio-cm.yml
+10
-0
minio-dev.yml
week8/web-app-minio/charts/minio/templates/minio-dev.yml
+44
-0
minio-ns.yml
week8/web-app-minio/charts/minio/templates/minio-ns.yml
+9
-0
minio-pv.yml
week8/web-app-minio/charts/minio/templates/minio-pv.yml
+17
-0
minio-pvc.yml
week8/web-app-minio/charts/minio/templates/minio-pvc.yml
+17
-0
minio-svc.yml
week8/web-app-minio/charts/minio/templates/minio-svc.yml
+13
-0
values.yaml
week8/web-app-minio/charts/minio/values.yaml
+63
-0
NOTES.txt
week8/web-app-minio/templates/NOTES.txt
+1
-0
_helpers.tpl
week8/web-app-minio/templates/_helpers.tpl
+33
-0
app-config.yml
week8/web-app-minio/templates/app-config.yml
+9
-0
app-deployment.yml
week8/web-app-minio/templates/app-deployment.yml
+36
-0
app-service.yml
week8/web-app-minio/templates/app-service.yml
+12
-0
values.yaml
week8/web-app-minio/values.yaml
+32
-0
No files found.
week8/helm-command.sh
0 → 100644
View file @
c0d76144
# Create helm chart
helm create web-app-minio
# Upgrade chart
cd
web-app-minio
helm upgrade web-app-minio
.
# Rollback version (Current version is 2)
helm rollback web-app-minio 1
# Delete application
helm delete web-app-minio
week8/web-app-minio/Chart.lock
0 → 100644
View file @
c0d76144
dependencies:
- name: minio
repository: ""
version: 12.13.2
digest: sha256:4ebb94ff5dccdd869438afe0ec716b0833c4bac1defaa27a0e54f836a7de4835
generated: "2024-01-17T09:21:50.399621+07:00"
week8/web-app-minio/Chart.yaml
0 → 100644
View file @
c0d76144
apiVersion
:
v2
name
:
web-app-minio
description
:
A Helm chart for Kubernetes
# 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
:
"
1.16.0"
# Dependencies
dependencies
:
-
name
:
minio
version
:
"
12.13.2"
\ No newline at end of file
week8/web-app-minio/charts/minio/.helmignore
0 → 100644
View file @
c0d76144
# 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/
week8/web-app-minio/charts/minio/Chart.yaml
0 → 100644
View file @
c0d76144
apiVersion
:
v2
name
:
minio
description
:
A Helm chart for deploy Minio in Kubernetes
# 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
:
"
2024.1.16"
week8/web-app-minio/charts/minio/templates/NOTES.txt
0 → 100644
View file @
c0d76144
Webapp is deploying, just wait a few minutes.
\ No newline at end of file
week8/web-app-minio/charts/minio/templates/_helpers.tpl
0 → 100644
View file @
c0d76144
{{
/*
Expand
the
name
of
the
chart
.
*/
}}
{{- define "minio.name" -}}
{{- default .Chart.Name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{
{
/*
Create
chart
name
and
version
as
used
by
the
chart
label
.
*/
}
}
{{- define "minio.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end }}
{
{
/*
Common
labels
*/
}
}
{{- define "minio.labels" -}}
helm.sh/chart: {{ include "minio.chart" . }}
{{ include "minio.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{
{
/*
Selector
labels
*/
}
}
{{- define "minio.selectorLabels" -}}
app.kubernetes.io/name: {{ include "minio.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
week8/web-app-minio/charts/minio/templates/minio-cm.yml
0 → 100644
View file @
c0d76144
apiVersion
:
v1
kind
:
ConfigMap
metadata
:
name
:
"
{{
include
"minio.name" . }}-cm"
namespace
:
{{
.Values.namespace
}}
labels
:
{{
- include "minio.labels" . | nindent 4
}}
data
:
MINIO_ROOT_USER
:
{{
.Values.config.MINIO_ROOT_USER
}}
MINIO_ROOT_PASSWORD
:
{{
.Values.config.MINIO_ROOT_PASSWORD
}}
week8/web-app-minio/charts/minio/templates/minio-dev.yml
0 → 100644
View file @
c0d76144
---
# Deploys a new MinIO Pod into the metadata.namespace Kubernetes namespace
#
# The `spec.containers[0].args` contains the command run on the pod
# The `/data` directory corresponds to the `spec.containers[0].volumeMounts[0].mountPath`
# That mount path corresponds to a Kubernetes HostPath which binds `/data` to a local drive or volume on the worker node where the pod runs
#
apiVersion
:
v1
kind
:
Pod
metadata
:
name
:
{{
include "minio.name" .
}}
namespace
:
{{
.Values.namespace
}}
labels
:
{{
- include "minio.labels" . | nindent 4
}}
spec
:
containers
:
-
name
:
{{
.Chart.Name
}}
image
:
"
{{
.Values.image.repository
}}:{{
.Values.image.tag
|
default
.Chart.AppVersion
}}"
pullPolicy
:
{{
.Values.image.pullPolicy
}}
resources
:
limits
:
memory
:
{{
.Values.limits.memory
}}
cpu
:
{{
.Values.limits.cpu
}}
envFrom
:
-
configMapRef
:
name
:
"
{{
include
"minio.name" . }}-cm"
{{
- with .Values.command
}}
command
:
{{
- toYaml . | nindent 8 -
}}
{{
- end -
}}
{{
- with .Values.args
}}
args
:
{{
- toYaml . | nindent 8 -
}}
{{
- end -
}}
{{
- with .Values.volumeMounts
}}
volumeMounts
:
{{
- toYaml . | nindent 8 -
}}
{{
- end -
}}
{{
- with .Values.volumes
}}
volumes
:
{{
- toYaml . | nindent 6 -
}}
{{
- end -
}}
\ No newline at end of file
week8/web-app-minio/charts/minio/templates/minio-ns.yml
0 → 100644
View file @
c0d76144
# Deploys a new Namespace for the MinIO Pod
{{
- if ne .Values.namespace "default" -
}}
apiVersion
:
v1
kind
:
Namespace
metadata
:
name
:
{{
.Values.namespace
}}
labels
:
{{
- include "minio.labels" . | nindent 4 -
}}
{{
- end -
}}
\ No newline at end of file
week8/web-app-minio/charts/minio/templates/minio-pv.yml
0 → 100644
View file @
c0d76144
apiVersion
:
v1
kind
:
PersistentVolume
metadata
:
name
:
"
{{
include
"minio.name" . }}-pv"
spec
:
capacity
:
storage
:
{{
.Values.persistence.storage
}}
volumeMode
:
{{
.Values.persistence.volumeMode
}}
persistentVolumeReclaimPolicy
:
{{
.Values.persistence.persistentVolumeReclaimPolicy
}}
storageClassName
:
"
"
accessModes
:
-
ReadWriteOnce
nfs
:
path
:
{{
.Values.persistence.nfs.path
}}
server
:
{{
.Values.persistence.nfs.server
}}
week8/web-app-minio/charts/minio/templates/minio-pvc.yml
0 → 100644
View file @
c0d76144
apiVersion
:
v1
kind
:
PersistentVolumeClaim
metadata
:
name
:
"
{{
include
"minio.name" . }}-pvc"
namespace
:
{{
.Values.namespace
}}
labels
:
{{
- include "minio.labels" . | nindent 4
}}
spec
:
resources
:
requests
:
storage
:
{{
.Values.persistenceClaim.storage
}}
volumeMode
:
{{
.Values.persistenceClaim.volumeMode
}}
storageClassName
:
"
"
accessModes
:
-
ReadWriteOnce
volumeName
:
"
{{
include
"minio.name" . }}-pv"
week8/web-app-minio/charts/minio/templates/minio-svc.yml
0 → 100644
View file @
c0d76144
apiVersion
:
v1
kind
:
Service
metadata
:
name
:
{{
include "minio.name" .
}}
namespace
:
{{
.Values.namespace
}}
spec
:
type
:
{{
.Values.service.type
}}
ports
:
-
name
:
cluster
port
:
{{
.Values.service.port
}}
targetPort
:
{{
.Values.service.targetPort
}}
selector
:
{{
- include "minio.selectorLabels" . | nindent 4 -
}}
week8/web-app-minio/charts/minio/values.yaml
0 → 100644
View file @
c0d76144
# Default values for minio.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
namespace
:
default
# Deloyment
image
:
repository
:
quay.io/minio/minio
tag
:
latest
pullPolicy
:
IfNotPresent
limits
:
memory
:
"
2024Mi"
cpu
:
"
2000m"
command
:
-
/bin/bash
-
-c
args
:
-
minio server /data --console-address :9090
volumeMounts
:
-
mountPath
:
/data
name
:
localvolume
volumes
:
-
name
:
localvolume
persistentVolumeClaim
:
claimName
:
minio-pvc
# Service
service
:
type
:
ClusterIP
port
:
9000
targetPort
:
9000
minioport
:
port
:
9000
nodePort
:
30021
targetPort
:
9000
# Persistent Volume Claim
persistenceClaim
:
storage
:
1024Mi
volumeMode
:
Filesystem
storageClassName
:
"
"
accessModes
:
ReadWriteOnce
# Persistent Volume
persistence
:
storage
:
1024Mi
volumeMode
:
Filesystem
accessModes
:
ReadWriteOnce
persistentVolumeReclaimPolicy
:
Recycle
nfs
:
# NFS server detail
path
:
/var/nfs/k8s
server
:
192.168.67.9
# Config Map
config
:
MINIO_ROOT_USER
:
user
MINIO_ROOT_PASSWORD
:
password
\ No newline at end of file
week8/web-app-minio/templates/NOTES.txt
0 → 100644
View file @
c0d76144
Deploy Web-app successful.
\ No newline at end of file
week8/web-app-minio/templates/_helpers.tpl
0 → 100644
View file @
c0d76144
{{
/*
Expand
the
name
of
the
chart
.
*/
}}
{{- define "web-app-minio.name" -}}
{{- default .Chart.Name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{
{
/*
Create
chart
name
and
version
as
used
by
the
chart
label
.
*/
}
}
{{- define "web-app-minio.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end }}
{
{
/*
Selector
labels
*/
}
}
{{- define "web-app-minio.selectorLabels" -}}
app.kubernetes.io/name: {{ include "web-app-minio.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{
{
/*
Common
labels
*/
}
}
{{- define "web-app-minio.labels" -}}
helm.sh/chart: {{ include "web-app-minio.chart" . }}
{{ include "web-app-minio.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
week8/web-app-minio/templates/app-config.yml
0 → 100644
View file @
c0d76144
apiVersion
:
v1
kind
:
ConfigMap
metadata
:
name
:
"
{{
include
"web-app-minio.name" . }}-cm"
data
:
MINIO_ACCESS_KEY_ID
:
{{
.Values.configMap.MINIO_ACCESS_KEY_ID
}}
MINIO_SECRET_ACCESS_KEY
:
{{
.Values.configMap.MINIO_SECRET_ACCESS_KEY
}}
MINIO_STORAGE_BUCKET_NAME
:
{{
.Values.configMap.MINIO_STORAGE_BUCKET_NAME
}}
MINIO_API
:
"
http://minio.{{
.Values.namespace
}}.svc.cluster.local:9000"
\ No newline at end of file
week8/web-app-minio/templates/app-deployment.yml
0 → 100644
View file @
c0d76144
apiVersion
:
apps/v1
kind
:
Deployment
metadata
:
name
:
{{
include "web-app-minio.name" .
}}
spec
:
replicas
:
{{
.Values.replicas
}}
selector
:
matchLabels
:
{{
- include "web-app-minio.selectorLabels" . | nindent 6
}}
revisionHistoryLimit
:
5
progressDeadlineSeconds
:
300
minReadySeconds
:
10
strategy
:
type
:
RollingUpdate
rollingUpdate
:
maxUnavailable
:
1
maxSurge
:
1
template
:
metadata
:
labels
:
{{
- include "web-app-minio.labels" . | nindent 8
}}
spec
:
containers
:
-
name
:
{{
.Chart.Name
}}
image
:
"
{{
.Values.image.repository
}}:{{
.Values.image.tag}}"
pullPolicy
:
Always
envFrom
:
-
configMapRef
:
name
:
"
{{
include
"web-app-minio.name" . }}-cm"
ports
:
-
containerPort
:
{{
.Values.containerPort
}}
resources
:
limits
:
memory
:
{{
.Values.limits.memory
}}
cpu
:
{{
.Values.limits.cpu
}}
week8/web-app-minio/templates/app-service.yml
0 → 100644
View file @
c0d76144
apiVersion
:
v1
kind
:
Service
metadata
:
name
:
"
{{
include
"web-app-minio.name" . }}-svc"
spec
:
type
:
{{
.Values.service.type
}}
ports
:
-
port
:
{{
.Values.service.port
}}
protocol
:
{{
.Values.service.protocol
}}
selector
:
{{
- include "web-app-minio.selectorLabels" . | nindent 4
}}
week8/web-app-minio/values.yaml
0 → 100644
View file @
c0d76144
# Default values for web-app-minio.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
namespace
:
default
# Deployment
replicas
:
1
image
:
repository
:
garovu/django-minio
tag
:
latest
limits
:
memory
:
"
1024Mi"
cpu
:
"
1000m"
containerPort
:
8000
# ConfigMap
configMap
:
MINIO_ACCESS_KEY_ID
:
user
MINIO_SECRET_ACCESS_KEY
:
password
MINIO_STORAGE_BUCKET_NAME
:
static
# MINIO_API: "http://172.17.0.1:9000"
# Service
service
:
type
:
NodePort
port
:
8000
protocol
:
TCP
# Minio Setup
minio
:
namespace
:
default
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment