From a18e7d2e23cfbfe9eba3045391c69b66c3752e69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20J=C3=B6rg?= Date: Tue, 2 Dec 2025 21:26:17 +0100 Subject: [PATCH] fix: Add inital nexus and update drupal image --- helmfile.d/nexus.yaml.gotmpl | 43 +++++++++++++++++ values/drupal/manifests/raw.yaml | 17 +++++++ values/nexus/env-oceanbox.yaml.gotmpl | 3 ++ values/nexus/env.yaml.gotmpl | 3 ++ values/nexus/manifests/admin-secret.yaml | 8 ++++ values/nexus/manifests/nexus.yaml | 37 +++++++++++++++ values/nexus/values/nexus.yaml.gotmpl | 60 ++++++++++++++++++++++++ 7 files changed, 171 insertions(+) create mode 100644 helmfile.d/nexus.yaml.gotmpl create mode 100644 values/nexus/env-oceanbox.yaml.gotmpl create mode 100644 values/nexus/env.yaml.gotmpl create mode 100644 values/nexus/manifests/admin-secret.yaml create mode 100644 values/nexus/manifests/nexus.yaml create mode 100644 values/nexus/values/nexus.yaml.gotmpl diff --git a/helmfile.d/nexus.yaml.gotmpl b/helmfile.d/nexus.yaml.gotmpl new file mode 100644 index 00000000..8a43182b --- /dev/null +++ b/helmfile.d/nexus.yaml.gotmpl @@ -0,0 +1,43 @@ +bases: + - ../envs/environments.yaml.gotmpl + +repositories: + - name: stevehipwell + url: 'https://stevehipwell.github.io/helm-charts/' + +commonLabels: + tier: system + +releases: +- name: nexus3 + namespace: nexus + chart: stevehipwell/nexus3 + version: 5.9.0 + condition: nexus.enabled + values: + - ../values/nexus/values/nexus.yaml.gotmpl + - ../values/nexus/values/nexus-{{ .Environment.Name }}.yaml.gotmpl + postRenderer: ../bin/kustomizer + postRendererArgs: + - ../values/nexus/kustomize/{{ .Environment.Name }} + missingFileHandler: Info +- name: manifests + namespace: nexus + chart: manifests + condition: nexus.enabled + missingFileHandler: Info + values: + - ../values/env.yaml + - ../values/env-{{ requiredEnv "ARGOCD_ENV_CLUSTER_NAME" }}.yaml + - ../values/nexus/env.yaml.gotmpl + - ../values/nexus/env-{{ requiredEnv "ARGOCD_ENV_CLUSTER_NAME" }}.yaml.gotmpl + hooks: + - events: [ prepare, cleanup ] + showlogs: true + command: ../bin/helmify + args: + - '{{`{{ if eq .Event.Name "prepare" }}build{{ else }}clean{{ end }}`}}' + - '{{`{{ .Release.Chart }}`}}' + - '{{`{{ .Environment.Name }}`}}' + - ../values/nexus/manifests + - manifests diff --git a/values/drupal/manifests/raw.yaml b/values/drupal/manifests/raw.yaml index 61bdd712..74a8ec3e 100644 --- a/values/drupal/manifests/raw.yaml +++ b/values/drupal/manifests/raw.yaml @@ -60,6 +60,23 @@ spec: - containerPort: 80 name: http protocol: TCP + env: + - name: DRUPAL_DATABASE_HOST + value: drupal-db-rw + - name: DRUPAL_DATABASE_PREFIX + value: "" + - name: DRUPAL_DATABASE_NAME + value: app + - name: DRUPAL_DATABASE_USERNAME + valueFrom: + secretKeyRef: + name: drupal-db-app + key: username + - name: DRUPAL_DATABASE_PASSWORD + valueFrom: + secretKeyRef: + name: drupal-db-app + key: password volumeMounts: - mountPath: /var/www/html/modules name: drupal diff --git a/values/nexus/env-oceanbox.yaml.gotmpl b/values/nexus/env-oceanbox.yaml.gotmpl new file mode 100644 index 00000000..1377cf4a --- /dev/null +++ b/values/nexus/env-oceanbox.yaml.gotmpl @@ -0,0 +1,3 @@ +nexus: + enabled: true + autosync: true diff --git a/values/nexus/env.yaml.gotmpl b/values/nexus/env.yaml.gotmpl new file mode 100644 index 00000000..c61fb56a --- /dev/null +++ b/values/nexus/env.yaml.gotmpl @@ -0,0 +1,3 @@ +nexus: + enabled: false + autosync: false diff --git a/values/nexus/manifests/admin-secret.yaml b/values/nexus/manifests/admin-secret.yaml new file mode 100644 index 00000000..88fbcc41 --- /dev/null +++ b/values/nexus/manifests/admin-secret.yaml @@ -0,0 +1,8 @@ +apiVersion: v1 +kind: Secret +metadata: + name: nexus-admin-password + namespace: nexus +type: Opaque +stringData: + password: "changeme-admin-password-here" diff --git a/values/nexus/manifests/nexus.yaml b/values/nexus/manifests/nexus.yaml new file mode 100644 index 00000000..d75384dd --- /dev/null +++ b/values/nexus/manifests/nexus.yaml @@ -0,0 +1,37 @@ +{{- if .Values.clusterConfig.argo.enabled }} +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: nexus + namespace: argocd +spec: + destination: + namespace: nexus + server: 'https://kubernetes.default.svc' + sources: + - repoURL: {{ .Values.clusterConfig.manifests }} + targetRevision: HEAD + path: helmfile.d + plugin: + name: helmfile-cmp + env: + - name: CLUSTER_NAME + value: {{ .Values.clusterConfig.cluster }} + - name: HELMFILE_ENVIRONMENT + value: default + - name: HELMFILE_FILE_PATH + value: nexus.yaml.gotmpl + project: sys + syncPolicy: + managedNamespaceMetadata: + labels: + component: sys + syncOptions: + - CreateNamespace=true + - ApplyOutOfSyncOnly=true + - ServerSideApply=true + {{- if .Values.nexus.autosync }} + automated: + prune: true + {{- end }} +{{- end }} diff --git a/values/nexus/values/nexus.yaml.gotmpl b/values/nexus/values/nexus.yaml.gotmpl new file mode 100644 index 00000000..cc517c4d --- /dev/null +++ b/values/nexus/values/nexus.yaml.gotmpl @@ -0,0 +1,60 @@ +image: + tag: 3.74.0 + +ingress: + enabled: true + ingressClassName: nginx + hosts: + - host: mochi.tos.oceanbox.io + paths: + - path: / + pathType: Prefix + tls: + - secretName: nexus-tls + hosts: + - mochi.tos.oceanbox.io + +persistence: + enabled: true + storageClass: "ceph-rbd" + size: 8Gi + +env: + - name: INSTALL4J_ADD_VM_PARAMS + value: "-Xms1024m -Xmx1024m -XX:MaxDirectMemorySize=1024m -Djava.util.prefs.userRoot=/nexus-data/javaprefs" + +resources: + requests: + cpu: 200m + memory: 1Gi + limits: + memory: 1Gi + +config: + enabled: true + data: + nexus.properties: | + nexus.s3.blobstore.enabled=true + rootPassword: + secret: nexus-admin-password + key: password + +serviceAccount: + create: true + +additionalConfigMaps: + - name: nexus-s3-config + data: + s3-blobstore.json: | + { + "name": "s3-nuget", + "type": "S3", + "attributes": { + "s3": { + "bucket": "nexus-nuget-registry", + "region": "us-east-1", + "prefix": "nuget/", + "expiration": -1 + } + } + }