Add mongodb helmchart for alpha
This commit is contained in:
parent
ea607e954d
commit
33c36f085a
5
freeleaps/alpha/oneoff/mongodb-chart/.helmignore
Normal file
5
freeleaps/alpha/oneoff/mongodb-chart/.helmignore
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# Exclude Helm-specific files
|
||||||
|
.DS_Store
|
||||||
|
*.swp
|
||||||
|
*.bak
|
||||||
|
*.tmp
|
||||||
5
freeleaps/alpha/oneoff/mongodb-chart/Chart.yaml
Normal file
5
freeleaps/alpha/oneoff/mongodb-chart/Chart.yaml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
apiVersion: v2
|
||||||
|
name: mongodb-chart
|
||||||
|
description: A Helm chart for deploying MongoDB
|
||||||
|
version: 0.1.0
|
||||||
|
appVersion: "latest"
|
||||||
@ -0,0 +1,31 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: mongodb
|
||||||
|
namespace: {{ .Values.namespace }}
|
||||||
|
spec:
|
||||||
|
replicas: {{ .Values.replicaCount }}
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: mongodb
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: mongodb
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: mongodb
|
||||||
|
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
|
||||||
|
ports:
|
||||||
|
- containerPort: {{ .Values.containerPort }}
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: {{ .Values.resources.limits.cpu }}
|
||||||
|
memory: {{ .Values.resources.limits.memory }}
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /data/db
|
||||||
|
name: mongodb-storage
|
||||||
|
volumes:
|
||||||
|
- name: mongodb-storage
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: mongodb-pvc
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolume
|
||||||
|
metadata:
|
||||||
|
name: mongodb-pv
|
||||||
|
namespace: {{ .Values.namespace }}
|
||||||
|
spec:
|
||||||
|
capacity:
|
||||||
|
storage: {{ .Values.persistence.size }}
|
||||||
|
accessModes:
|
||||||
|
- {{ .Values.persistence.accessMode }}
|
||||||
|
persistentVolumeReclaimPolicy: Retain
|
||||||
|
storageClassName: {{ .Values.persistence.storageClass }}
|
||||||
|
hostPath:
|
||||||
|
path: {{ .Values.persistence.hostPath }}
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: mongodb-pvc
|
||||||
|
namespace: {{ .Values.namespace }}
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- {{ .Values.persistence.accessMode }}
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: {{ .Values.persistence.size }}
|
||||||
|
storageClassName: {{ .Values.persistence.storageClass }}
|
||||||
|
|
||||||
12
freeleaps/alpha/oneoff/mongodb-chart/templates/service.yaml
Normal file
12
freeleaps/alpha/oneoff/mongodb-chart/templates/service.yaml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: mongodb-service
|
||||||
|
namespace: {{ .Values.namespace }}
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: mongodb
|
||||||
|
ports:
|
||||||
|
- protocol: TCP
|
||||||
|
port: {{ .Values.service.port }}
|
||||||
|
targetPort: {{ .Values.containerPort }}
|
||||||
18
freeleaps/alpha/oneoff/mongodb-chart/values.yaml
Normal file
18
freeleaps/alpha/oneoff/mongodb-chart/values.yaml
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
namespace: freeleaps-alpha
|
||||||
|
replicaCount: 1
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: "1000m"
|
||||||
|
memory: "1Gi"
|
||||||
|
image:
|
||||||
|
repository: mongo
|
||||||
|
tag: latest
|
||||||
|
service:
|
||||||
|
port: 27017
|
||||||
|
containerPort: 27017
|
||||||
|
persistence:
|
||||||
|
enabled: true
|
||||||
|
storageClass: "local-storage"
|
||||||
|
accessMode: ReadWriteOnce
|
||||||
|
size: 10Gi
|
||||||
|
hostPath: "/mnt/mongodb-data" # Path on the node’s local disk
|
||||||
Loading…
Reference in New Issue
Block a user