push helm Charts and kube Components

This commit is contained in:
na 2024-08-30 16:13:10 +02:00
parent accee4fdd0
commit 00d92b73f8
42 changed files with 701 additions and 0 deletions

View File

@ -0,0 +1,5 @@
apiVersion: v2
name: oc-catalog
description: A Helm chart for deploying the oc-catalog application
version: 0.1.0
appVersion: "1.0"

View File

@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}-oc-catalog
spec:
selector:
app: {{ .Chart.Name }}
ports:
- protocol: TCP
port: {{ .Values.service.port }}
targetPort: {{ .Values.service.targetPort }}
type: {{ .Values.service.type }}

View File

@ -0,0 +1,33 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ .Release.Name }}-oc-catalog
labels:
app: oc-catalog
spec:
serviceName: "{{ .Release.Name }}-oc-catalog"
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: oc-catalog
template:
metadata:
labels:
app: oc-catalog
spec:
containers:
- name: oc-catalog
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
ports:
- containerPort: 8080
env:
- name: MONGO_DATABASE
value: "DC_myDC"
- name: MONGO_URI
value: "mongodb://mongo:27017"
imagePullSecrets:
{{- if .Values.imagePullSecrets }}
{{- range .Values.imagePullSecrets }}
- name: {{ .name }}
{{- end }}
{{- end }}

View File

@ -0,0 +1,19 @@
replicaCount: 1
image:
repository: registry.dev.svc.cluster.local:5000/oc-catalog
tag: latest
pullPolicy: IfNotPresent
service:
type: NodePort
port: 8087
targetPort: 8080
mongo:
database: DC_myDC
uri: mongodb://mongo:27017
imagePullSecrets:
- name: regcred

View 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/

12
Helm/oc-deploy/Chart.lock Normal file
View File

@ -0,0 +1,12 @@
dependencies:
- name: oc-mongo
repository: file://../oc-mongo
version: 0.1.0
- name: oc-mongo-express
repository: file://../oc-mongo-express
version: 0.1.0
- name: oc-catalog
repository: file://../oc-catalog
version: 0.1.0
digest: sha256:036af8acf7fe0a73f039776d13f63aeb7530e7a8b0febb49fd5e8415ac6672c6
generated: "2024-08-27T14:34:41.6038407+02:00"

14
Helm/oc-deploy/Chart.yaml Normal file
View File

@ -0,0 +1,14 @@
apiVersion: v2
name: oc-deploy
description: A Helm chart to deploy oc-mongo, oc-mongo-express, and oc-catalog together
version: 0.1.0
dependencies:
- name: oc-mongo
version: 0.1.0
repository: "file://../oc-mongo"
- name: oc-mongo-express
version: 0.1.0
repository: "file://../oc-mongo-express"
- name: oc-catalog
version: 0.1.0
repository: "file://../oc-catalog"

Binary file not shown.

View File

@ -0,0 +1,5 @@
apiVersion: v2
name: oc-catalog
description: A Helm chart for deploying the oc-catalog application
version: 0.1.0
appVersion: "1.0"

View File

@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: oc-catalog
spec:
selector:
app: {{ .Chart.Name }}
ports:
- protocol: TCP
port: {{ .Values.service.port }}
targetPort: {{ .Values.service.targetPort }}
type: {{ .Values.service.type }}

View File

@ -0,0 +1,33 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ .Release.Name }}-oc-catalog
labels:
app: oc-catalog
spec:
serviceName: "oc-catalog"
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: oc-catalog
template:
metadata:
labels:
app: oc-catalog
spec:
containers:
- name: oc-catalog
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
ports:
- containerPort: 8080
env:
- name: MONGO_DATABASE
value: "DC_myDC"
- name: MONGO_URI
value: "mongodb://{{ .Release.Name }}-mongo:27017"
imagePullSecrets:
{{- if .Values.imagePullSecrets }}
{{- range .Values.imagePullSecrets }}
- name: {{ .name }}
{{- end }}
{{- end }}

View File

@ -0,0 +1,19 @@
replicaCount: 1
image:
repository: registry.dev.svc.cluster.local:5000/oc-catalog
tag: latest
pullPolicy: IfNotPresent
service:
type: NodePort
port: 8087
targetPort: 8080
mongo:
database: DC_myDC
uri: mongodb://oc-deploy-mongo:27017
imagePullSecrets:
- name: regcred

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,5 @@
apiVersion: v2
name: oc-mongo-express
description: A Helm chart for deploying mongo-express
version: 0.1.0
appVersion: "1.0"

View File

@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: mongo-express
spec:
selector:
app: mongo-express
ports:
- protocol: TCP
port: {{ .Values.service.port }}
targetPort: {{ .Values.service.targetPort }}
type: {{ .Values.service.type }}

View File

@ -0,0 +1,39 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ .Release.Name }}-mongo-express
labels:
app: mongo-express
spec:
serviceName: "mongo-express"
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: mongo-express
template:
metadata:
labels:
app: mongo-express
spec:
containers:
- name: mongo-express
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
ports:
- containerPort: {{ .Values.service.targetPort }}
env:
- name: ME_CONFIG_BASICAUTH_USERNAME
valueFrom:
secretKeyRef:
name: mongo-secret
key: {{ .Values.secret.usernameKey }}
- name: ME_CONFIG_BASICAUTH_PASSWORD
valueFrom:
secretKeyRef:
name: mongo-secret
key: {{ .Values.secret.passwordKey }}
imagePullSecrets:
{{- if .Values.imagePullSecrets }}
{{- range .Values.imagePullSecrets }}
- name: {{ .name }}
{{- end }}
{{- end }}

View File

@ -0,0 +1,18 @@
replicaCount: 1
image:
repository: mongo-express
tag: latest
pullPolicy: IfNotPresent
service:
port: 8081
targetPort: 8081
type: NodePort
imagePullSecrets:
- name: my-registry-key
secret:
usernameKey: mongo-username
passwordKey: mongo-password

View File

@ -0,0 +1,5 @@
apiVersion: v2
name: oc-mongo
description: A Helm chart for deploying the oc-mongo component
version: 0.1.0
appVersion: "1.0"

View File

@ -0,0 +1,10 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ .Values.persistence.name }}
spec:
accessModes:
- {{ .Values.persistence.accessMode }}
resources:
requests:
storage: {{ .Values.persistence.size }}

View File

@ -0,0 +1,8 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ .Release.Name }}-mongo-secret
type: Opaque
data:
username: {{ .Values.secret.username }}
password: {{ .Values.secret.password }}

View File

@ -0,0 +1,11 @@
apiVersion: v1
kind: Service
metadata:
name: mongo
spec:
selector:
app: mongo
ports:
- protocol: TCP
port: {{ .Values.service.port }}
targetPort: {{ .Values.service.port }}

View File

@ -0,0 +1,31 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ .Release.Name }}-mongo
labels:
app: mongo
spec:
serviceName: "mongo"
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: mongo
template:
metadata:
labels:
app: mongo
spec:
containers:
- name: mongo
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
ports:
- containerPort: 27017
volumeMounts:
- name: mongo-persistent-storage
mountPath: /data/db
- name: mongo-persistent-storage
mountPath: /data/configdb
volumes:
- name: mongo-persistent-storage
persistentVolumeClaim:
claimName: {{ .Values.persistence.name }}

View File

@ -0,0 +1,19 @@
replicaCount: 1
image:
repository: mongo
tag: latest
pullPolicy: IfNotPresent
service:
port: 27017
persistence:
name: mongo-pvc-helm
enabled: true
accessMode: ReadWriteOnce
size: 1Gi
secret:
username: dGVzdA== # base64 encoding of 'test'
password: dGVzdA== # base64 encoding of 'test'

View File

@ -0,0 +1,48 @@
oc-mongo:
replicaCount: 1
image:
repository: registry.dev.svc.cluster.local:5000/mongo
tag: latest
pullPolicy: IfNotPresent
service:
port: 27017
persistence:
name: mongo-pvc-helm
enabled: true
accessMode: ReadWriteOnce
size: 1Gi
secret:
username: dGVzdA== # base64 encoding of 'test'
password: dGVzdA== # base64 encoding of 'test'
oc-mongo-express:
replicaCount: 1
image:
repository: registry.dev.svc.cluster.local:5000/mongo-express
tag: latest
pullPolicy: IfNotPresent
service:
port: 8081
targetPort: 8081
type: NodePort
imagePullSecrets:
- name: regcred
secret:
usernameKey: mongo-username
passwordKey: mongo-password
oc-catalog:
replicaCount: 1
image:
repository: registry.dev.svc.cluster.local:5000/oc-catalog
tag: latest
pullPolicy: IfNotPresent
service:
type: NodePort
port: 8087
targetPort: 8080
mongo:
database: DC_myDC
uri: mongodb://oc-catalog-mongo:27017
imagePullSecrets:
- name: regcred

View File

@ -0,0 +1,5 @@
apiVersion: v2
name: oc-mongo-express
description: A Helm chart for deploying mongo-express
version: 0.1.0
appVersion: "1.0"

View File

@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}-mongo-express
spec:
selector:
app: mongo-express
ports:
- protocol: TCP
port: {{ .Values.service.port }}
targetPort: {{ .Values.service.targetPort }}
type: {{ .Values.service.type }}

View File

@ -0,0 +1,39 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ .Release.Name }}-mongo-express
labels:
app: mongo-express
spec:
serviceName: "{{ .Release.Name }}-mongo-express"
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: mongo-express
template:
metadata:
labels:
app: mongo-express
spec:
containers:
- name: mongo-express
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
ports:
- containerPort: {{ .Values.service.targetPort }}
env:
- name: ME_CONFIG_BASICAUTH_USERNAME
valueFrom:
secretKeyRef:
name: mongo-secret
key: {{ .Values.secret.usernameKey }}
- name: ME_CONFIG_BASICAUTH_PASSWORD
valueFrom:
secretKeyRef:
name: mongo-secret
key: {{ .Values.secret.passwordKey }}
imagePullSecrets:
{{- if .Values.imagePullSecrets }}
{{- range .Values.imagePullSecrets }}
- name: {{ .name }}
{{- end }}
{{- end }}

View File

@ -0,0 +1,18 @@
replicaCount: 1
image:
repository: mongo-express
tag: latest
pullPolicy: IfNotPresent
service:
port: 8081
targetPort: 8081
type: NodePort
imagePullSecrets:
- name: my-registry-key
secret:
usernameKey: mongo-username
passwordKey: mongo-password

5
Helm/oc-mongo/Chart.yaml Normal file
View File

@ -0,0 +1,5 @@
apiVersion: v2
name: oc-mongo
description: A Helm chart for deploying the oc-mongo component
version: 0.1.0
appVersion: "1.0"

View File

@ -0,0 +1,10 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ .Values.persistence.name }}
spec:
accessModes:
- {{ .Values.persistence.accessMode }}
resources:
requests:
storage: {{ .Values.persistence.size }}

View File

@ -0,0 +1,8 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ .Release.Name }}-mongo-secret
type: Opaque
data:
username: {{ .Values.secret.username }}
password: {{ .Values.secret.password }}

View File

@ -0,0 +1,11 @@
apiVersion: v1
kind: Service
metadata:
name: mongo
spec:
selector:
app: mongo
ports:
- protocol: TCP
port: {{ .Values.service.port }}
targetPort: {{ .Values.service.port }}

View File

@ -0,0 +1,31 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ .Release.Name }}-mongo
labels:
app: mongo
spec:
serviceName: "{{ .Release.Name }}-mongo"
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: mongo
template:
metadata:
labels:
app: mongo
spec:
containers:
- name: mongo
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
ports:
- containerPort: 27017
volumeMounts:
- name: mongo-persistent-storage
mountPath: /data/db
- name: mongo-persistent-storage
mountPath: /data/configdb
volumes:
- name: mongo-persistent-storage
persistentVolumeClaim:
claimName: {{ .Values.persistence.name }}

19
Helm/oc-mongo/values.yaml Normal file
View File

@ -0,0 +1,19 @@
replicaCount: 1
image:
repository: mongo
tag: latest
pullPolicy: IfNotPresent
service:
port: 27017
persistence:
name: mongo-pvc-helm
enabled: true
accessMode: ReadWriteOnce
size: 1Gi
secret:
username: dGVzdA== # base64 encoding of 'test'
password: dGVzdA== # base64 encoding of 'test'

View File

@ -0,0 +1,29 @@
# oc-catalog-deployment.yml
apiVersion: apps/v1
kind: Deployment
metadata:
name: oc-catalog
labels:
app: oc-catalog
spec:
replicas: 1
selector:
matchLabels:
app: oc-catalog
template:
metadata:
labels:
app: oc-catalog
spec:
containers:
- name: oc-catalog
image: registry.dev.svc.cluster.local:5000/oc-catalog:latest
ports:
- containerPort: 8080
env:
- name: MONGO_DATABASE
value: "DC_myDC"
- name: MONGO_URI
value: "mongodb://mongo:27017"
imagePullSecrets:
- name: regcred

View File

@ -0,0 +1,13 @@
# oc-catalog-service.yml
apiVersion: v1
kind: Service
metadata:
name: oc-catalog
spec:
selector:
app: oc-catalog
ports:
- protocol: TCP
port: 8087
targetPort: 8080
type: NodePort # Optional, useful for accessing via Minikube IP and NodePort

View File

@ -0,0 +1,32 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: mongo-express
spec:
replicas: 1
selector:
matchLabels:
app: mongo-express
template:
metadata:
labels:
app: mongo-express
spec:
containers:
- name: mongo-express
image: mongo-express:latest
ports:
- containerPort: 8081
env:
- name: ME_CONFIG_BASICAUTH_USERNAME
valueFrom:
secretKeyRef:
name: mongo-secret
key: mongo-username
- name: ME_CONFIG_BASICAUTH_PASSWORD
valueFrom:
secretKeyRef:
name: mongo-secret
key: mongo-password
imagePullSecrets:
- name: my-registry-key

View File

@ -0,0 +1,13 @@
# mongo-express-service.yml
apiVersion: v1
kind: Service
metadata:
name: mongo-express
spec:
selector:
app: mongo-express
ports:
- protocol: TCP
port: 8081
targetPort: 8081
type: NodePort # Optional, useful for accessing via Minikube IP and NodePort

View File

@ -0,0 +1,42 @@
# mongo-deployment.yml
apiVersion: apps/v1
kind: Deployment
metadata:
name: mongo
labels:
app: mongo
spec:
replicas: 1
selector:
matchLabels:
app: mongo
template:
metadata:
labels:
app: mongo
spec:
containers:
- name: mongo
image: mongo:latest
ports:
- containerPort: 27017
volumeMounts:
- name: mongo-persistent-storage
mountPath: /data/db
- name: mongo-persistent-storage
mountPath: /data/configdb
volumes:
- name: mongo-persistent-storage
persistentVolumeClaim:
claimName: mongo-pvc
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mongo-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi

View File

@ -0,0 +1,9 @@
# mongo-secret.yml
apiVersion: v1
kind: Secret
metadata:
name: mongo-secret
type: Opaque
data:
username: dGVzdA== # base64 encoding of 'test'
password: dGVzdA== # base64 encoding of 'test'

View File

@ -0,0 +1,12 @@
# mongo-service.yml
apiVersion: v1
kind: Service
metadata:
name: mongo
spec:
selector:
app: mongo
ports:
- protocol: TCP
port: 27017
targetPort: 27017