Commit 2f22f200 authored by Vũ Hoàng Nam's avatar Vũ Hoàng Nam

Add minio subchart

parent 25c5da41
......@@ -21,4 +21,4 @@ version: 0.1.0
# 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.0.0"
appVersion: "2024.1.16"
Webapp is deploying, just wait a few minutes.
\ No newline at end of file
{{/*
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 }}
......@@ -8,28 +8,35 @@
apiVersion: v1
kind: Pod
metadata:
name: {{ include "minio.name" . }}
namespace: {{ .Values.namespace }}
labels:
app: minio
name: minio
namespace: minio-dev # Change this value to match the namespace metadata.name
{{- include "minio.labels" . | nindent 4 }}
spec:
containers:
- name: minio
image: quay.io/minio/minio:latest
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
pullPolicy: {{ .Values.pullPolicy }}
resources:
limits:
memory: "2048Mi"
cpu: "2000m"
memory: {{ .Values.limits.memory }}
cpu: {{ .Values.limits.cpu }}
{{- with .Values.command }}
command:
- /bin/bash
- -c
args:
- minio server /data --console-address :9090
{{- toYaml . | nindent 6 -}}
{{- end -}}
{{- with .Values.args }}
args:
{{- toYaml . | nindent 6 -}}
{{- end -}}
{{- with .Values.volumeMounts }}
volumeMounts:
- mountPath: /data
name: localvolume
{{- toYaml . | nindent 6 -}}
{{- end -}}
{{- with .Values.volumes }}
volumes:
- name: localvolume
persistentVolumeClaim:
claimName: minio-pvc
\ No newline at end of file
{{- toYaml . | nindent 4 -}}
{{- end -}}
\ No newline at end of file
......@@ -2,6 +2,6 @@
apiVersion: v1
kind: Namespace
metadata:
name: minio-dev # Change this value if you want a different namespace name
name: {{ .Values.namespace }}
labels:
name: minio-dev # Change this value to match metadata.name
\ No newline at end of file
{{- include "minio.labels" . | nindent 4 -}}
\ No newline at end of file
apiVersion: v1
kind: PersistentVolume
metadata:
name: minio-pv
name: "{{ include "minio.name" . }}-pv"
spec:
capacity:
storage: 1024Mi
volumeMode: Filesystem
storage: {{ .Values.persistence.storage }}
volumeMode: {{ .Values.persistence.volumeMode }}
persistentVolumeReclaimPolicy: {{ .Values.persistence.persistentVolumeReclaimPolicy }}
storageClassName: ""
accessModes:
- ReadWriteOnce
storageClassName: ""
persistentVolumeReclaimPolicy: Recycle
nfs:
path: /var/nfs/k8s
server: 192.168.67.9
path: {{ .Values.persistence.nfs.path }}
server: {{ .Values.persistence.nfs.server }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: minio-pvc
namespace: minio-dev
name: "{{ include "minio.name" . }}-pvc"
namespace: {{ .Values.namespace }}
labels:
{{- include "minio.labels" . | nindent 4 }}
spec:
resources:
requests:
storage: 1000Mi
volumeMode: Filesystem
storage: {{ .Values.persistenceClaim.storage }}
volumeMode: {{ .Values.persistenceClaim.volumeMode }}
storageClassName: ""
volumeName: minio-pv # Specific PV to PVC connect
accessModes:
- ReadWriteOnce
volumeName: "{{ include "minio.name" . }}-pv"
apiVersion: v1
kind: Service
metadata:
name: minio-svc
namespace: minio-dev
name: {{ include "minio.name" . }}
namespace: {{ .Values.namespace }}
spec:
type: NodePort
selector:
app: minio
type: {{ .Values.service.type }}
ports:
- port: 9090
nodePort: 30001
targetPort: 9090
- port: {{ .Values.service.port }}
nodePort: {{ .Values.service.nodePort }}
targetPort: {{ .Values.service.targetPort }}
selector:
{{- include "minio.selectorLabels" . | nindent 4 -}}
# Default values for minio.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
namespace: minio-dev
replicaCount: 1
# Deloyment
image:
repository: nginx
repository: quay.io/minio/minio
tag: latest
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: ""
imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
limits:
memory: "2024Mi"
cpu: "2000m"
serviceAccount:
# Specifies whether a service account should be created
create: true
# Automatically mount a ServiceAccount's API credentials?
automount: true
# Annotations to add to the service account
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: ""
command:
- /bin/bash
- -c
podAnnotations: {}
podLabels: {}
args:
- minio server /data --console-address :9090
podSecurityContext: {}
# fsGroup: 2000
volumeMounts:
- mountPath: /data
name: localvolume
securityContext: {}
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000
volumes:
- name: localvolume
persistentVolumeClaim:
claimName: minio-pvc
# Service
service:
type: ClusterIP
port: 80
ingress:
enabled: false
className: ""
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: chart-example.local
paths:
- path: /
pathType: ImplementationSpecific
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 100
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80
# Additional volumes on the output Deployment definition.
volumes: []
# - name: foo
# secret:
# secretName: mysecret
# optional: false
# Additional volumeMounts on the output Deployment definition.
volumeMounts: []
# - name: foo
# mountPath: "/etc/foo"
# readOnly: true
nodeSelector: {}
tolerations: []
affinity: {}
type: NodePort
port: 9090
nodePort: 30001
targetPort: 9090
# 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
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment