use PersistentVolumeClaim to create a persistent volume for each local service (mongo, minio, redis) when running in a cloud setup if cloud-specified volume storage class not specified, create default hostPath volume (eg. for minikube) lint: add default icon for chart
		
			
				
	
	
		
			110 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			110 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
{{- if .Values.mongo_local }}
 | 
						|
 | 
						|
---
 | 
						|
apiVersion: v1
 | 
						|
kind: Secret
 | 
						|
metadata:
 | 
						|
  name: mongo-auth
 | 
						|
  namespace: {{ .Release.Namespace }}
 | 
						|
 | 
						|
type: Opaque
 | 
						|
stringData:
 | 
						|
  MONGO_INITDB_ROOT_USERNAME: {{ .Values.mongo_auth.username | quote }}
 | 
						|
  MONGO_INITDB_ROOT_PASSWORD: {{ .Values.mongo_auth.password | quote }}
 | 
						|
 | 
						|
 | 
						|
---
 | 
						|
kind: PersistentVolumeClaim
 | 
						|
apiVersion: v1
 | 
						|
metadata:
 | 
						|
  name: mongo-storage-pvc
 | 
						|
spec:
 | 
						|
  accessModes:
 | 
						|
    - ReadWriteOnce
 | 
						|
 | 
						|
  resources:
 | 
						|
    requests:
 | 
						|
      storage: 2Gi
 | 
						|
 | 
						|
  {{- if .Values.volume_storage_class }}
 | 
						|
  storageClassName: {{ .Values.volume_storage_class }}
 | 
						|
  {{- end }}
 | 
						|
 | 
						|
 | 
						|
{{- if not .Values.volume_storage_class }}
 | 
						|
---
 | 
						|
apiVersion: v1
 | 
						|
kind: PersistentVolume
 | 
						|
metadata:
 | 
						|
  name: "local-mongo-store-pv"
 | 
						|
spec:
 | 
						|
  capacity:
 | 
						|
    storage: 2Gi
 | 
						|
 | 
						|
  accessModes:
 | 
						|
    - "ReadWriteOnce"
 | 
						|
 | 
						|
  hostPath:
 | 
						|
    path: /tmp/btrix-mongo-data
 | 
						|
{{- end }}
 | 
						|
 | 
						|
---
 | 
						|
apiVersion: apps/v1
 | 
						|
kind: Deployment
 | 
						|
metadata:
 | 
						|
  name: local-mongo
 | 
						|
  namespace: {{ .Release.Namespace }}
 | 
						|
spec:
 | 
						|
  selector:
 | 
						|
    matchLabels:
 | 
						|
      app: local-mongo
 | 
						|
  replicas: {{ .Values.api_num_replicas }}
 | 
						|
  template:
 | 
						|
    metadata:
 | 
						|
      labels:
 | 
						|
        app: local-mongo
 | 
						|
 | 
						|
    spec:
 | 
						|
      volumes:
 | 
						|
        - name: data-db
 | 
						|
          persistentVolumeClaim:
 | 
						|
            claimName: mongo-storage-pvc
 | 
						|
 | 
						|
      containers:
 | 
						|
        - name: mongo
 | 
						|
          image: {{ .Values.mongo_image }}
 | 
						|
          imagePullPolicy: {{ .Values.mongo_pull_policy }}
 | 
						|
          envFrom:
 | 
						|
            - secretRef:
 | 
						|
                name: mongo-auth
 | 
						|
 | 
						|
          volumeMounts:
 | 
						|
            - name: data-db
 | 
						|
              mountPath: /data/db
 | 
						|
              subPath: mongo
 | 
						|
 | 
						|
---
 | 
						|
apiVersion: v1
 | 
						|
kind: Service
 | 
						|
 | 
						|
metadata:
 | 
						|
  namespace: {{ .Release.Namespace }}
 | 
						|
  name: local-mongo
 | 
						|
  labels:
 | 
						|
    app: local-mongo
 | 
						|
 | 
						|
spec:
 | 
						|
  type: ClusterIP
 | 
						|
  selector:
 | 
						|
    app: local-mongo
 | 
						|
 | 
						|
  ports:
 | 
						|
    - protocol: TCP
 | 
						|
      port: 27017
 | 
						|
      targetPort: 27017
 | 
						|
      name: minio
 | 
						|
 | 
						|
{{- end }}
 | 
						|
 | 
						|
 |