From 18c59333075bb237d800a28bfedfb9c830b94ac1 Mon Sep 17 00:00:00 2001 From: domrichardson <100129001+domrichardson@users.noreply.github.com> Date: Mon, 30 Mar 2026 11:27:28 +0100 Subject: [PATCH] first commit --- .gitignore | 1 + notely/Chart.yaml | 6 ++ notely/README.md | 69 ++++++++++++++ notely/templates/NOTES.txt | 5 + notely/templates/_helpers.tpl | 58 +++++++++++ notely/templates/app-deployment.yaml | 69 ++++++++++++++ notely/templates/app-service.yaml | 15 +++ notely/templates/configmap.yaml | 12 +++ notely/templates/hpa.yaml | 28 ++++++ notely/templates/ingress.yaml | 35 +++++++ notely/templates/mongodb-pvc.yaml | 17 ++++ notely/templates/mongodb-secret.yaml | 12 +++ notely/templates/mongodb-service.yaml | 18 ++++ notely/templates/mongodb-statefulset.yaml | 74 +++++++++++++++ notely/templates/redis-deployment.yaml | 90 ++++++++++++++++++ notely/templates/redis-service.yaml | 18 ++++ notely/templates/secret.yaml | 16 ++++ notely/templates/serviceaccount.yaml | 13 +++ notely/values.yaml | 111 ++++++++++++++++++++++ 19 files changed, 667 insertions(+) create mode 100644 .gitignore create mode 100644 notely/Chart.yaml create mode 100644 notely/README.md create mode 100644 notely/templates/NOTES.txt create mode 100644 notely/templates/_helpers.tpl create mode 100644 notely/templates/app-deployment.yaml create mode 100644 notely/templates/app-service.yaml create mode 100644 notely/templates/configmap.yaml create mode 100644 notely/templates/hpa.yaml create mode 100644 notely/templates/ingress.yaml create mode 100644 notely/templates/mongodb-pvc.yaml create mode 100644 notely/templates/mongodb-secret.yaml create mode 100644 notely/templates/mongodb-service.yaml create mode 100644 notely/templates/mongodb-statefulset.yaml create mode 100644 notely/templates/redis-deployment.yaml create mode 100644 notely/templates/redis-service.yaml create mode 100644 notely/templates/secret.yaml create mode 100644 notely/templates/serviceaccount.yaml create mode 100644 notely/values.yaml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..446b076 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +notely/values.testing.yaml diff --git a/notely/Chart.yaml b/notely/Chart.yaml new file mode 100644 index 0000000..47aa7ff --- /dev/null +++ b/notely/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: notely +description: Helm chart for deploying Notely (notely) with MongoDB and optional Redis +type: application +version: 0.1.0 +appVersion: "latest" diff --git a/notely/README.md b/notely/README.md new file mode 100644 index 0000000..1eee12a --- /dev/null +++ b/notely/README.md @@ -0,0 +1,69 @@ +# notely Helm Chart + +This chart deploys Notely (notely) and can also provision MongoDB and Redis. + +## What this chart creates + +- notely Deployment and Service +- ConfigMap and Secret for application configuration +- Optional MongoDB StatefulSet, Service, Secret, and PVC +- Optional Redis Deployment and Service +- Optional Ingress +- Optional HPA + +## Install + +```bash +helm install notely ./notely -n notely --create-namespace +``` + +## Upgrade + +```bash +helm upgrade notely ./notely -n notely +``` + +## Uninstall + +```bash +helm uninstall notely -n notely +``` + +## Important values + +- `image.repository`, `image.tag` +- `secrets.jwtSecret`, `secrets.encryptionKey` +- `secrets.defaultAdminEmail`, `secrets.defaultAdminUsername`, `secrets.defaultAdminPassword` +- `secrets.redisUser`, `secrets.redisPassword` +- `mongodb.enabled` and `mongodb.auth.*` +- `redis.enabled` and `redis.auth.enabled` +- `ingress.enabled` +- `autoscaling.enabled` + +## Example override file + +```yaml +image: + repository: your-registry/notely + tag: v1.0.0 + +secrets: + jwtSecret: replace-with-production-secret + encryptionKey: 32-char-encryption-key-goes-here + defaultAdminEmail: admin@example.com + defaultAdminUsername: admin + defaultAdminPassword: replace-with-strong-password + +ingress: + enabled: true + className: nginx + annotations: + nginx.ingress.kubernetes.io/ssl-redirect: "false" + hosts: + - host: notely.local + paths: + - path: /api + pathType: Prefix + - path: / + pathType: Prefix +``` diff --git a/notely/templates/NOTES.txt b/notely/templates/NOTES.txt new file mode 100644 index 0000000..7b5950e --- /dev/null +++ b/notely/templates/NOTES.txt @@ -0,0 +1,5 @@ +1. Get the application URL by running these commands: + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "notely.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT diff --git a/notely/templates/_helpers.tpl b/notely/templates/_helpers.tpl new file mode 100644 index 0000000..8513bb9 --- /dev/null +++ b/notely/templates/_helpers.tpl @@ -0,0 +1,58 @@ +{{/* Expand the name of the chart. */}} +{{- define "notely.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* Create a default fully qualified app name. */}} +{{- define "notely.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* Create chart name and version as used by the chart label. */}} +{{- define "notely.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* Common labels. */}} +{{- define "notely.labels" -}} +helm.sh/chart: {{ include "notely.chart" . }} +{{ include "notely.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* Selector labels. */}} +{{- define "notely.selectorLabels" -}} +app.kubernetes.io/name: {{ include "notely.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* Create the name of the service account to use */}} +{{- define "notely.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "notely.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} + +{{/* MongoDB resource name */}} +{{- define "notely.mongodb.fullname" -}} +{{- printf "%s-mongodb" (include "notely.fullname" .) | trunc 63 | trimSuffix "-" -}} +{{- end }} + +{{/* Redis resource name */}} +{{- define "notely.redis.fullname" -}} +{{- printf "%s-redis" (include "notely.fullname" .) | trunc 63 | trimSuffix "-" -}} +{{- end }} diff --git a/notely/templates/app-deployment.yaml b/notely/templates/app-deployment.yaml new file mode 100644 index 0000000..fdc8456 --- /dev/null +++ b/notely/templates/app-deployment.yaml @@ -0,0 +1,69 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "notely.fullname" . }} + labels: + {{- include "notely.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "notely.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "notely.selectorLabels" . | nindent 8 }} + {{- with .Values.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + serviceAccountName: {{ include "notely.serviceAccountName" . }} + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + containers: + - name: {{ include "notely.name" . }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: {{ .Values.service.port }} + protocol: TCP + envFrom: + - configMapRef: + name: {{ include "notely.fullname" . }}-config + - secretRef: + name: {{ include "notely.fullname" . }}-secrets + livenessProbe: + httpGet: + path: /health + port: http + initialDelaySeconds: 30 + periodSeconds: 10 + readinessProbe: + httpGet: + path: /health + port: http + initialDelaySeconds: 5 + periodSeconds: 5 + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/notely/templates/app-service.yaml b/notely/templates/app-service.yaml new file mode 100644 index 0000000..f868a06 --- /dev/null +++ b/notely/templates/app-service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "notely.fullname" . }} + labels: + {{- include "notely.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "notely.selectorLabels" . | nindent 4 }} diff --git a/notely/templates/configmap.yaml b/notely/templates/configmap.yaml new file mode 100644 index 0000000..7b8c7a4 --- /dev/null +++ b/notely/templates/configmap.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "notely.fullname" . }}-config + labels: + {{- include "notely.labels" . | nindent 4 }} +data: + PORT: {{ .Values.appConfig.port | quote }} + FRONTEND_URL: {{ .Values.appConfig.frontendUrl | quote }} + SESSION_TTL_HOURS: {{ .Values.appConfig.sessionTtlHours | quote }} + REDIS_DB: {{ .Values.appConfig.redisDb | quote }} + REDIS_ADDR: {{- if .Values.appConfig.redisAddr }} {{ .Values.appConfig.redisAddr | quote }} {{- else if .Values.redis.enabled }} {{ printf "%s:%v" (include "notely.redis.fullname" .) .Values.redis.service.port | quote }} {{- else }} "" {{- end }} diff --git a/notely/templates/hpa.yaml b/notely/templates/hpa.yaml new file mode 100644 index 0000000..87f6782 --- /dev/null +++ b/notely/templates/hpa.yaml @@ -0,0 +1,28 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "notely.fullname" . }} + labels: + {{- include "notely.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "notely.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: memory + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} +{{- end }} diff --git a/notely/templates/ingress.yaml b/notely/templates/ingress.yaml new file mode 100644 index 0000000..f550cd2 --- /dev/null +++ b/notely/templates/ingress.yaml @@ -0,0 +1,35 @@ +{{- if .Values.ingress.enabled }} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ include "notely.fullname" . }} + labels: + {{- include "notely.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if .Values.ingress.className }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + pathType: {{ .pathType }} + backend: + service: + name: {{ include "notely.fullname" $ }} + port: + number: {{ $.Values.service.port }} + {{- end }} + {{- end }} + {{- with .Values.ingress.tls }} + tls: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/notely/templates/mongodb-pvc.yaml b/notely/templates/mongodb-pvc.yaml new file mode 100644 index 0000000..f09e42f --- /dev/null +++ b/notely/templates/mongodb-pvc.yaml @@ -0,0 +1,17 @@ +{{- if and .Values.mongodb.enabled .Values.mongodb.persistence.enabled }} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "notely.mongodb.fullname" . }}-pvc + labels: + {{- include "notely.labels" . | nindent 4 }} +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: {{ .Values.mongodb.persistence.size }} + {{- if .Values.mongodb.persistence.storageClass }} + storageClassName: {{ .Values.mongodb.persistence.storageClass | quote }} + {{- end }} +{{- end }} diff --git a/notely/templates/mongodb-secret.yaml b/notely/templates/mongodb-secret.yaml new file mode 100644 index 0000000..ca71d6d --- /dev/null +++ b/notely/templates/mongodb-secret.yaml @@ -0,0 +1,12 @@ +{{- if .Values.mongodb.enabled }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "notely.mongodb.fullname" . }}-credentials + labels: + {{- include "notely.labels" . | nindent 4 }} +type: Opaque +stringData: + username: {{ .Values.mongodb.auth.username | quote }} + password: {{ .Values.mongodb.auth.password | quote }} +{{- end }} diff --git a/notely/templates/mongodb-service.yaml b/notely/templates/mongodb-service.yaml new file mode 100644 index 0000000..d4cb1f0 --- /dev/null +++ b/notely/templates/mongodb-service.yaml @@ -0,0 +1,18 @@ +{{- if .Values.mongodb.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: {{ include "notely.mongodb.fullname" . }} + labels: + {{- include "notely.labels" . | nindent 4 }} +spec: + clusterIP: None + ports: + - port: 27017 + targetPort: mongodb + protocol: TCP + name: mongodb + selector: + app.kubernetes.io/name: {{ include "notely.name" . }}-mongodb + app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} diff --git a/notely/templates/mongodb-statefulset.yaml b/notely/templates/mongodb-statefulset.yaml new file mode 100644 index 0000000..9d709ad --- /dev/null +++ b/notely/templates/mongodb-statefulset.yaml @@ -0,0 +1,74 @@ +{{- if .Values.mongodb.enabled }} +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: {{ include "notely.mongodb.fullname" . }} + labels: + {{- include "notely.labels" . | nindent 4 }} +spec: + serviceName: {{ include "notely.mongodb.fullname" . }} + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/name: {{ include "notely.name" . }}-mongodb + app.kubernetes.io/instance: {{ .Release.Name }} + template: + metadata: + labels: + app.kubernetes.io/name: {{ include "notely.name" . }}-mongodb + app.kubernetes.io/instance: {{ .Release.Name }} + spec: + containers: + - name: mongodb + image: "{{ .Values.mongodb.image.repository }}:{{ .Values.mongodb.image.tag }}" + imagePullPolicy: {{ .Values.mongodb.image.pullPolicy }} + ports: + - containerPort: 27017 + name: mongodb + env: + - name: MONGO_INITDB_ROOT_USERNAME + valueFrom: + secretKeyRef: + name: {{ include "notely.mongodb.fullname" . }}-credentials + key: username + - name: MONGO_INITDB_ROOT_PASSWORD + valueFrom: + secretKeyRef: + name: {{ include "notely.mongodb.fullname" . }}-credentials + key: password + - name: MONGO_INITDB_DATABASE + value: {{ .Values.mongodb.auth.database | quote }} + volumeMounts: + - name: mongodb-storage + mountPath: /data/db + livenessProbe: + exec: + command: + - sh + - -c + - mongosh "mongodb://${MONGO_INITDB_ROOT_USERNAME}:${MONGO_INITDB_ROOT_PASSWORD}@localhost:27017/admin?authSource=admin" --quiet --eval "db.adminCommand('ping').ok" + initialDelaySeconds: 30 + timeoutSeconds: 5 + periodSeconds: 10 + readinessProbe: + exec: + command: + - sh + - -c + - mongosh "mongodb://${MONGO_INITDB_ROOT_USERNAME}:${MONGO_INITDB_ROOT_PASSWORD}@localhost:27017/admin?authSource=admin" --quiet --eval "db.adminCommand('ping').ok" + initialDelaySeconds: 5 + timeoutSeconds: 5 + periodSeconds: 5 + resources: + {{- toYaml .Values.mongodb.resources | nindent 12 }} + {{- if .Values.mongodb.persistence.enabled }} + volumes: + - name: mongodb-storage + persistentVolumeClaim: + claimName: {{ include "notely.mongodb.fullname" . }}-pvc + {{- else }} + volumes: + - name: mongodb-storage + emptyDir: {} + {{- end }} +{{- end }} diff --git a/notely/templates/redis-deployment.yaml b/notely/templates/redis-deployment.yaml new file mode 100644 index 0000000..1d5eac9 --- /dev/null +++ b/notely/templates/redis-deployment.yaml @@ -0,0 +1,90 @@ +{{- if .Values.redis.enabled }} +{{- $redisUser := .Values.secrets.redisUser | default "" }} +{{- $redisPassword := .Values.secrets.redisPassword | default "" }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "notely.redis.fullname" . }} + labels: + {{- include "notely.labels" . | nindent 4 }} +spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/name: {{ include "notely.name" . }}-redis + app.kubernetes.io/instance: {{ .Release.Name }} + template: + metadata: + labels: + app.kubernetes.io/name: {{ include "notely.name" . }}-redis + app.kubernetes.io/instance: {{ .Release.Name }} + spec: + containers: + - name: redis + image: "{{ .Values.redis.image.repository }}:{{ .Values.redis.image.tag }}" + imagePullPolicy: {{ .Values.redis.image.pullPolicy }} + envFrom: + - secretRef: + name: {{ include "notely.fullname" . }}-secrets + {{- if .Values.redis.auth.enabled }} + {{- if $redisUser }} + command: + - sh + - -c + - | + cat < /tmp/users.acl + user default off + user ${REDIS_USER} on >${REDIS_PASSWORD} ~* &* +@all + EOF + exec redis-server --aclfile /tmp/users.acl + {{- else }} + command: + - redis-server + - --requirepass + - {{ required "secrets.redisPassword must be set when redis.auth.enabled=true" $redisPassword | quote }} + {{- end }} + {{- end }} + ports: + - containerPort: {{ .Values.redis.service.port }} + name: redis + livenessProbe: + exec: + command: + {{- if .Values.redis.auth.enabled }} + {{- if $redisUser }} + - sh + - -c + - redis-cli --user "$REDIS_USER" -a "$REDIS_PASSWORD" ping + {{- else }} + - sh + - -c + - redis-cli -a "$REDIS_PASSWORD" ping + {{- end }} + {{- else }} + - redis-cli + - ping + {{- end }} + initialDelaySeconds: 10 + periodSeconds: 10 + readinessProbe: + exec: + command: + {{- if .Values.redis.auth.enabled }} + {{- if $redisUser }} + - sh + - -c + - redis-cli --user "$REDIS_USER" -a "$REDIS_PASSWORD" ping + {{- else }} + - sh + - -c + - redis-cli -a "$REDIS_PASSWORD" ping + {{- end }} + {{- else }} + - redis-cli + - ping + {{- end }} + initialDelaySeconds: 5 + periodSeconds: 5 + resources: + {{- toYaml .Values.redis.resources | nindent 12 }} +{{- end }} diff --git a/notely/templates/redis-service.yaml b/notely/templates/redis-service.yaml new file mode 100644 index 0000000..e345066 --- /dev/null +++ b/notely/templates/redis-service.yaml @@ -0,0 +1,18 @@ +{{- if .Values.redis.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: {{ include "notely.redis.fullname" . }} + labels: + {{- include "notely.labels" . | nindent 4 }} +spec: + type: ClusterIP + ports: + - port: {{ .Values.redis.service.port }} + targetPort: redis + protocol: TCP + name: redis + selector: + app.kubernetes.io/name: {{ include "notely.name" . }}-redis + app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} diff --git a/notely/templates/secret.yaml b/notely/templates/secret.yaml new file mode 100644 index 0000000..cdc9885 --- /dev/null +++ b/notely/templates/secret.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "notely.fullname" . }}-secrets + labels: + {{- include "notely.labels" . | nindent 4 }} +type: Opaque +stringData: + JWT_SECRET: {{ .Values.secrets.jwtSecret | quote }} + ENCRYPTION_KEY: {{ .Values.secrets.encryptionKey | quote }} + DEFAULT_ADMIN_EMAIL: {{ .Values.secrets.defaultAdminEmail | quote }} + DEFAULT_ADMIN_USERNAME: {{ .Values.secrets.defaultAdminUsername | quote }} + DEFAULT_ADMIN_PASSWORD: {{ .Values.secrets.defaultAdminPassword | quote }} + REDIS_USER: {{- if and .Values.redis.enabled (not .Values.redis.auth.enabled) }} "" {{- else }} {{ .Values.secrets.redisUser | quote }} {{- end }} + REDIS_PASSWORD: {{- if and .Values.redis.enabled (not .Values.redis.auth.enabled) }} "" {{- else }} {{ .Values.secrets.redisPassword | quote }} {{- end }} + MONGODB_URI: {{- if .Values.mongodb.enabled }} {{ printf "mongodb://%s:%s@%s:27017/%s?authSource=admin" .Values.mongodb.auth.username .Values.mongodb.auth.password (include "notely.mongodb.fullname" .) .Values.mongodb.auth.database | quote }} {{- else }} {{ .Values.secrets.mongodbUri | quote }} {{- end }} diff --git a/notely/templates/serviceaccount.yaml b/notely/templates/serviceaccount.yaml new file mode 100644 index 0000000..5af4229 --- /dev/null +++ b/notely/templates/serviceaccount.yaml @@ -0,0 +1,13 @@ +{{- if .Values.serviceAccount.create }} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "notely.serviceAccountName" . }} + labels: + {{- include "notely.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +automountServiceAccountToken: {{ .Values.serviceAccount.automount }} +{{- end }} diff --git a/notely/values.yaml b/notely/values.yaml new file mode 100644 index 0000000..e032727 --- /dev/null +++ b/notely/values.yaml @@ -0,0 +1,111 @@ +replicaCount: 2 + +nameOverride: "" +fullnameOverride: "" + +image: + repository: gitea.hostxtra.co.uk/mrhid6/notely + tag: latest + pullPolicy: IfNotPresent + +imagePullSecrets: [] + +podAnnotations: {} +podLabels: {} + +serviceAccount: + create: false + automount: true + annotations: {} + name: "" + +service: + type: ClusterIP + port: 8080 + +resources: + requests: + cpu: 100m + memory: 256Mi + limits: + cpu: 500m + memory: 512Mi + +appConfig: + port: "8080" + frontendUrl: "http://localhost" + sessionTtlHours: "168" + redisAddr: "" + redisDb: "0" + +secrets: + jwtSecret: "change-me-super-secret-jwt-key-minimum-32-characters" + encryptionKey: "00000000000000000000000000000000" + defaultAdminEmail: "admin@notely.local" + defaultAdminUsername: "admin" + defaultAdminPassword: "ChangeThisAdminPassword123!" + mongodbUri: "" + redisUser: "" + redisPassword: "" + +mongodb: + enabled: true + image: + repository: mongo + tag: "8.0" + pullPolicy: IfNotPresent + auth: + username: admin + password: password + database: notely + persistence: + enabled: true + storageClass: "" + size: 10Gi + resources: + requests: + cpu: 100m + memory: 256Mi + limits: + cpu: 500m + memory: 512Mi + +redis: + enabled: true + image: + repository: redis + tag: 8-alpine + pullPolicy: IfNotPresent + service: + port: 6379 + auth: + enabled: false + resources: + requests: + cpu: 50m + memory: 64Mi + limits: + cpu: 250m + memory: 256Mi + +ingress: + enabled: false + className: nginx + annotations: {} + hosts: + - host: notely.local + paths: + - path: / + pathType: Prefix + tls: [] + +autoscaling: + enabled: false + minReplicas: 2 + maxReplicas: 10 + targetCPUUtilizationPercentage: 70 + targetMemoryUtilizationPercentage: 80 + +nodeSelector: {} +tolerations: [] +affinity: {}