diff --git a/helm-chart/public/oneuptime/templates/_helpers.tpl b/helm-chart/public/oneuptime/templates/_helpers.tpl index 19069f1920..034acacb95 100644 --- a/helm-chart/public/oneuptime/templates/_helpers.tpl +++ b/helm-chart/public/oneuptime/templates/_helpers.tpl @@ -4,7 +4,7 @@ Expand the name of the chart. */}} {{- define "oneuptime.mongodbConnectionString" -}} -{{ printf "mongodb://%s:%s@%s-%s.%s-%s.%s.%s:%s,%s-%s.%s-%s.%s.%s:%s/%s?replicaSet=%s" $.Values.mongodb.auth.username $.Values.mongodb.auth.password $.Release.Name "mongodb-0" $.Release.Name "mongodb-headless" $.Release.Namespace "svc.cluster.local" "27017" $.Release.Name "mongodb-1" $.Release.Name "mongodb-headless" $.Release.Namespace "svc.cluster.local" "27017" $.Values.mongodb.auth.database $.Values.mongodb.replicaSetName }} +{{ printf "mongodb://%s:%s@%s-%s.%s-%s.%s.%s:%s/%s" $.Values.mongo.fyipeDbUsername $.Values.mongo.fyipeDbPassword $.Release.Name "mongo-standalone-0" $.Release.Name "mongo-standalone" $.Release.Namespace "svc.cluster.local" "27017" $.Values.mongo.databaseName }} {{- end -}} {{- define "oneuptime.internalSmtpServer" -}} diff --git a/helm-chart/public/oneuptime/templates/externalMongo.yaml b/helm-chart/public/oneuptime/templates/externalMongo.yaml deleted file mode 100644 index eb3baa74df..0000000000 --- a/helm-chart/public/oneuptime/templates/externalMongo.yaml +++ /dev/null @@ -1,33 +0,0 @@ -# We don't need this again to expose our mongodb to the outside world -# All the configuration should be done in the values.yaml file -{{- if .Values.mongodb.ingress.enabled }} -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ printf "%s-%s" $.Release.Name "mongo-external" }} - namespace: {{ .Release.Namespace }} - labels: - app.kubernetes.io/part-of: oneuptime - app.kubernetes.io/managed-by: Helm -data: - 27017: {{ printf "%s/$s" $.Release.Namespace "fi-mongodb:27017" }} ---- -apiVersion: v1 -kind: Service -metadata: - name: {{ printf "%s-%s" $.Release.Name "mongo-ingress" }} - namespace: {{ .Release.Namespace }} - labels: - app.kubernetes.io/part-of: oneuptime - app.kubernetes.io/managed-by: Helm -spec: - type: LoadBalancer - ports: - - name: proxied-tcp-27017 - port: 27017 - targetPort: 27017 - protocol: TCP - selector: - app: mongodb -{{- end }} ---- \ No newline at end of file diff --git a/helm-chart/public/oneuptime/templates/mongo.yaml b/helm-chart/public/oneuptime/templates/mongo.yaml new file mode 100644 index 0000000000..f1178c3930 --- /dev/null +++ b/helm-chart/public/oneuptime/templates/mongo.yaml @@ -0,0 +1,58 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ printf "%s-%s" .Release.Name "mongo-standalone" }} + namespace: {{ .Release.Namespace }} + labels: + app: {{ printf "%s-%s" .Release.Name "mongo-standalone" }} + app.kubernetes.io/part-of: fyipe + app.kubernetes.io/managed-by: Helm + name: {{ printf "%s-%s" .Release.Name "mongo-standalone" }} +spec: + ports: + - port: 17564 + targetPort: 27017 + type: ClusterIP + selector: + role: {{ printf "%s-%s" .Release.Name "mongo-standalone" }} +--- + +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: {{ printf "%s-%s" .Release.Name "mongo-standalone" }} +spec: + serviceName: {{ printf "%s-%s" .Release.Name "mongo-standalone" }} + replicas: 1 + selector: + matchLabels: + role: {{ printf "%s-%s" .Release.Name "mongo-standalone" }} + template: + metadata: + labels: + role: {{ printf "%s-%s" .Release.Name "mongo-standalone" }} + spec: + terminationGracePeriodSeconds: 10 + containers: + - name: {{ printf "%s-%s" .Release.Name "mongo-standalone" }} + image: mongo:latest + command: + - "mongod" + - "--bind_ip" + - "0.0.0.0" + - "--auth" + ports: + - containerPort: 27017 + volumeMounts: + - name: mongo-standalone-persistent-storage-claim + mountPath: /data/db + volumeClaimTemplates: + - metadata: + name: mongo-standalone-persistent-storage-claim + annotations: + volume.beta.kubernetes.io/storage-class: "gp2" + spec: + accessModes: [ "ReadWriteOnce" ] + resources: + requests: + storage: 1000Gi \ No newline at end of file diff --git a/helm-chart/public/oneuptime/values.yaml b/helm-chart/public/oneuptime/values.yaml index 95c0482798..4d8c4cd217 100644 --- a/helm-chart/public/oneuptime/values.yaml +++ b/helm-chart/public/oneuptime/values.yaml @@ -120,50 +120,12 @@ redis: mountPath: /bitnami/redis size: 20Gi - -mongodb: - architecture: replicaset - auth: - enabled: true - rootPassword: root - username: oneuptime - password: password - database: oneuptimedb - replicaSetKey: mongodboneuptime - replicaSetName: rs0 - replicaCount: 2 - replicaSetHostnames: true - arbiter: - enabled: true - image: - registry: docker.io - repository: bitnami/mongodb - tag: latest - pullPolicy: Always - # Uncomment this field to enable external access - # to mongodb database - # If the mongodb is failing to initialise, comment out the variable below {externalAccess, serviceAccount, rbac} - # After reinstall the project again - # Once deployed successfully, uncomment the variables and upgrade the project - externalAccess: - enabled: true - service: - type: LoadBalancer - port: 27017 - autoDiscovery: - enabled: true - serviceAccount: - create: true - rbac: - create: true - # end of file for external access selectors - persistence: - enabled: true - mountPath: /bitnami/mongodb - size: 1000Gi - useStatefulSet: true - ingress: - enabled: false +mongo: + fyipeDbUsername: fyipe + fyipeDbPassword: password + databaseName: fyipedb + rootUsername: root + rootPassword: root ## Service Configuration ## For minikube, set service.type to NodePort, elsewhere use LoadBalancer