diff --git a/helm/oc-catalog/templates/statefulset.yml b/helm/oc-catalog/templates/deployment.yml similarity index 50% rename from helm/oc-catalog/templates/statefulset.yml rename to helm/oc-catalog/templates/deployment.yml index 47aeb40..b7d9b61 100644 --- a/helm/oc-catalog/templates/statefulset.yml +++ b/helm/oc-catalog/templates/deployment.yml @@ -1,33 +1,38 @@ apiVersion: apps/v1 -kind: StatefulSet +kind: Deployment metadata: - name: {{ .Release.Name }}-oc-catalog + name: oc-catalog labels: app: oc-catalog + chart: {{ .Chart.Name }}-{{ .Chart.Version }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} spec: - serviceName: "{{ .Release.Name }}-oc-catalog" replicas: {{ .Values.replicaCount }} selector: matchLabels: app: oc-catalog + release: {{ .Release.Name }} template: metadata: labels: app: oc-catalog + release: {{ .Release.Name }} spec: containers: - name: oc-catalog image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - - containerPort: 8080 + - containerPort: {{ .Values.service.targetPort }} env: - name: MONGO_DATABASE - value: "DC_myDC" + value: {{ .Values.mongo.database }} - name: MONGO_URI - value: "mongodb://mongo:27017" + value: {{ .Values.mongo.uri }} imagePullSecrets: {{- if .Values.imagePullSecrets }} - {{- range .Values.imagePullSecrets }} + {{- range .Values.imagePullSecrets }} - name: {{ .name }} - {{- end }} - {{- end }} + {{- end }} + {{- end }} \ No newline at end of file diff --git a/helm/oc-catalog/templates/service.yml b/helm/oc-catalog/templates/service.yml index e290a41..b6714c4 100644 --- a/helm/oc-catalog/templates/service.yml +++ b/helm/oc-catalog/templates/service.yml @@ -1,12 +1,16 @@ apiVersion: v1 kind: Service metadata: - name: {{ .Release.Name }}-oc-catalog + name: oc-catalog + labels: + app: oc-catalog + release: {{ .Release.Name }} spec: - selector: - app: {{ .Chart.Name }} + type: {{ .Values.service.type }} ports: - protocol: TCP port: {{ .Values.service.port }} targetPort: {{ .Values.service.targetPort }} - type: {{ .Values.service.type }} + selector: + app: oc-catalog + release: {{ .Release.Name }} \ No newline at end of file diff --git a/helm/oc-catalog/values.yaml b/helm/oc-catalog/values.yaml index d76b83a..19bcf93 100644 --- a/helm/oc-catalog/values.yaml +++ b/helm/oc-catalog/values.yaml @@ -15,5 +15,4 @@ mongo: uri: mongodb://mongo:27017 imagePullSecrets: - - name: regcred - + - name: regcred \ No newline at end of file diff --git a/helm/oc-mongo-express/templates/statefulset.yaml b/helm/oc-mongo-express/templates/.statefulset.yaml similarity index 100% rename from helm/oc-mongo-express/templates/statefulset.yaml rename to helm/oc-mongo-express/templates/.statefulset.yaml diff --git a/helm/oc-mongo-express/templates/deployment.yaml b/helm/oc-mongo-express/templates/deployment.yaml new file mode 100644 index 0000000..d6bc2e4 --- /dev/null +++ b/helm/oc-mongo-express/templates/deployment.yaml @@ -0,0 +1,34 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: oc-catalog +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + app: {{ include "mongo-express.name" . }} + template: + metadata: + labels: + app: {{ include "mongo-express.name" . }} + spec: + containers: + - name: mongo-express + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + ports: + - containerPort: {{ .Values.service.port }} + env: + - name: ME_CONFIG_BASICAUTH_USERNAME + valueFrom: + secretKeyRef: + name: {{ .Values.env.secretName }} + key: {{ .Values.env.usernameSecret }} + - name: ME_CONFIG_BASICAUTH_PASSWORD + valueFrom: + secretKeyRef: + name: {{ .Values.env.secretName }} + key: {{ .Values.env.passwordSecret }} + imagePullSecrets: + {{- if .Values.imagePullSecrets }} + {{- toYaml .Values.imagePullSecrets | nindent 8 }} + {{- end }} diff --git a/helm/oc-mongo-express/values.yaml b/helm/oc-mongo-express/values.yaml index ba764ee..1d2a119 100644 --- a/helm/oc-mongo-express/values.yaml +++ b/helm/oc-mongo-express/values.yaml @@ -16,3 +16,4 @@ imagePullSecrets: secret: usernameKey: mongo-username passwordKey: mongo-password + secretName: mongo-secret diff --git a/helm/oc-mongo/templates/pvc.yaml b/helm/oc-mongo/templates/pvc.yaml index b039407..b4fe141 100644 --- a/helm/oc-mongo/templates/pvc.yaml +++ b/helm/oc-mongo/templates/pvc.yaml @@ -1,10 +1,16 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: {{ .Values.persistence.name }} + name: {{ .Values.mongo.pvcName }} + labels: + app: mongo + release: {{ .Release.Name }} spec: accessModes: - {{ .Values.persistence.accessMode }} resources: requests: storage: {{ .Values.persistence.size }} + {{- if .Values.persistence.storageClass }} + storageClassName: {{ .Values.persistence.storageClass }} + {{- end }} diff --git a/helm/oc-mongo/templates/secret.yaml b/helm/oc-mongo/templates/secret.yaml index 459dc2a..46aa0a3 100644 --- a/helm/oc-mongo/templates/secret.yaml +++ b/helm/oc-mongo/templates/secret.yaml @@ -2,7 +2,10 @@ apiVersion: v1 kind: Secret metadata: name: {{ .Release.Name }}-mongo-secret + labels: + app: mongo + release: {{ .Release.Name }} type: Opaque data: - username: {{ .Values.secret.username }} - password: {{ .Values.secret.password }} + username: {{ .Values.secret.username | b64enc }} + password: {{ .Values.secret.password | b64enc }} \ No newline at end of file diff --git a/helm/oc-mongo/templates/service.yaml b/helm/oc-mongo/templates/service.yaml index 26b7b38..1e3316e 100644 --- a/helm/oc-mongo/templates/service.yaml +++ b/helm/oc-mongo/templates/service.yaml @@ -2,10 +2,12 @@ apiVersion: v1 kind: Service metadata: name: mongo + labels: + app: mongo spec: selector: app: mongo ports: - protocol: TCP port: {{ .Values.service.port }} - targetPort: {{ .Values.service.port }} + targetPort: {{ .Values.mongo.containerPort }} diff --git a/helm/oc-mongo/templates/statefulset.yaml b/helm/oc-mongo/templates/statefulset.yaml index 10a0db4..98ee2af 100644 --- a/helm/oc-mongo/templates/statefulset.yaml +++ b/helm/oc-mongo/templates/statefulset.yaml @@ -1,11 +1,11 @@ apiVersion: apps/v1 kind: StatefulSet metadata: - name: {{ .Release.Name }}-mongo + name: mongo labels: app: mongo spec: - serviceName: "{{ .Release.Name }}-mongo" + serviceName: "mongo" replicas: {{ .Values.replicaCount }} selector: matchLabels: diff --git a/helm/oc-mongo/values.yaml b/helm/oc-mongo/values.yaml index faaf58a..b546648 100644 --- a/helm/oc-mongo/values.yaml +++ b/helm/oc-mongo/values.yaml @@ -13,7 +13,12 @@ persistence: enabled: true accessMode: ReadWriteOnce size: 1Gi + storageClass: "" secret: username: dGVzdA== # base64 encoding of 'test' password: dGVzdA== # base64 encoding of 'test' + +mongo: + containerPort: 27017 + pvcName: mongo-pvc-helm \ No newline at end of file