Compare commits

...

225 commits

Author SHA1 Message Date
66e846b44a Merge pull request 'IPCEICIS-2952' (#31) from IPCEICIS-2952 into development
Reviewed-on: #31
Reviewed-by: Daniel.Sy <Daniel.Sy@telekom.de>
2025-05-28 10:30:55 +00:00
5e7fddef33 Merge branch 'development' into IPCEICIS-2952 2025-05-28 09:18:47 +00:00
4888c9db93 Merge pull request 'IPCEICIS-2297_working_oidc' (#30) from IPCEICIS-2297_working_oidc into development
Reviewed-on: #30
2025-04-25 12:11:02 +00:00
ffd5111bce Merge branch 'development' into IPCEICIS-2297_working_oidc 2025-04-25 12:10:06 +00:00
16dde9ead1 final changes 2025-04-25 14:09:17 +02:00
f434e0680f template/stacks/core/forgejo/values.yaml aktualisiert 2025-04-25 10:54:28 +00:00
d3546717c0 template/stacks/core/forgejo/values.yaml aktualisiert 2025-04-24 16:11:58 +00:00
dbd391d29c template/stacks/core/forgejo/values.yaml aktualisiert 2025-04-24 16:07:22 +00:00
4fd88985ef template/stacks/core/forgejo.yaml aktualisiert 2025-04-24 15:29:34 +00:00
934d182042 done 2025-04-24 11:09:29 +02:00
b0834b73cc */2 * * * * 2025-04-24 10:51:32 +02:00
ed0d1debf4 extra 2025-04-24 10:24:34 +02:00
b89cfa49fd alloy config added 2025-04-24 10:17:25 +02:00
0771b1deb9 Merge branch 'development' into IPCEICIS-2952 2025-04-23 13:29:25 +00:00
f71729c074 finals touches 2025-04-23 15:22:38 +02:00
7287a6cf56 testing redis changes 2025-04-23 15:03:49 +02:00
07ff00fce1 almost done 2025-04-23 14:46:27 +02:00
32f084fcb6 ds renewed 2025-04-23 14:40:14 +02:00
183cec8a9d testing redis changes 2025-04-23 14:37:50 +02:00
cee7ba8ff3 - name: passwd-volume
mountPath: /etc/passwd
                subPath: passwd
2025-04-23 14:27:15 +02:00
feae2ff010 another mistake 2025-04-23 14:19:48 +02:00
86fb4eefa3 mistake 2025-04-23 14:17:05 +02:00
596a234192 test 2025-04-23 14:15:44 +02:00
7e2243d52d test to ds 2025-04-23 13:59:30 +02:00
9c8cdbf7a4 no logrotate sidecar container 2025-04-23 13:54:07 +02:00
01a9c0e0e6 deleted unneccessary container 2025-04-23 13:28:18 +02:00
Bot
abeeb7ee23 chore(backstage): pin to backstage-edp v1.1.0 2025-04-23 13:20:24 +02:00
58fd63da54 0 * * * * 2025-04-23 13:11:58 +02:00
d1355e47c8 don't compress 2025-04-23 12:56:56 +02:00
20a6113403 new changes 2025-04-23 12:01:20 +02:00
1abbd9b646 && sleep 10 2025-04-23 11:56:08 +02:00
7dfefa8ac9 2M 2025-04-23 11:45:26 +02:00
135844644d command: ["/bin/sh", "-c", "sleep 10"] 2025-04-23 11:45:10 +02:00
aec54530f8 Merge branch 'development' into IPCEICIS-2297_working_oidc 2025-04-23 11:40:48 +02:00
4d20aeeaac 5 minutes 2025-04-23 11:34:01 +02:00
84d4f0af07 don't sleep 2025-04-23 11:26:02 +02:00
700c242cdd final touches 2025-04-23 11:24:03 +02:00
7e599a9422 testing redis changes 2025-04-23 11:21:51 +02:00
fbee7995e1 testing redis changes 2025-04-23 11:14:27 +02:00
15d9160b16 testing redis changes 2025-04-23 11:02:59 +02:00
ee08dc2f33 testing redis changes 2025-04-23 10:56:34 +02:00
e1da09b2cc push 2025-04-23 10:51:42 +02:00
d45c89c0b8 3030 2025-04-23 10:32:16 +02:00
Bot
4eb6fa0908 Removed unused ArgoCD Application manifests of Crossplane 2025-04-22 18:56:30 +02:00
3f6ec41ece service corrected 2025-04-22 15:52:16 +02:00
6afdc2c64f removes some comments 2025-04-22 15:17:34 +02:00
40d1d025a6 new script 2025-04-22 15:13:56 +02:00
c8eac10fcf muss so 2025-04-22 15:11:16 +02:00
4447c29987 cancel last ommit 2025-04-22 14:59:44 +02:00
1268e3ea24 unique 2025-04-22 14:50:50 +02:00
d17861bc87 another try 2025-04-22 14:46:41 +02:00
87ce37972d new service 2025-04-22 14:42:37 +02:00
9bb0063f8b Use Redis in the Forgejo configuration to support rolling updates of Forgejo itself
Forgejo is not able to be reconfigured by default: a queue is locked
To circumvent the problem, we need simply to enable the use of Redis as a Forgejo component
2025-04-22 12:29:50 +00:00
350e3a804c nginx.conf 2025-04-22 14:25:44 +02:00
a9ae743de9 subpath 2025-04-22 14:13:15 +02:00
6ac5a94503 updates Forgejo sync policy 2025-04-22 09:55:18 +02:00
f783a582c6 does cleanup 2025-04-17 16:45:59 +02:00
4e50289d91 testing the hydration of domains 2025-04-17 15:50:35 +02:00
ba2b7dbc9f adds missing secret for 'git clone'-command 2025-04-17 14:46:29 +02:00
9dd9184cfd uses the new secrets for 'git clone'-command 2025-04-17 14:31:56 +02:00
0e26cc9a3f adds forgejo-access-token external secret for gitea namespace 2025-04-17 13:09:43 +02:00
0668eb7c5f Merge branch 'IPCEICIS-2297_working_oidc' of https://forgejo.edf-bootstrap.cx.fg1.ffm.osc.live/DevFW-CICD/stacks into IPCEICIS-2297_working_oidc 2025-04-17 12:59:21 +02:00
74523447ae adds the correct secrets 2025-04-17 12:56:58 +02:00
cce8c51b75 Add template/stacks/core/argocd-sso/argocd-forgejo-access-token.yaml 2025-04-17 10:54:47 +00:00
11d9ad5fcc testing 2025-04-16 15:24:28 +02:00
42d65e95be testing 2025-04-16 14:59:25 +02:00
5165583b9a testing 2025-04-16 14:53:10 +02:00
701771ad13 adds secretRefs to the jobs 2025-04-14 17:42:27 +02:00
d90402b74a renaming 2025-04-14 16:56:45 +02:00
b533f7adf3 adds a kubernetes job that configures ArgoCD 2025-04-14 16:39:37 +02:00
620f7a3fd9 adds a kubernetes job that configures Forgejo 2025-04-14 13:30:50 +02:00
1a8c2846bc Update template/stacks/core/forgejo-sso/secret-forgejo.yaml 2025-04-12 21:21:16 +00:00
ead21d078a Update template/stacks/core/argocd-sso/argocd-secret.yaml 2025-04-12 20:42:55 +00:00
30d1d51884 Merge pull request 'Added keycloak client externalsecret for Forgejo and ArgoCD' (#27) from keycloak_externalsecret_for_argocd_and_forgejo into development
Reviewed-on: #27
2025-04-12 19:38:52 +00:00
Richard Robert Reitz
33def8aba5 Added keycloak client externalsecret for Forgejo and ArgoCD 2025-04-12 21:31:05 +02:00
0a307e5b35 Merge pull request 'keycloak_oidc_forgejo_config' (#25) from keycloak_oidc_forgejo_config into development
Reviewed-on: #25
2025-04-12 19:13:13 +00:00
Richard Robert Reitz
55a1eaa6f6 Added Forgejo to Keycloak config 2025-04-12 21:07:43 +02:00
Richard Robert Reitz
2532958de8 Added Forgejo to Keycloak config 2025-04-12 21:05:35 +02:00
7a5e29e47d Update template/stacks/ref-implementation/keycloak/manifests/keycloak-config.yaml 2025-04-12 18:52:41 +00:00
3943b3d46e Merge pull request 'Update template/stacks/ref-implementation/keycloak/manifests/keycloak-config.yaml' (#24) from keycloak_oidc_argocd_config into development
Reviewed-on: #24
2025-04-12 18:50:49 +00:00
3263113ebe Update template/stacks/ref-implementation/keycloak/manifests/keycloak-config.yaml 2025-04-12 18:49:15 +00:00
5d0182d6ee Update template/stacks/core/forgejo/values.yaml 2025-04-12 16:27:05 +00:00
c01d4952ad Disabled user self registration in Forgejo 2025-04-12 16:17:20 +00:00
777d6afeb4 Update template/stacks/core/forgejo-runner/dind-docker.yaml 2025-04-11 14:12:29 +00:00
529182ee3d logrotate-cronjob 2025-04-02 15:31:38 +02:00
dd9ddc8fdb sidecar-script 2025-04-02 15:26:04 +02:00
6811280b92 - name: sidecar-nginx
image: nginx:latest
      ports:
        - containerPort: 8080
      volumeMounts:
        - name: idecar-script
          mountPath: /etc/nginx
          subPath: nginx.conf
          subPathExpr: 'nginx.conf'
        - name: idecar-script
          mountPath: /tmp/sidecar.sh
          subPath: sidecar.sh
          mode: 0755
        - name: passwd-volume
          mountPath: /etc/passwd
          subPath: passwd
2025-04-02 15:20:11 +02:00
949cf77c4e sighup 2025-04-02 14:53:08 +02:00
a11947c5e7 kill -SIGHUP $(pidof bao) || echo "OpenBAO process not found" 2025-04-02 14:40:13 +02:00
853ce17354 app: openbao-0 2025-04-02 14:39:56 +02:00
8b6b29cb9f sleep infinity 2025-04-02 14:21:28 +02:00
4553289695 tmp 2025-04-02 13:59:01 +02:00
0f229f7adb sleep infinity 2025-04-02 13:51:28 +02:00
cfb473659d command: ["/bin/sh", "-c", "sleep 1000000000000000000000"] 2025-04-02 13:46:04 +02:00
795d575d5e kill -SIGHUP $(pidof bao) || echo "OpenBAO process not found"
mkdir pupa
2025-04-02 13:38:34 +02:00
c754dc80bc signal-sidecar-script 2025-04-02 13:32:15 +02:00
1a85de6cda 5k 2025-04-02 11:03:54 +02:00
5db72e2dc0 cronjob 2025-04-02 10:43:10 +02:00
ca9fd7ba39 - name: status
mountPath: /var/lib
2025-04-02 10:08:07 +02:00
48fb2c1481 size 1M 2025-04-02 09:53:08 +02:00
a2d2bd9b87 volumeMounts:
- name: host-log-storage
          mountPath: /openbao/logs
2025-04-02 08:59:29 +02:00
49fdf90dd8 - name: logrotate2 2025-04-01 14:49:40 +02:00
b5a515c6f9 imroc/logrotate:latest 2025-04-01 14:44:46 +02:00
485e772016 # - name: status
#   mountPath: /var/lib
2025-04-01 14:11:35 +02:00
71a45cc0b8 value: "* * * * *" 2025-04-01 14:04:13 +02:00
5200aa748c 5k 2025-04-01 13:53:08 +02:00
29ec426778 delaycompress rmoved 2025-04-01 13:36:33 +02:00
7b8ea2de6b status 2025-04-01 13:28:10 +02:00
ee630c88b9 env:
- name: CRON_SCHEDULE
            value: "0 * * * *"
          - name: TINI_SUBREAPER
            value:
2025-04-01 13:18:44 +02:00
fc6ee8bcae 1M 2025-04-01 12:53:31 +02:00
c9d72e9f90 should be done 2025-04-01 11:57:46 +02:00
7cc75f0095 test 2025-04-01 11:44:52 +02:00
37a9a73664 - name: passwd-volume
mountPath: /etc/passwd
          subPath: passwd
2025-04-01 11:44:19 +02:00
ad76195004 passwd-user-configmap 2025-04-01 11:35:26 +02:00
d3b60c036a extraArgs: "chmod o+rwx /etc/passwd" 2025-04-01 11:20:56 +02:00
de3194062d extraArgs:
- |
      chmod o+rwx /etc/passwd
      chmod o+rwx /etc/group
2025-04-01 11:16:07 +02:00
cda3fc8179 extraArgs:
- chmod o+rwx /etc/passwd
    - chmod o+rwx /etc/group
2025-04-01 11:15:20 +02:00
2dc751b5e3 chmod o+rwx /etc/passwd
chmod o+rwx /etc/group
2025-04-01 10:59:09 +02:00
12a4ed37f7 /etc/group 2025-04-01 10:51:43 +02:00
77b571b768 chown 100:100 /etc/passwd 2025-04-01 10:50:59 +02:00
6df0858cdf - name: init
image: alpine:latest
2025-04-01 10:45:20 +02:00
06fb6d223f runAsUser: 100 2025-04-01 10:21:07 +02:00
4f8eb0bc8b chmod o+rwx /var/log/openbao 2025-04-01 10:05:55 +02:00
1164768b9f runAsUser: 1 2025-03-31 15:53:54 +02:00
f66f437cdf runAsUser: 100 2025-03-31 15:48:42 +02:00
ce5bdf0226 runAsUser: 1 2025-03-31 15:35:06 +02:00
56c5cc2620 - name: alloy-data
mountPath: /var/lib/
2025-03-31 15:24:21 +02:00
458414e779 set -e
mkdir -p /var/log/openbao
          chown 100:100 /var/log/openbao
          echo "logrotate100💯:/home/logrotate:/bin/sh" >> /etc/passwd
          echo "logrotate100:" >> /etc/group
          mkdir -p /home/logrotate
          # chown 100:100 /var/lib
2025-03-31 15:09:30 +02:00
8eae08aaa9 securityContext:
runAsUser: 0
2025-03-31 15:04:11 +02:00
ba9452e03c chown 100:100 /var/lib 2025-03-31 14:55:39 +02:00
888d32c403 set -e
mkdir -p /var/log/openbao
          chown 100:100 /var/log/openbao
          echo "logrotate100💯:/home/logrotate:/bin/sh" >> /etc/passwd
          echo "logrotate100:" >> /etc/group
          chown logrotate:logrotate /var/lib
2025-03-31 14:49:48 +02:00
6f3effeaf5 # bao audit enable file file_path=stdout 2025-03-31 14:49:09 +02:00
fd02d55dda bao audit enable file file_path=stdout 2025-03-31 14:26:58 +02:00
63b17c9e32 echo "logrotate100💯:/home/logrotate:/bin/sh" >> /etc/passwd
echo "logrotate100:" >> /etc/group
2025-03-31 14:10:34 +02:00
f13bf825ff set -e
chown 100:100 /var/lib
          tail -f /dev/null
2025-03-31 14:03:43 +02:00
abd7da5cd3 image: alpine:latest 2025-03-31 13:58:12 +02:00
a42df6275c restart policy removed 2025-03-31 13:50:24 +02:00
5a802be864 - |
set -e
          useradd -u 100 logrotate
          chown logrotate:logrotate /var/lib
          tail -f /dev/null
2025-03-31 13:45:05 +02:00
bc6ed363e2 logrotate-priviledges 2025-03-31 13:38:33 +02:00
631be775f5 chown logrotate:logrotate /var/lib/logrotate.status 2025-03-31 13:28:37 +02:00
0107666fe2 logrotate-config-volume 2025-03-31 12:31:38 +02:00
e5ccae1aab - name: logrotate-config
mountPath: /etc/logrotate.conf
          subPath: logrotate.conf
          readOnly: true
2025-03-31 12:22:35 +02:00
f6d1842876 image: skymatic/logrotate:latest 2025-03-31 12:14:19 +02:00
508ecd3f12 imagePullPolicy: IfNotPresent 2025-03-31 12:07:24 +02:00
5e47caaee1 - name: logrotate
image: imroc/logrotate:latest
      env:
        - name: LOGROTATE_FILE_PATTERN
          value: "/var/log/nginx/nginx_*.log"
        - name: LOGROTATE_FILESIZE
          value: "20M"
        - name: LOGROTATE_FILENUM
          value: "10"
        - name: CRON_EXPR
          value: "*/1 * * * *"
        - name: CROND_LOGLEVEL
          value: "7"
2025-03-31 11:54:31 +02:00
0485a8fb76 image: skymatic/logrotate:latest 2025-03-31 11:42:14 +02:00
17f578dde2 blacklabelops/logrotate 2025-03-31 11:20:56 +02:00
a35aefc376 image: debian:stable-slim 2025-03-31 11:07:40 +02:00
398c94fbc8 alpine:latest 2025-03-31 11:02:11 +02:00
30f0c6f218 debian:stable-slim 2025-03-31 10:54:23 +02:00
d6fa372e5f Merge pull request 'Update fix to latest kindserver' (#23) from kindserver_development_test into development
Reviewed-on: #23
2025-03-31 08:33:58 +00:00
06303ef355 bao audit enable -path="file" file file_path=/openbao/logs/openbao/openbao.log 2025-03-31 10:30:15 +02:00
08471dee47 bao audit enable -path="file" file file_path=/var/log/openbao/openbao.log 2025-03-31 10:25:48 +02:00
881b65fcec apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: openbao-logging-dir
  namespace: openbao
spec:
  selector:
    matchLabels:
      app: openbao-logging-dir
  template:
    metadata:
      labels:
        app: openbao-logging-dir
    spec:
      initContainers:
      - name: creator
        image: busybox
        command: ["/bin/sh", "-c"]
        args:
        - |
          set -e
          mkdir -p /var/log/openbao
          chown 100:100 /var/log/openbao
        securityContext:
          runAsUser: 0
        volumeMounts:
        - name: host-log
          mountPath: /var/log
      containers:
      - name: running-container
        image: busybox
        command: ["sleep", "infinity"]
      volumes:
      - name: host-log
        hostPath:
          path: /var/log
          type: Directory
2025-03-31 10:19:39 +02:00
3853370a8c # - name: logrotate-config
#   mountPath: /etc/logrotate.conf
        #   subPath: logrotate.conf
2025-03-31 10:10:59 +02:00
6acd284b83 - name: logrotate
image: alpine:latest
      command: ["/bin/sh", "-c", "while true; do /usr/sbin/logrotate /etc/logrotate.conf; sleep 60; done"]
      securityContext:
        runAsUser: 100
      volumeMounts:
        - name: host-log-storage
          mountPath: /openbao/logs
        - name: logrotate-config
          mountPath: /etc/logrotate.conf
          subPath: logrotate.conf
2025-03-31 10:03:59 +02:00
Richard Robert Reitz
51e765049b Update fix to latest kindserver 2025-03-30 22:34:04 +02:00
4814dff26f Merge pull request 'updated argocd nginxingress and forgejo' (#22) from forgejo_upgrade_to_11_0_5 into development
Reviewed-on: #22
2025-03-27 19:49:13 +00:00
b3495f610c updated argocd 2025-03-27 20:42:01 +01:00
9ba027f94b updated nginx-ingress 2025-03-27 20:10:06 +01:00
dd7551a293 updated forgejo and forgejo-runner 2025-03-27 19:33:56 +01:00
c79114f463 # bao audit enable file file_path=stdout 2025-03-27 13:43:26 +01:00
6a5be1257c bao audit enable file file_path=stdout 2025-03-27 13:19:45 +01:00
1cb714aabb volumeMounts:
- mountPath: /var/log
    name: log-storage
    readOnly: false
2025-03-26 15:51:24 +01:00
450b5ff1a8 # removed 2025-03-26 15:42:15 +01:00
aaaf905edc # rm -rf /openbao/data/* 2025-03-26 15:40:05 +01:00
bd89c91d52 forgot to add login 2025-03-26 15:31:49 +01:00
a9ad7c1c5c comments deleted 2025-03-26 15:24:19 +01:00
d057e9dae1 configuration added 2025-03-26 14:44:35 +01:00
7179d2568c Merge pull request 'feat(mailhog): IPCEICIS-3048 Implement mailhog in edp stacks' (#18) from feature/IPCEICIS-3048-Implement-mailhog-in-edp-stacks into development
Reviewed-on: #18
2025-03-24 17:19:22 +00:00
Bot
55435a3ad2 feat(mailhog): IPCEICIS-3048 - added documentation 2025-03-24 17:09:44 +01:00
Stephan Lo
d0585fd2b7 feat(mailhog): IPCEICIS-3048 - mailhog deployed, ingress is https://<URL>/mailhog, forgje is configured 2025-03-20 23:57:52 +01:00
5d2df3db8e Merge pull request 'alloy_implementation' (#13) from alloy_implementation into development
Reviewed-on: #13
Reviewed-by: Christopher.Hase <Christopher.Hase@telekom.de>
2025-03-18 09:03:25 +00:00
65b74abeda Merge branch 'development' into alloy_implementation 2025-03-18 08:52:51 +00:00
fc287acf58 Update template/stacks/ref-implementation/backstage-templates/entities/spring-petclinic/skeleton/.github/workflows/maven-build.yml 2025-03-17 21:50:50 +00:00
94e3a759b2 Update template/stacks/core/crossplane-providers/provider-shell.yaml 2025-03-16 22:53:03 +00:00
31b768eebc Update template/stacks/core/crossplane-providers/provider-kind.yaml 2025-03-16 22:51:03 +00:00
9b5457e45f Update template/stacks/ref-implementation/backstage/manifests/install.yaml
chore(backstage): adjust to forgejo.edf-bootstrap.cx.fg1.ffm.osc.live/devfw-cicd/backstage-edp:development
2025-03-15 13:27:41 +00:00
Stephan Lo
c1b68bfdb2 chore(provider-shell): adjust to https://forgejo.edf-bootstrap.cx.fg1.ffm.osc.live/DevFW-CICD/-/packages/container/provider-shell/v0.1.3 2025-03-14 19:20:29 +01:00
beeb1f916b Hofix for ArgoCD problems after path routing fix 2025-03-14 09:34:45 +01:00
b42bba4379 Merge pull request 'IPCEICIS-2751_backstage' (#14) from IPCEICIS-2751_backstage into development
Reviewed-on: #14
2025-03-14 08:16:59 +00:00
5cc22c5648 Update template/stacks/core/ingress-apps/argocd-server.yaml 2025-03-13 16:16:49 +00:00
2f5a263511 Update template/stacks/core/argocd/values.yaml 2025-03-13 16:08:10 +00:00
d8867b9e3a Update template/stacks/ref-implementation/backstage/manifests/install.yaml 2025-03-13 10:16:04 +00:00
415576c2cb unnecessary rule deleted 2025-03-13 10:26:56 +01:00
1e5fa94c47 rules in alloy's values.yaml adjusted 2025-03-13 10:19:45 +01:00
8f621647f5 rule {
source_labels = ["__meta_kubernetes_pod_name", "__meta_kubernetes_pod_container_name"]
          action = "replace"
          target_label = "__path__"
          replacement = "/var/log/containers/$1_$2.log"
        }
2025-03-13 10:08:59 +01:00
74a77bfa3b Update template/stacks/ref-implementation/backstage/manifests/install.yaml 2025-03-13 09:00:38 +00:00
3293f9cf5a Update template/stacks/ref-implementation/backstage/manifests/install.yaml 2025-03-13 08:33:06 +00:00
75f40e070c promtail references replaces with alloy in dashboard_loki_container.yaml 2025-03-12 15:55:41 +01:00
b462804f29 loki.source.kubernetes "all_pod_logs" {
targets    = discovery.relabel.pod_logs.output
        forward_to = [loki.write.local_loki.receiver]
      }
2025-03-12 15:28:20 +01:00
fbb5aeb32b forward_to = [loki.write.local_loki.receiver] 2025-03-12 15:20:35 +01:00
687322525b values.yaml for alloy edited 2025-03-12 15:18:59 +01:00
1682302b69 "#" are not allowed in config.alloy in values.yaml 2025-03-12 15:04:59 +01:00
8f62875529 config.alloy adjusted in values.yaml 2025-03-12 14:53:01 +01:00
ddaf06b29c loki reference changes 2025-03-12 14:39:36 +01:00
180b74697a config.alloy in values.yaml adjusted 2025-03-12 14:30:37 +01:00
3a5df11604 alloy implementation commented out 2025-03-12 14:22:29 +01:00
81e85ff518 config.alloy added to the values 2025-03-12 14:22:11 +01:00
dd7cd2fa91 alloy.uiPathPrefix: "/alloy" added 2025-03-12 13:47:07 +01:00
71fbdcb5e0 alloy implementation 2025-03-12 13:37:16 +01:00
0d49c582f5 template/stacks/ref-implementation/backstage/manifests/install.yaml aktualisiert 2025-03-11 11:25:06 +00:00
303d7b3a7e Update template/stacks/ref-implementation/backstage-templates/entities/spring-petclinic/skeleton/.github/workflows/maven-build.yml 2025-03-08 12:50:23 +00:00
1ab8119063 Fixed kubectl download on Linux ARM64 VMs 2025-03-07 20:28:39 +00:00
f81a550064 Merge pull request 'IPCEICIS-764_grafana_sso' (#10) from IPCEICIS-764_grafana_sso into development
Reviewed-on: #10
2025-03-06 09:24:13 +00:00
Richard Robert Reitz
a9c69d6c24 adjusted retry backoff time 2025-03-04 19:23:19 +01:00
Richard Robert Reitz
c2cb410af8 Merge branch 'development' into IPCEICIS-764_grafana_sso 2025-03-04 19:21:48 +01:00
2698432809 Merge pull request 'faster_backstage_start' (#11) from faster_backstage_start into development
Reviewed-on: #11
2025-03-04 18:20:52 +00:00
Richard Robert Reitz
d0cce6916d fixed argocd version 2025-03-04 19:06:11 +01:00
Richard Robert Reitz
aba4a4a088 shortened retry backoff 2025-03-04 19:03:36 +01:00
Richard Robert Reitz
4ae8f6fd15 shortened retry backoff 2025-03-04 18:49:55 +01:00
Your Name
1198250861 Merge branch 'development' into IPCEICIS-764_grafana_sso 2025-03-04 11:55:17 +01:00
Richard Robert Reitz
1ef1029e1f Added Grafana admin account 2025-03-02 17:26:29 +01:00
Richard Robert Reitz
63a694d17c Removed Grafana admin account 2025-03-02 17:09:02 +01:00
Richard Robert Reitz
6eb52e654c Refactored external secret for grafana keycloak client secret 2025-03-02 15:46:06 +01:00
Richard Robert Reitz
ec31f98889 Added external secret for grafana keycloak client secret 2025-03-02 15:28:48 +01:00
Richard Robert Reitz
2d3ebadd50 Simplified Keycloaks Grafana config 2025-03-02 14:52:08 +01:00
Richard Robert Reitz
b58e373da9 Added email to Keycloak users and upgraded ArgoCD again as it requires more work 2025-03-02 14:19:07 +01:00
Richard Robert Reitz
688795ffad Added more Grafana client config to Keycloak 2025-03-02 13:46:20 +01:00
Richard Robert Reitz
e02d4bb272 Added more Grafana client config to Keycloak 2025-03-02 13:27:51 +01:00
Richard Robert Reitz
efa3a6e4dc Added ArgoCD sync retry to Grafana 2025-03-02 13:18:04 +01:00
Richard Robert Reitz
65c5321ce6 Added Grafana client config to Keycloak 2025-03-02 13:11:38 +01:00
Richard Robert Reitz
ce6c51eea9 Enhanced grafana yaml 2025-03-02 10:47:25 +01:00
0f8282ead6 Update template/stacks/monitoring/kube-prometheus/values.yaml 2025-02-28 14:08:07 +00:00
88d599a691 Update template/stacks/monitoring/kube-prometheus/values.yaml 2025-02-28 13:30:29 +00:00
51 changed files with 1096 additions and 247 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/.history

View file

@ -1,23 +1,29 @@
{{{ if eq .Env.CLUSTER_TYPE "kind" }}}
apiVersion: argoproj.io/v1alpha1 apiVersion: argoproj.io/v1alpha1
kind: Application kind: Application
metadata: metadata:
name: crossplane-providers name: argocd-sso
namespace: argocd namespace: argocd
labels: labels:
env: dev env: dev
finalizers:
- resources-finalizer.argocd.argoproj.io
spec: spec:
project: default project: default
syncPolicy:
automated:
selfHeal: true
syncOptions:
- CreateNamespace=true
destination:
name: in-cluster
namespace: crossplane-system
source: source:
path: stacks/core/crossplane-providers
repoURL: https://{{{ .Env.DOMAIN_GITEA }}}/giteaAdmin/edfbuilder repoURL: https://{{{ .Env.DOMAIN_GITEA }}}/giteaAdmin/edfbuilder
targetRevision: HEAD targetRevision: HEAD
{{{ end }}} path: "stacks/core/argocd-sso"
destination:
server: "https://kubernetes.default.svc"
namespace: argocd
syncPolicy:
syncOptions:
- CreateNamespace=true
automated:
selfHeal: true
retry:
limit: -1
backoff:
duration: 15s
factor: 1
maxDuration: 15s

View file

@ -0,0 +1,29 @@
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: forgejo-access-token
namespace: argocd
spec:
secretStoreRef:
name: gitea
kind: ClusterSecretStore
refreshInterval: "0"
target:
name: forgejo-access-token
template:
engineVersion: v2
data:
forgejo_username: "{{.FORGEJO_ACCESS_USERNAME}}"
forgejo_token: "{{.FORGEJO_ACCESS_TOKEN}}"
metadata:
labels:
app.kubernetes.io/part-of: argocd
data:
- secretKey: FORGEJO_ACCESS_USERNAME
remoteRef:
key: forgejo-access-token
property: username
- secretKey: FORGEJO_ACCESS_TOKEN
remoteRef:
key: forgejo-access-token
property: token

View file

@ -0,0 +1,24 @@
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: auth-generic-oauth-secret
namespace: argocd
spec:
secretStoreRef:
name: keycloak
kind: ClusterSecretStore
refreshInterval: "0"
target:
name: auth-generic-oauth-secret
template:
engineVersion: v2
data:
client_secret: "{{.ARGOCD_CLIENT_SECRET}}"
metadata:
labels:
app.kubernetes.io/part-of: argocd
data:
- secretKey: ARGOCD_CLIENT_SECRET
remoteRef:
key: keycloak-clients
property: ARGOCD_CLIENT_SECRET

View file

@ -0,0 +1,54 @@
---
apiVersion: batch/v1
kind: Job
metadata:
name: argocd-config
namespace: argocd
spec:
template:
metadata:
generateName: argocd-config-
spec:
restartPolicy: OnFailure
containers:
- name: push
image: docker.io/library/ubuntu:22.04
env:
- name: FORGEJO_USER
valueFrom:
secretKeyRef:
name: forgejo-access-token
key: forgejo_username
- name: FORGEJO_TOKEN
valueFrom:
secretKeyRef:
name: forgejo-access-token
key: forgejo_token
command: ["/bin/bash", "-c"]
args:
- |
#! /bin/bash
apt -qq update
apt -qq install git wget -y
if [[ "$(uname -m)" == "x86_64" ]]; then
wget https://github.com/mikefarah/yq/releases/download/v4.44.3/yq_linux_amd64
install yq_linux_amd64 /usr/local/bin/yq
rm yq_linux_amd64
else
wget https://github.com/mikefarah/yq/releases/download/v4.44.3/yq_linux_arm64
install yq_linux_arm64 /usr/local/bin/yq
rm yq_linux_arm64
fi
git config --global user.email "bot@bots.de"
git config --global user.name "bot"
git clone https://${FORGEJO_USER}:${FORGEJO_TOKEN}@{{{ .Env.DOMAIN_GITEA }}}/giteaAdmin/edfbuilder.git
cd edfbuilder
yq eval '.configs.cm."oidc.config" = "name: Keycloak\nissuer: https://{{{ .Env.DOMAIN }}}/keycloak/realms/cnoe\nclientID: argocd\nclientSecret: $auth-generic-oauth-secret:client_secret\nrequestedScopes: [\"openid\", \"profile\", \"email\", \"groups\"]"' -i stacks/core/argocd/values.yaml
git add stacks/core/argocd/values.yaml
git commit -m "adds Forgejo SSO config"
git push
backoffLimit: 99

View file

@ -16,12 +16,12 @@ spec:
name: in-cluster name: in-cluster
namespace: argocd namespace: argocd
sources: sources:
- repoURL: https://github.com/argoproj/argo-helm - repoURL: https://forgejo.edf-bootstrap.cx.fg1.ffm.osc.live/DevFW-CICD/argocd-helm.git
path: charts/argo-cd path: charts/argo-cd
# TODO: RIRE Can be updated when https://github.com/argoproj/argo-cd/issues/20790 is fixed and merged # TODO: RIRE Can be updated when https://github.com/argoproj/argo-cd/issues/20790 is fixed and merged
# As logout make problems, it is suggested to switch from path based routing to an own argocd domain, # As logout make problems, it is suggested to switch from path based routing to an own argocd domain,
# similar to the CNOE amazon reference implementation and in our case, Forgejo # similar to the CNOE amazon reference implementation and in our case, Forgejo
targetRevision: argo-cd-7.6.12 targetRevision: argo-cd-7.8.14-depends
helm: helm:
valueFiles: valueFiles:
- $values/stacks/core/argocd/values.yaml - $values/stacks/core/argocd/values.yaml

View file

@ -5,6 +5,7 @@ configs:
params: params:
server.insecure: true server.insecure: true
server.basehref: /argocd server.basehref: /argocd
server.rootpath: /argocd
cm: cm:
application.resourceTrackingMethod: annotation application.resourceTrackingMethod: annotation
timeout.reconciliation: 60s timeout.reconciliation: 60s
@ -20,6 +21,7 @@ configs:
clusters: clusters:
- "*" - "*"
accounts.provider-argocd: apiKey accounts.provider-argocd: apiKey
url: https://{{{ .Env.DOMAIN }}}/argocd
rbac: rbac:
policy.csv: 'g, provider-argocd, role:admin' policy.csv: 'g, provider-argocd, role:admin'

View file

@ -1,30 +0,0 @@
apiVersion: apiextensions.crossplane.io/v1
kind: CompositeResourceDefinition
metadata:
name: edfbuilders.edfbuilder.crossplane.io
spec:
connectionSecretKeys:
- kubeconfig
group: edfbuilder.crossplane.io
names:
kind: EDFBuilder
listKind: EDFBuilderList
plural: edfbuilders
singular: edfbuilders
versions:
- name: v1alpha1
served: true
referenceable: true
schema:
openAPIV3Schema:
description: A EDFBuilder is a composite resource that represents a K8S Cluster with edfbuilder Installed
type: object
properties:
spec:
type: object
properties:
repoURL:
type: string
description: URL to ArgoCD stack of stacks repo
required:
- repoURL

View file

@ -1,9 +0,0 @@
apiVersion: pkg.crossplane.io/v1
kind: Function
metadata:
name: crossplane-contrib-function-patch-and-transform
spec:
package: xpkg.upbound.io/crossplane-contrib/function-patch-and-transform:v0.7.0
packagePullPolicy: IfNotPresent # Only download the package if it isnt in the cache.
revisionActivationPolicy: Automatic # Otherwise our Provider never gets activate & healthy
revisionHistoryLimit: 1

View file

@ -1,14 +0,0 @@
apiVersion: argocd.crossplane.io/v1alpha1
kind: ProviderConfig
metadata:
name: argocd-provider
spec:
serverAddr: argocd-server.argocd.svc.cluster.local:80
insecure: true
plainText: true
credentials:
source: Secret
secretRef:
namespace: crossplane-system
name: argocd-credentials
key: authToken

View file

@ -1,9 +0,0 @@
apiVersion: pkg.crossplane.io/v1
kind: Provider
metadata:
name: provider-argocd
spec:
package: xpkg.upbound.io/crossplane-contrib/provider-argocd:v0.9.1
packagePullPolicy: IfNotPresent # Only download the package if it isnt in the cache.
revisionActivationPolicy: Automatic # Otherwise our Provider never gets activate & healthy
revisionHistoryLimit: 1

View file

@ -1,14 +0,0 @@
apiVersion: kind.crossplane.io/v1alpha1
kind: ProviderConfig
metadata:
name: kind-provider
spec:
credentials:
source: Secret
secretRef:
namespace: crossplane-system
name: kind-credentials
key: credentials
endpoint:
# the url is managed by crossplane-edfbuilder
url: https://DOCKER_HOST:SERVER_PORT/api/v1/kindserver

View file

@ -1,9 +0,0 @@
apiVersion: pkg.crossplane.io/v1
kind: Provider
metadata:
name: provider-kind
spec:
package: forgejo.edf-bootstrap.cx.fg1.ffm.osc.live/devfw-cicd/provider-kind:v0.1.0
packagePullPolicy: IfNotPresent # Only download the package if it isnt in the cache.
revisionActivationPolicy: Automatic # Otherwise our Provider never gets activate & healthy
revisionHistoryLimit: 1

View file

@ -1,9 +0,0 @@
apiVersion: pkg.crossplane.io/v1
kind: Provider
metadata:
name: provider-shell
spec:
package: forgejo.edf-bootstrap.cx.fg1.ffm.osc.live/devfw-cicd/provider-shell:v0.1.1
packagePullPolicy: IfNotPresent # Only download the package if it isnt in the cache.
revisionActivationPolicy: Automatic # Otherwise our Provider never gets activate & healthy
revisionHistoryLimit: 1

View file

@ -1,23 +0,0 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: crossplane
namespace: argocd
labels:
env: dev
spec:
project: default
syncPolicy:
automated:
selfHeal: true
syncOptions:
- CreateNamespace=true
destination:
name: in-cluster
namespace: crossplane-system
source:
chart: crossplane
repoURL: https://charts.crossplane.io/stable
targetRevision: 1.18.0
helm:
releaseName: crossplane

View file

@ -28,19 +28,18 @@ spec:
# https://forgejo.org/docs/v1.21/admin/actions/#offline-registration # https://forgejo.org/docs/v1.21/admin/actions/#offline-registration
initContainers: initContainers:
- name: runner-register - name: runner-register
image: code.forgejo.org/forgejo/runner:6.0.1 image: code.forgejo.org/forgejo/runner:6.3.1
command: command:
- "forgejo-runner" - "sh"
- "register" - "-c"
- "--no-interactive" - |
- "--token" forgejo-runner \
- $(RUNNER_SECRET) register \
- "--name" --no-interactive \
- $(RUNNER_NAME) --token ${RUNNER_SECRET} \
- "--instance" --name ${RUNNER_NAME} \
- $(FORGEJO_INSTANCE_URL) --instance ${FORGEJO_INSTANCE_URL} \
- "--labels" --labels docker:docker://node:20-bookworm,ubuntu-22.04:docker://forgejo.edf-bootstrap.cx.fg1.ffm.osc.live/devfw-cicd/catthehackerubuntu:act-22.04,ubuntu-latest:docker://forgejo.edf-bootstrap.cx.fg1.ffm.osc.live/devfw-cicd/catthehackerubuntu:act-22.04
- "docker:docker://node:20-bookworm,ubuntu-22.04:docker://forgejo.edf-bootstrap.cx.fg1.ffm.osc.live/devfw-cicd/catthehackerubuntu:act-22.04,ubuntu-latest:docker://forgejo.edf-bootstrap.cx.fg1.ffm.osc.live/devfw-cicd/catthehackerubuntu:act-22.04"
env: env:
- name: RUNNER_NAME - name: RUNNER_NAME
valueFrom: valueFrom:
@ -58,7 +57,7 @@ spec:
mountPath: /data mountPath: /data
containers: containers:
- name: runner - name: runner
image: code.forgejo.org/forgejo/runner:6.0.1 image: code.forgejo.org/forgejo/runner:6.3.1
command: command:
- "sh" - "sh"
- "-c" - "-c"
@ -94,7 +93,7 @@ spec:
- name: runner-data - name: runner-data
mountPath: /data mountPath: /data
- name: daemon - name: daemon
image: docker:27.4.1-dind image: docker:28.0.4-dind
env: env:
- name: DOCKER_TLS_CERTDIR - name: DOCKER_TLS_CERTDIR
value: /certs value: /certs

View file

@ -0,0 +1,29 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: forgejo-sso
namespace: argocd
labels:
env: dev
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
source:
repoURL: https://{{{ .Env.DOMAIN_GITEA }}}/giteaAdmin/edfbuilder
targetRevision: HEAD
path: "stacks/core/forgejo-sso"
destination:
server: "https://kubernetes.default.svc"
namespace: gitea
syncPolicy:
syncOptions:
- CreateNamespace=true
automated:
selfHeal: true
retry:
limit: -1
backoff:
duration: 15s
factor: 1
maxDuration: 15s

View file

@ -0,0 +1,26 @@
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: forgejo-access-token
namespace: gitea
spec:
secretStoreRef:
name: gitea
kind: ClusterSecretStore
refreshInterval: "0"
target:
name: forgejo-access-token
template:
engineVersion: v2
data:
forgejo_username: "{{.FORGEJO_ACCESS_USERNAME}}"
forgejo_token: "{{.FORGEJO_ACCESS_TOKEN}}"
data:
- secretKey: FORGEJO_ACCESS_USERNAME
remoteRef:
key: forgejo-access-token
property: username
- secretKey: FORGEJO_ACCESS_TOKEN
remoteRef:
key: forgejo-access-token
property: token

View file

@ -0,0 +1,26 @@
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: auth-generic-oauth-secret
namespace: gitea
spec:
secretStoreRef:
name: keycloak
kind: ClusterSecretStore
refreshInterval: "0"
target:
name: auth-generic-oauth-secret
template:
engineVersion: v2
data:
key: "{{.FORGEJO_CLIENT_ID}}"
secret: "{{.FORGEJO_CLIENT_SECRET}}"
data:
- secretKey: FORGEJO_CLIENT_ID
remoteRef:
key: keycloak-clients
property: FORGEJO_CLIENT_ID
- secretKey: FORGEJO_CLIENT_SECRET
remoteRef:
key: keycloak-clients
property: FORGEJO_CLIENT_SECRET

View file

@ -0,0 +1,76 @@
---
apiVersion: batch/v1
kind: Job
metadata:
name: forgejo-config
namespace: gitea
spec:
template:
metadata:
generateName: forgejo-config-
spec:
restartPolicy: OnFailure
containers:
- name: push
image: docker.io/library/ubuntu:22.04
env:
- name: FORGEJO_USER
valueFrom:
secretKeyRef:
name: forgejo-access-token
key: forgejo_username
- name: FORGEJO_TOKEN
valueFrom:
secretKeyRef:
name: forgejo-access-token
key: forgejo_token
command: ["/bin/bash", "-c"]
args:
- |
#! /bin/bash
apt -qq update
apt -qq install git wget -y
if [[ "$(uname -m)" == "x86_64" ]]; then
wget https://github.com/mikefarah/yq/releases/download/v4.44.3/yq_linux_amd64
install yq_linux_amd64 /usr/local/bin/yq
rm yq_linux_amd64
else
wget https://github.com/mikefarah/yq/releases/download/v4.44.3/yq_linux_arm64
install yq_linux_arm64 /usr/local/bin/yq
rm yq_linux_arm64
fi
git config --global user.email "bot@bots.de"
git config --global user.name "giteaAdmin"
git clone https://${FORGEJO_USER}:${FORGEJO_TOKEN}@{{{ .Env.DOMAIN_GITEA }}}/giteaAdmin/edfbuilder.git
cd edfbuilder
yq eval ".gitea.oauth = [
{
\"name\": \"Keycloak\",
\"provider\": \"openidConnect\",
\"existingSecret\": \"auth-generic-oauth-secret\",
\"autoDiscoverUrl\": \"https://{{{ .Env.DOMAIN }}}/keycloak/realms/cnoe/.well-known/openid-configuration\"
}
] |
(.gitea.oauth[] | .name) |= (. style=\"single\")
|
(.gitea.oauth[] | .provider) |= (. style=\"single\")
|
(.gitea.oauth[] | .existingSecret) |= (. style=\"single\")
|
(.gitea.oauth[] | .autoDiscoverUrl) |= (. style=\"single\")
" -i stacks/core/forgejo/values.yaml
yq eval '.gitea.config.oauth2_client =
{
"ENABLE_AUTO_REGISTRATION" : true,
"ACCOUNT_LINKING" : "auto"
}
' -i stacks/core/forgejo/values.yaml
git add stacks/core/forgejo/values.yaml
git commit -m "adds Forgejo SSO config"
git push
backoffLimit: 99

View file

@ -16,9 +16,9 @@ spec:
name: in-cluster name: in-cluster
namespace: gitea namespace: gitea
sources: sources:
- repoURL: https://code.forgejo.org/forgejo-helm/forgejo-helm.git - repoURL: https://forgejo.edf-bootstrap.cx.fg1.ffm.osc.live/DevFW-CICD/forgejo-helm.git
path: . path: .
targetRevision: v10.1.1 targetRevision: v12.0.0-depends
helm: helm:
valueFiles: valueFiles:
- $values/stacks/core/forgejo/values.yaml - $values/stacks/core/forgejo/values.yaml

View file

@ -1,5 +1,5 @@
redis-cluster: redis-cluster:
enabled: false enabled: true
postgresql: postgresql:
enabled: false enabled: false
postgresql-ha: postgresql-ha:
@ -16,6 +16,11 @@ gitea:
admin: admin:
existingSecret: gitea-credential existingSecret: gitea-credential
config: config:
service:
DISABLE_REGISTRATION: true
other:
SHOW_FOOTER_VERSION: false
SHOW_FOOTER_TEMPLATE_LOAD_TIME: false
database: database:
DB_TYPE: sqlite3 DB_TYPE: sqlite3
session: session:
@ -27,6 +32,12 @@ gitea:
server: server:
DOMAIN: '{{{ .Env.DOMAIN_GITEA }}}' DOMAIN: '{{{ .Env.DOMAIN_GITEA }}}'
ROOT_URL: 'https://{{{ .Env.DOMAIN_GITEA }}}:443' ROOT_URL: 'https://{{{ .Env.DOMAIN_GITEA }}}:443'
mailer:
ENABLED: true
FROM: forgejo@{{{ .Env.DOMAIN_GITEA }}}
PROTOCOL: smtp
SMTP_ADDR: mailhog.mailhog.svc.cluster.local
SMTP_PORT: 1025
service: service:
ssh: ssh:

View file

@ -0,0 +1,18 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: alloy
namespace: monitoring
spec:
ingressClassName: nginx
rules:
- host: {{{ .Env.DOMAIN }}}
http:
paths:
- backend:
service:
name: alloy
port:
number: 12345
path: /alloy
pathType: Prefix

View file

@ -4,8 +4,6 @@ metadata:
annotations: annotations:
nginx.ingress.kubernetes.io/backend-protocol: HTTP nginx.ingress.kubernetes.io/backend-protocol: HTTP
nginx.ingress.kubernetes.io/force-ssl-redirect: "true" nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
nginx.ingress.kubernetes.io/rewrite-target: /$2
nginx.ingress.kubernetes.io/use-regex: "true"
{{{ if eq .Env.CLUSTER_TYPE "osc" }}} {{{ if eq .Env.CLUSTER_TYPE "osc" }}}
dns.gardener.cloud/class: garden dns.gardener.cloud/class: garden
dns.gardener.cloud/dnsnames: {{{ .Env.DOMAIN }}} dns.gardener.cloud/dnsnames: {{{ .Env.DOMAIN }}}
@ -24,8 +22,8 @@ spec:
name: argocd-server name: argocd-server
port: port:
number: 80 number: 80
path: /argocd(/|$)(.*) path: /argocd
pathType: ImplementationSpecific pathType: Prefix
tls: tls:
- hosts: - hosts:
- {{{ .Env.DOMAIN }}} - {{{ .Env.DOMAIN }}}

View file

@ -0,0 +1,18 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: mailhog
namespace: mailhog
spec:
ingressClassName: nginx
rules:
- host: {{{ .Env.DOMAIN }}}
http:
paths:
- backend:
service:
name: mailhog
port:
number: 8025
path: /mailhog
pathType: Prefix

View file

@ -16,9 +16,9 @@ spec:
name: in-cluster name: in-cluster
namespace: ingress-nginx namespace: ingress-nginx
sources: sources:
- repoURL: https://github.com/kubernetes/ingress-nginx - repoURL: https://forgejo.edf-bootstrap.cx.fg1.ffm.osc.live/DevFW-CICD/ingress-nginx-helm.git
path: charts/ingress-nginx path: charts/ingress-nginx
targetRevision: helm-chart-4.11.3 targetRevision: helm-chart-4.12.1-depends
helm: helm:
valueFiles: valueFiles:
- $values/stacks/core/ingress-nginx/values.yaml - $values/stacks/core/ingress-nginx/values.yaml

View file

@ -1,7 +1,7 @@
apiVersion: argoproj.io/v1alpha1 apiVersion: argoproj.io/v1alpha1
kind: Application kind: Application
metadata: metadata:
name: promtail name: alloy
namespace: argocd namespace: argocd
labels: labels:
env: dev env: dev
@ -18,12 +18,12 @@ spec:
name: in-cluster name: in-cluster
namespace: monitoring namespace: monitoring
sources: sources:
- repoURL: https://github.com/grafana/helm-charts - repoURL: https://github.com/grafana/alloy.git
path: charts/promtail path: operations/helm/charts/alloy
targetRevision: HEAD targetRevision: HEAD
helm: helm:
valueFiles: valueFiles:
- $values/stacks/monitoring/promtail/values.yaml - $values/stacks/monitoring/alloy/values.yaml
- repoURL: https://{{{ .Env.DOMAIN_GITEA }}}/giteaAdmin/edfbuilder - repoURL: https://{{{ .Env.DOMAIN_GITEA }}}/giteaAdmin/edfbuilder
targetRevision: HEAD targetRevision: HEAD
ref: values ref: values

View file

@ -0,0 +1,101 @@
controller:
volumes:
extra:
- name: host-log-storage
hostPath:
path: /var/log
type: Directory
alloy:
create: false
name: alloy-config
key: config.alloy
mounts:
extra:
- mountPath: /openbao/logs
name: host-log-storage
readOnly: true
uiPathPrefix: "/alloy"
configMap:
content: |-
logging {
level = "info"
format = "logfmt"
}
loki.write "local_loki" {
endpoint {
url = "http://loki-loki-distributed-gateway/loki/api/v1/push"
}
}
discovery.kubernetes "pod" {
role = "pod"
}
discovery.kubernetes "nodes" {
role = "node"
}
discovery.kubernetes "services" {
role = "service"
}
discovery.kubernetes "endpoints" {
role = "endpoints"
}
discovery.kubernetes "endpointslices" {
role = "endpointslice"
}
discovery.kubernetes "ingresses" {
role = "ingress"
}
discovery.relabel "pod_logs" {
targets = discovery.kubernetes.pod.targets
rule {
source_labels = ["__meta_kubernetes_namespace"]
action = "replace"
target_label = "namespace"
}
rule {
source_labels = ["__meta_kubernetes_pod_name"]
action = "replace"
target_label = "pod"
}
rule {
source_labels = ["__meta_kubernetes_pod_node_name"]
action = "replace"
target_label = "node"
}
rule {
source_labels = ["__meta_kubernetes_pod_container_name"]
action = "replace"
target_label = "container"
}
}
local.file_match "file_logs" {
path_targets = [{"__path__" = "/openbao/logs/openbao/*"}]
sync_period = "5s"
}
loki.source.file "local_files" {
targets = local.file_match.file_logs.targets
forward_to = [loki.write.local_loki.receiver]
}
loki.source.kubernetes "all_pod_logs" {
targets = discovery.relabel.pod_logs.output
forward_to = [loki.write.local_loki.receiver]
}

View file

@ -0,0 +1,29 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: kube-prometheus-sso
namespace: argocd
labels:
env: dev
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
source:
repoURL: https://{{{ .Env.DOMAIN_GITEA }}}/giteaAdmin/edfbuilder
targetRevision: HEAD
path: "stacks/monitoring/kube-prometheus-sso"
destination:
server: "https://kubernetes.default.svc"
namespace: monitoring
syncPolicy:
syncOptions:
- CreateNamespace=true
automated:
selfHeal: true
retry:
limit: -1
backoff:
duration: 15s
factor: 1
maxDuration: 15s

View file

@ -0,0 +1,21 @@
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: auth-generic-oauth-secret
namespace: monitoring
spec:
secretStoreRef:
name: keycloak
kind: ClusterSecretStore
refreshInterval: "0"
target:
name: auth-generic-oauth-secret
template:
engineVersion: v2
data:
client_secret: "{{.GRAFANA_CLIENT_SECRET}}"
data:
- secretKey: GRAFANA_CLIENT_SECRET
remoteRef:
key: keycloak-clients
property: GRAFANA_CLIENT_SECRET

View file

@ -15,6 +15,12 @@ spec:
syncOptions: syncOptions:
- CreateNamespace=true - CreateNamespace=true
- ServerSideApply=true # do not copy metdata, since (because of its large size) it can lead to sync failure - ServerSideApply=true # do not copy metdata, since (because of its large size) it can lead to sync failure
retry:
limit: -1
backoff:
duration: 15s
factor: 1
maxDuration: 15s
destination: destination:
name: in-cluster name: in-cluster
namespace: monitoring namespace: monitoring

View file

@ -110,12 +110,12 @@ data:
"uid": "P8E80F9AEF21F6940" "uid": "P8E80F9AEF21F6940"
}, },
"editorMode": "builder", "editorMode": "builder",
"expr": "{container=\"promtail\"} |= ``", "expr": "{container=\"alloy\"} |= ``",
"queryType": "range", "queryType": "range",
"refId": "A" "refId": "A"
} }
], ],
"title": "Logs: Container promtail", "title": "Logs: Container alloy",
"type": "logs" "type": "logs"
}, },
{ {

View file

@ -33,7 +33,33 @@ grafana:
domain: {{{ .Env.DOMAIN }}} domain: {{{ .Env.DOMAIN }}}
root_url: "%(protocol)s://%(domain)s/grafana" root_url: "%(protocol)s://%(domain)s/grafana"
serve_from_sub_path: true serve_from_sub_path: true
auth:
disable_login: true
disable_login_form: true
auth.generic_oauth:
enabled: true
name: Keycloak-OAuth
allow_sign_up: true
use_refresh_token: true
client_id: grafana
client_secret: $__file{/etc/secrets/auth_generic_oauth/client_secret}
scopes: openid email profile offline_access roles
email_attribute_path: email
login_attribute_path: username
name_attribute_path: full_name
auth_url: https://{{{ .Env.DOMAIN }}}/keycloak/realms/cnoe/protocol/openid-connect/auth
token_url: https://{{{ .Env.DOMAIN }}}/keycloak/realms/cnoe/protocol/openid-connect/token
api_url: https://{{{ .Env.DOMAIN }}}/keycloak/realms/cnoe/protocol/openid-connect/userinfo
redirect_uri: http://{{{ .Env.DOMAIN }}}/grafana/login/generic_oauth
role_attribute_path: "contains(groups[*], 'admin') && 'Admin' || contains(groups[*], 'editor') && 'Editor' || 'Viewer'"
extraSecretMounts:
- name: auth-generic-oauth-secret-mount
secretName: auth-generic-oauth-secret
defaultMode: 0440
mountPath: /etc/secrets/auth_generic_oauth
readOnly: true
serviceMonitor: serviceMonitor:
# If true, a ServiceMonitor CRD is created for a prometheus operator https://github.com/coreos/prometheus-operator # If true, a ServiceMonitor CRD is created for a prometheus operator https://github.com/coreos/prometheus-operator
enabled: true enabled: true

View file

@ -1,45 +0,0 @@
# -- Overrides the chart's name
nameOverride: null
# -- Overrides the chart's computed fullname
fullnameOverride: null
global:
# -- Allow parent charts to override registry hostname
imageRegistry: ""
# -- Allow parent charts to override registry credentials
imagePullSecrets: []
daemonset:
# -- Deploys Promtail as a DaemonSet
enabled: true
autoscaling:
# -- Creates a VerticalPodAutoscaler for the daemonset
enabled: false
deployment:
# -- Deploys Promtail as a Deployment
enabled: false
config:
enabled: true
logLevel: info
logFormat: logfmt
serverPort: 3101
clients:
- url: http://loki-loki-distributed-gateway/loki/api/v1/push
scrape_configs:
- job_name: authlog
static_configs:
- targets:
- authlog
labels:
job: authlog
__path__: /logs/auth.log
- job_name: syslog
static_configs:
- targets:
- syslog
labels:
job: syslog
__path__: /logs/syslog

View file

@ -23,3 +23,7 @@ spec:
selfHeal: true selfHeal: true
retry: retry:
limit: -1 limit: -1
backoff:
duration: 15s
factor: 1
maxDuration: 15s

View file

@ -33,7 +33,7 @@ jobs:
#run: ./mvnw spring-boot:build-image # the original image build #run: ./mvnw spring-boot:build-image # the original image build
run: | run: |
export CONTAINER_REPO=$(echo {% raw %}${{ env.GITHUB_REPOSITORY }}{% endraw %} | tr '[:upper:]' '[:lower:]') export CONTAINER_REPO=$(echo {% raw %}${{ env.GITHUB_REPOSITORY }}{% endraw %} | tr '[:upper:]' '[:lower:]')
./mvnw com.google.cloud.tools:jib-maven-plugin:3.4.4:build -Djib.allowInsecureRegistries=true -Dimage={{{ .Env.DOMAIN_GITEA }}}/${CONTAINER_REPO}:latest -Djib.to.auth.username={% raw %}${{ github.actor }}{% endraw %} -Djib.to.auth.password={% raw %}${{ secrets.PACKAGES_TOKEN }}{% endraw %} ./mvnw com.google.cloud.tools:jib-maven-plugin:3.4.4:build -Djib.allowInsecureRegistries=true -Dimage={{{ .Env.DOMAIN_GITEA }}}/${CONTAINER_REPO}:latest -Djib.to.auth.username={% raw %}${{ secrets.PACKAGES_USER }}{% endraw %} -Djib.to.auth.password={% raw %}${{ secrets.PACKAGES_TOKEN }}{% endraw %} -Djib.from.platforms=linux/arm64,linux/amd64
- name: Build image as tar - name: Build image as tar
run: | run: |
./mvnw com.google.cloud.tools:jib-maven-plugin:3.4.4:buildTar -Djib.allowInsecureRegistries=true ./mvnw com.google.cloud.tools:jib-maven-plugin:3.4.4:buildTar -Djib.allowInsecureRegistries=true
@ -57,7 +57,11 @@ jobs:
NODE_TLS_REJECT_UNAUTHORIZED: 0 # This is necessary due to self signed certs for forgejo, proper setups can skip this NODE_TLS_REJECT_UNAUTHORIZED: 0 # This is necessary due to self signed certs for forgejo, proper setups can skip this
- name: install trivy from deb package - name: install trivy from deb package
run: | run: |
wget -O trivy.deb https://github.com/aquasecurity/trivy/releases/download/v0.58.0/trivy_0.58.0_Linux-64bit.deb if [[ "$(uname -m)" == "x86_64" ]]; then
wget -O trivy.deb https://github.com/aquasecurity/trivy/releases/download/v0.58.0/trivy_0.58.0_Linux-64bit.deb
else
wget -O trivy.deb https://github.com/aquasecurity/trivy/releases/download/v0.58.0/trivy_0.58.0_Linux-ARM64.deb
fi
DEBIAN_FRONTEND=noninteractive dpkg -i trivy.deb DEBIAN_FRONTEND=noninteractive dpkg -i trivy.deb
- name: scan the image - name: scan the image
run: trivy image --input jib-image.tar run: trivy image --input jib-image.tar

View file

@ -23,3 +23,7 @@ spec:
selfHeal: true selfHeal: true
retry: retry:
limit: -1 limit: -1
backoff:
duration: 15s
factor: 1
maxDuration: 15s

View file

@ -255,6 +255,8 @@ spec:
value: debug value: debug
- name: NODE_TLS_REJECT_UNAUTHORIZED - name: NODE_TLS_REJECT_UNAUTHORIZED
value: "0" value: "0"
- name: NODE_OPTIONS
value: "--no-node-snapshot"
envFrom: envFrom:
- secretRef: - secretRef:
name: backstage-env-vars name: backstage-env-vars
@ -262,7 +264,8 @@ spec:
name: gitea-credentials name: gitea-credentials
- secretRef: - secretRef:
name: argocd-credentials name: argocd-credentials
image: ghcr.io/cnoe-io/backstage-app:9232d633b2698fffa6d0a73b715e06640d170162 image: forgejo.edf-bootstrap.cx.fg1.ffm.osc.live/devfw-cicd/backstage-edp:1.1.0
imagePullPolicy: Always
name: backstage name: backstage
ports: ports:
- containerPort: 7007 - containerPort: 7007
@ -386,7 +389,7 @@ spec:
KEYCLOAK_NAME_METADATA: https://{{{ .Env.DOMAIN }}}:443/keycloak/realms/cnoe/.well-known/openid-configuration KEYCLOAK_NAME_METADATA: https://{{{ .Env.DOMAIN }}}:443/keycloak/realms/cnoe/.well-known/openid-configuration
KEYCLOAK_CLIENT_SECRET: "{{.BACKSTAGE_CLIENT_SECRET}}" KEYCLOAK_CLIENT_SECRET: "{{.BACKSTAGE_CLIENT_SECRET}}"
ARGOCD_AUTH_TOKEN: "argocd.token={{.ARGOCD_SESSION_TOKEN}}" ARGOCD_AUTH_TOKEN: "argocd.token={{.ARGOCD_SESSION_TOKEN}}"
ARGO_CD_URL: 'https://argocd-server.argocd.svc.cluster.local/api/v1/' ARGO_CD_URL: 'https://{{{ .Env.DOMAIN }}}/argocd/api/v1/'
data: data:
- secretKey: ARGOCD_SESSION_TOKEN - secretKey: ARGOCD_SESSION_TOKEN
remoteRef: remoteRef:

View file

@ -71,11 +71,11 @@ data:
}, },
"type": "default", "type": "default",
"protocol": "openid-connect" "protocol": "openid-connect"
} }
group-admin-payload.json: | group-admin-payload.json: |
{"name":"admin"} {"name":"admin"}
group-base-user-payload.json: | group-base-user-payload.json: |
{"name":"base-user"} {"name":"base-user"}
group-mapper-payload.json: | group-mapper-payload.json: |
{ {
"protocol": "openid-connect", "protocol": "openid-connect",
@ -88,41 +88,41 @@ data:
"access.token.claim": "true", "access.token.claim": "true",
"userinfo.token.claim": "true" "userinfo.token.claim": "true"
} }
} }
realm-payload.json: | realm-payload.json: |
{"realm":"cnoe","enabled":true} {"realm":"cnoe","enabled":true}
user-password.json: | user-password.json: |
{ {
"temporary": false, "temporary": false,
"type": "password", "type": "password",
"value": "${USER1_PASSWORD}" "value": "${USER1_PASSWORD}"
} }
user-user1.json: | user-user1.json: |
{ {
"username": "user1", "username": "user1",
"email": "", "email": "user1@user.de",
"firstName": "user", "firstName": "user",
"lastName": "one", "lastName": "one",
"requiredActions": [], "requiredActions": [],
"emailVerified": false, "emailVerified": true,
"groups": [ "groups": [
"/admin" "/admin"
], ],
"enabled": true "enabled": true
} }
user-user2.json: | user-user2.json: |
{ {
"username": "user2", "username": "user2",
"email": "", "email": "user2@user.de",
"firstName": "user", "firstName": "user",
"lastName": "two", "lastName": "two",
"requiredActions": [], "requiredActions": [],
"emailVerified": false, "emailVerified": true,
"groups": [ "groups": [
"/base-user" "/base-user"
], ],
"enabled": true "enabled": true
} }
argo-client-payload.json: | argo-client-payload.json: |
{ {
"protocol": "openid-connect", "protocol": "openid-connect",
@ -150,7 +150,7 @@ data:
"webOrigins": [ "webOrigins": [
"/*" "/*"
] ]
} }
backstage-client-payload.json: | backstage-client-payload.json: |
{ {
@ -179,8 +179,104 @@ data:
"webOrigins": [ "webOrigins": [
"/*" "/*"
] ]
}
grafana-client-payload.json: |
{
"clientId": "grafana",
"name": "Grafana Client",
"description": "Used for Grafana SSO",
"rootUrl": "https://{{{ .Env.DOMAIN }}}/grafana",
"adminUrl": "https://{{{ .Env.DOMAIN }}}/grafana",
"baseUrl": "https://{{{ .Env.DOMAIN }}}/grafana",
"alwaysDisplayInConsole": false,
"redirectUris": [
"http://{{{ .Env.DOMAIN }}}/grafana/*"
],
"webOrigins": [
"https://{{{ .Env.DOMAIN }}}/grafana"
],
"standardFlowEnabled": true,
"implicitFlowEnabled": false,
"directAccessGrantsEnabled": true,
"serviceAccountsEnabled": false,
"publicClient": false,
"frontchannelLogout": true,
"protocol": "openid-connect",
"attributes": {
"saml_idp_initiated_sso_url_name": "",
"oidc.ciba.grant.enabled": "false",
"oauth2.device.authorization.grant.enabled": "false"
},
"defaultClientScopes": [
"web-origins",
"acr",
"offline_access",
"roles",
"profile",
"groups",
"email"
]
} }
argocd-client-payload.json: |
{
"protocol": "openid-connect",
"clientId": "argocd",
"name": "ArgoCD Client",
"description": "Used for ArgoCD SSO",
"publicClient": false,
"authorizationServicesEnabled": false,
"serviceAccountsEnabled": false,
"implicitFlowEnabled": false,
"directAccessGrantsEnabled": true,
"standardFlowEnabled": true,
"frontchannelLogout": true,
"attributes": {
"saml_idp_initiated_sso_url_name": "",
"oauth2.device.authorization.grant.enabled": false,
"oidc.ciba.grant.enabled": false
},
"alwaysDisplayInConsole": false,
"rootUrl": "",
"baseUrl": "",
"redirectUris": [
"https://{{{ .Env.DOMAIN }}}/*"
],
"webOrigins": [
"/*"
]
}
forgejo-client-payload.json: |
{
"protocol": "openid-connect",
"clientId": "forgejo",
"name": "Forgejo Client",
"description": "Used for Forgejo SSO",
"publicClient": false,
"authorizationServicesEnabled": false,
"serviceAccountsEnabled": false,
"implicitFlowEnabled": false,
"directAccessGrantsEnabled": true,
"standardFlowEnabled": true,
"frontchannelLogout": true,
"attributes": {
"saml_idp_initiated_sso_url_name": "",
"oauth2.device.authorization.grant.enabled": false,
"oidc.ciba.grant.enabled": false
},
"alwaysDisplayInConsole": false,
"rootUrl": "",
"baseUrl": "",
"redirectUris": [
"https://{{{ .Env.DOMAIN_GITEA }}}/*"
],
"webOrigins": [
"/*"
]
}
--- ---
apiVersion: batch/v1 apiVersion: batch/v1
kind: Job kind: Job
@ -216,7 +312,7 @@ spec:
command: ["/bin/bash", "-c"] command: ["/bin/bash", "-c"]
args: args:
- | - |
#! /bin/bash #! /bin/bash
set -ex -o pipefail set -ex -o pipefail
@ -247,7 +343,11 @@ spec:
fi fi
set -e set -e
curl -sS -LO "https://dl.k8s.io/release/v1.28.3//bin/linux/amd64/kubectl" if [[ "$(uname -m)" == "x86_64" ]]; then
curl -sS -LO "https://dl.k8s.io/release/v1.28.3//bin/linux/amd64/kubectl"
else
curl -sS -LO "https://dl.k8s.io/release/v1.28.3//bin/linux/arm64/kubectl"
fi
chmod +x kubectl chmod +x kubectl
echo "creating cnoe realm and groups" echo "creating cnoe realm and groups"
@ -273,7 +373,7 @@ spec:
${KEYCLOAK_URL}/admin/realms/cnoe/groups ${KEYCLOAK_URL}/admin/realms/cnoe/groups
# Create scope mapper # Create scope mapper
echo 'adding group claim to tokens' echo 'adding group claim to tokens'
CLIENT_SCOPE_GROUPS_ID=$(curl -sS -H "Content-Type: application/json" -H "Authorization: bearer ${KEYCLOAK_TOKEN}" -X GET ${KEYCLOAK_URL}/admin/realms/cnoe/client-scopes | jq -e -r '.[] | select(.name == "groups") | .id') CLIENT_SCOPE_GROUPS_ID=$(curl -sS -H "Content-Type: application/json" -H "Authorization: bearer ${KEYCLOAK_TOKEN}" -X GET ${KEYCLOAK_URL}/admin/realms/cnoe/client-scopes | jq -e -r '.[] | select(.name == "groups") | .id')
curl -sS -H "Content-Type: application/json" \ curl -sS -H "Content-Type: application/json" \
@ -313,8 +413,8 @@ spec:
echo "creating Argo Workflows client" echo "creating Argo Workflows client"
curl -sS -H "Content-Type: application/json" \ curl -sS -H "Content-Type: application/json" \
-H "Authorization: bearer ${KEYCLOAK_TOKEN}" \ -H "Authorization: bearer ${KEYCLOAK_TOKEN}" \
-X POST --data @/var/config/argo-client-payload.json \ -X POST --data @/var/config/argo-client-payload.json \
${KEYCLOAK_URL}/admin/realms/cnoe/clients ${KEYCLOAK_URL}/admin/realms/cnoe/clients
CLIENT_ID=$(curl -sS -H "Content-Type: application/json" \ CLIENT_ID=$(curl -sS -H "Content-Type: application/json" \
-H "Authorization: bearer ${KEYCLOAK_TOKEN}" \ -H "Authorization: bearer ${KEYCLOAK_TOKEN}" \
@ -328,29 +428,100 @@ spec:
-X PUT ${KEYCLOAK_URL}/admin/realms/cnoe/clients/${CLIENT_ID}/default-client-scopes/${CLIENT_SCOPE_GROUPS_ID} -X PUT ${KEYCLOAK_URL}/admin/realms/cnoe/clients/${CLIENT_ID}/default-client-scopes/${CLIENT_SCOPE_GROUPS_ID}
ARGO_WORKFLOWS_CLIENT_SECRET=$(curl -sS -H "Content-Type: application/json" \ ARGO_WORKFLOWS_CLIENT_SECRET=$(curl -sS -H "Content-Type: application/json" \
-H "Authorization: bearer ${KEYCLOAK_TOKEN}" \ -H "Authorization: bearer ${KEYCLOAK_TOKEN}" \
-X GET ${KEYCLOAK_URL}/admin/realms/cnoe/clients/${CLIENT_ID} | jq -e -r '.secret') -X GET ${KEYCLOAK_URL}/admin/realms/cnoe/clients/${CLIENT_ID} | jq -e -r '.secret')
echo "creating Grafana client"
curl -sS -H "Content-Type: application/json" \
-H "Authorization: bearer ${KEYCLOAK_TOKEN}" \
-X POST --data @/var/config/grafana-client-payload.json \
${KEYCLOAK_URL}/admin/realms/cnoe/clients
CLIENT_ID=$(curl -sS -H "Content-Type: application/json" \
-H "Authorization: bearer ${KEYCLOAK_TOKEN}" \
-X GET ${KEYCLOAK_URL}/admin/realms/cnoe/clients | jq -e -r '.[] | select(.clientId == "grafana") | .id')
CLIENT_SCOPE_GROUPS_ID=$(curl -sS -H "Content-Type: application/json" \
-H "Authorization: bearer ${KEYCLOAK_TOKEN}" \
-X GET ${KEYCLOAK_URL}/admin/realms/cnoe/client-scopes | jq -e -r '.[] | select(.name == "groups") | .id')
curl -sS -H "Content-Type: application/json" \
-H "Authorization: bearer ${KEYCLOAK_TOKEN}" \
-X PUT ${KEYCLOAK_URL}/admin/realms/cnoe/clients/${CLIENT_ID}/default-client-scopes/${CLIENT_SCOPE_GROUPS_ID}
GRAFANA_CLIENT_SECRET=$(curl -sS -H "Content-Type: application/json" \
-H "Authorization: bearer ${KEYCLOAK_TOKEN}" \
-X GET ${KEYCLOAK_URL}/admin/realms/cnoe/clients/${CLIENT_ID} | jq -e -r '.secret')
echo "creating Backstage client" echo "creating Backstage client"
curl -sS -H "Content-Type: application/json" \ curl -sS -H "Content-Type: application/json" \
-H "Authorization: bearer ${KEYCLOAK_TOKEN}" \ -H "Authorization: bearer ${KEYCLOAK_TOKEN}" \
-X POST --data @/var/config/backstage-client-payload.json \ -X POST --data @/var/config/backstage-client-payload.json \
${KEYCLOAK_URL}/admin/realms/cnoe/clients ${KEYCLOAK_URL}/admin/realms/cnoe/clients
CLIENT_ID=$(curl -sS -H "Content-Type: application/json" \ CLIENT_ID=$(curl -sS -H "Content-Type: application/json" \
-H "Authorization: bearer ${KEYCLOAK_TOKEN}" \ -H "Authorization: bearer ${KEYCLOAK_TOKEN}" \
-X GET ${KEYCLOAK_URL}/admin/realms/cnoe/clients | jq -e -r '.[] | select(.clientId == "backstage") | .id') -X GET ${KEYCLOAK_URL}/admin/realms/cnoe/clients | jq -e -r '.[] | select(.clientId == "backstage") | .id')
CLIENT_SCOPE_GROUPS_ID=$(curl -sS -H "Content-Type: application/json" -H "Authorization: bearer ${KEYCLOAK_TOKEN}" -X GET ${KEYCLOAK_URL}/admin/realms/cnoe/client-scopes | jq -e -r '.[] | select(.name == "groups") | .id') CLIENT_SCOPE_GROUPS_ID=$(curl -sS -H "Content-Type: application/json" \
curl -sS -H "Content-Type: application/json" -H "Authorization: bearer ${KEYCLOAK_TOKEN}" -X PUT ${KEYCLOAK_URL}/admin/realms/cnoe/clients/${CLIENT_ID}/default-client-scopes/${CLIENT_SCOPE_GROUPS_ID} -H "Authorization: bearer ${KEYCLOAK_TOKEN}" \
-X GET ${KEYCLOAK_URL}/admin/realms/cnoe/client-scopes | jq -e -r '.[] | select(.name == "groups") | .id')
curl -sS -H "Content-Type: application/json" \
-H "Authorization: bearer ${KEYCLOAK_TOKEN}" \
-X PUT ${KEYCLOAK_URL}/admin/realms/cnoe/clients/${CLIENT_ID}/default-client-scopes/${CLIENT_SCOPE_GROUPS_ID}
BACKSTAGE_CLIENT_SECRET=$(curl -sS -H "Content-Type: application/json" \ BACKSTAGE_CLIENT_SECRET=$(curl -sS -H "Content-Type: application/json" \
-H "Authorization: bearer ${KEYCLOAK_TOKEN}" \ -H "Authorization: bearer ${KEYCLOAK_TOKEN}" \
-X GET ${KEYCLOAK_URL}/admin/realms/cnoe/clients/${CLIENT_ID} | jq -e -r '.secret') -X GET ${KEYCLOAK_URL}/admin/realms/cnoe/clients/${CLIENT_ID} | jq -e -r '.secret')
echo "creating ArgoCD client"
curl -sS -H "Content-Type: application/json" \
-H "Authorization: bearer ${KEYCLOAK_TOKEN}" \
-X POST --data @/var/config/argocd-client-payload.json \
${KEYCLOAK_URL}/admin/realms/cnoe/clients
CLIENT_ID=$(curl -sS -H "Content-Type: application/json" \
-H "Authorization: bearer ${KEYCLOAK_TOKEN}" \
-X GET ${KEYCLOAK_URL}/admin/realms/cnoe/clients | jq -e -r '.[] | select(.clientId == "argocd") | .id')
CLIENT_SCOPE_GROUPS_ID=$(curl -sS -H "Content-Type: application/json" \
-H "Authorization: bearer ${KEYCLOAK_TOKEN}" \
-X GET ${KEYCLOAK_URL}/admin/realms/cnoe/client-scopes | jq -e -r '.[] | select(.name == "groups") | .id')
curl -sS -H "Content-Type: application/json" \
-H "Authorization: bearer ${KEYCLOAK_TOKEN}" \
-X PUT ${KEYCLOAK_URL}/admin/realms/cnoe/clients/${CLIENT_ID}/default-client-scopes/${CLIENT_SCOPE_GROUPS_ID}
ARGOCD_CLIENT_SECRET=$(curl -sS -H "Content-Type: application/json" \
-H "Authorization: bearer ${KEYCLOAK_TOKEN}" \
-X GET ${KEYCLOAK_URL}/admin/realms/cnoe/clients/${CLIENT_ID} | jq -e -r '.secret')
echo "creating Forgejo client"
curl -sS -H "Content-Type: application/json" \
-H "Authorization: bearer ${KEYCLOAK_TOKEN}" \
-X POST --data @/var/config/forgejo-client-payload.json \
${KEYCLOAK_URL}/admin/realms/cnoe/clients
CLIENT_ID=$(curl -sS -H "Content-Type: application/json" \
-H "Authorization: bearer ${KEYCLOAK_TOKEN}" \
-X GET ${KEYCLOAK_URL}/admin/realms/cnoe/clients | jq -e -r '.[] | select(.clientId == "forgejo") | .id')
CLIENT_SCOPE_GROUPS_ID=$(curl -sS -H "Content-Type: application/json" \
-H "Authorization: bearer ${KEYCLOAK_TOKEN}" \
-X GET ${KEYCLOAK_URL}/admin/realms/cnoe/client-scopes | jq -e -r '.[] | select(.name == "groups") | .id')
curl -sS -H "Content-Type: application/json" \
-H "Authorization: bearer ${KEYCLOAK_TOKEN}" \
-X PUT ${KEYCLOAK_URL}/admin/realms/cnoe/clients/${CLIENT_ID}/default-client-scopes/${CLIENT_SCOPE_GROUPS_ID}
FORGEJO_CLIENT_SECRET=$(curl -sS -H "Content-Type: application/json" \
-H "Authorization: bearer ${KEYCLOAK_TOKEN}" \
-X GET ${KEYCLOAK_URL}/admin/realms/cnoe/clients/${CLIENT_ID} | jq -e -r '.secret')
ARGOCD_PASSWORD=$(./kubectl -n argocd get secret argocd-initial-admin-secret -o go-template='{{.data.password | base64decode }}') ARGOCD_PASSWORD=$(./kubectl -n argocd get secret argocd-initial-admin-secret -o go-template='{{.data.password | base64decode }}')
ARGOCD_SESSION_TOKEN=$(curl -k -sS http://argocd-server.argocd.svc.cluster.local:443/api/v1/session -H 'Content-Type: application/json' -d "{\"username\":\"admin\",\"password\":\"${ARGOCD_PASSWORD}\"}" | jq -r .token) ARGOCD_SESSION_TOKEN=$(curl -sS https://{{{ .Env.DOMAIN }}}/argocd/api/v1/session -H 'Content-Type: application/json' -d "{\"username\":\"admin\",\"password\":\"${ARGOCD_PASSWORD}\"}" | jq -r .token)
echo \ echo \
"apiVersion: v1 "apiVersion: v1
@ -365,7 +536,12 @@ spec:
ARGOCD_SESSION_TOKEN: ${ARGOCD_SESSION_TOKEN} ARGOCD_SESSION_TOKEN: ${ARGOCD_SESSION_TOKEN}
BACKSTAGE_CLIENT_SECRET: ${BACKSTAGE_CLIENT_SECRET} BACKSTAGE_CLIENT_SECRET: ${BACKSTAGE_CLIENT_SECRET}
BACKSTAGE_CLIENT_ID: backstage BACKSTAGE_CLIENT_ID: backstage
GRAFANA_CLIENT_SECRET: ${GRAFANA_CLIENT_SECRET}
GRAFANA_CLIENT_ID: grafana
ARGOCD_CLIENT_SECRET: ${ARGOCD_CLIENT_SECRET}
ARGOCD_CLIENT_ID: argocd
FORGEJO_CLIENT_SECRET: ${FORGEJO_CLIENT_SECRET}
FORGEJO_CLIENT_ID: forgejo
" > /tmp/secret.yaml " > /tmp/secret.yaml
./kubectl apply -f /tmp/secret.yaml ./kubectl apply -f /tmp/secret.yaml

View file

@ -1,23 +1,25 @@
apiVersion: argoproj.io/v1alpha1 apiVersion: argoproj.io/v1alpha1
kind: Application kind: Application
metadata: metadata:
name: crossplane-compositions name: mailhog
namespace: argocd namespace: argocd
labels: labels:
env: dev env: dev
finalizers:
- resources-finalizer.argocd.argoproj.io
spec: spec:
project: default project: default
syncPolicy:
automated:
selfHeal: true
syncOptions:
- CreateNamespace=true
destination:
name: in-cluster
namespace: crossplane-system
source: source:
path: stacks/core/crossplane-compositions
repoURL: https://{{{ .Env.DOMAIN_GITEA }}}/giteaAdmin/edfbuilder repoURL: https://{{{ .Env.DOMAIN_GITEA }}}/giteaAdmin/edfbuilder
targetRevision: HEAD targetRevision: HEAD
directory: path: "stacks/ref-implementation/mailhog"
recurse: true destination:
server: "https://kubernetes.default.svc"
namespace: mailhog
syncPolicy:
syncOptions:
- CreateNamespace=true
automated:
selfHeal: true
retry:
limit: -1

View file

@ -0,0 +1,54 @@
# Mailhog
[MailHog is an email testing tool for developers](https://github.com/mailhog/MailHog).
## In cluster SMTP service
Ypu can send ESMTP emails in the cluster to `mailhog.mailhog.svc.cluster.local`, standard port `1025`, as defined in the service manifest:
```yaml
apiVersion: v1
kind: Service
metadata:
name: mailhog
spec:
ports:
- name: smtp
port: 1025
```
## Ingress
Mailhog offers both WebUi and API at `https://{{{ .Env.DOMAIN }}}/mailhog`.
The ingress definition is in `stacks/core/ingress-apps/mailhog.yaml` (BTW, why isn't this ingress file here in this folder ??) routing to the mailhog' service
```yaml
spec:
rules:
- host: {{{ .Env.DOMAIN }}}
http:
paths:
- backend:
...
path: /mailhog
```
## API
For usage of the API see https://github.com/mailhog/MailHog/blob/master/docs/APIv2.md
## Tests
```bash
kubectl run busybox --rm -it --image=busybox -- /bin/sh
# inside bsybox
wget -O- http://mailhog.mailhog.svc.cluster.local:8025/mailhog
# check smtp port
nc -zv mailhog.mailhog.svc.cluster.local 1025
# send esmtp, first install swaks
swaks --to test@example.com --from test@example.com --server mailhog:1025 --data "Subject: Test-Mail\n\nDies ist eine Test-Mail."
```

View file

@ -0,0 +1,33 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: mailhog-deployment
namespace: mailhog
spec:
replicas: 1
selector:
matchLabels:
app: mailhog
template:
metadata:
labels:
app: mailhog
spec:
containers:
- name: mailhog
image: mailhog/mailhog
env:
- name: MH_UI_WEB_PATH # set this to same value as in ingress stacks/core/ingress-apps/mailhog.yaml
value: mailhog
ports:
- containerPort: 1025
name: smtp
- containerPort: 8025
name: http
resources:
requests:
memory: "64Mi"
cpu: "50m"
limits:
memory: "128Mi"
cpu: "100m"

View file

@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: mailhog
spec:
selector:
app: mailhog
ports:
- name: smtp
port: 1025
- name: http
port: 8025
type: ClusterIP

View file

@ -0,0 +1,29 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: openbao-logging-setup
namespace: argocd
labels:
env: dev
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
source:
repoURL: https://{{{ .Env.DOMAIN_GITEA }}}/giteaAdmin/edfbuilder
targetRevision: HEAD
path: "stacks/ref-implementation/openbao-logging"
destination:
server: "https://kubernetes.default.svc"
namespace: openbao
syncPolicy:
syncOptions:
- CreateNamespace=true
automated:
selfHeal: true
retry:
limit: -1
backoff:
duration: 15s
factor: 1
maxDuration: 15s

View file

@ -0,0 +1,39 @@
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: openbao-logging-dir
namespace: openbao
spec:
selector:
matchLabels:
app: openbao-logging-dir
template:
metadata:
labels:
app: openbao-logging-dir
spec:
initContainers:
- name: creator
image: busybox
command: ["/bin/sh", "-c"]
args:
- |
set -e
mkdir -p /var/log/openbao
chown 100:100 /var/log/openbao
securityContext:
runAsUser: 0
volumeMounts:
- name: host-log
mountPath: /var/log
containers:
- name: running-container
image: busybox
command: ["sleep", "infinity"]
securityContext:
runAsUser: 0
volumes:
- name: host-log
hostPath:
path: /var/log
type: Directory

View file

@ -0,0 +1,15 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: logrotate-config
data:
logrotate.conf: |
/openbao/logs/openbao/*.log {
size 50M
rotate 7
missingok
notifempty
postrotate
echo -e "POST / HTTP/1.1\r\nHost: sidecar-script-service.openbao.svc.cluster.local:3030\r\nContent-Length: 0\r\n\r\n" | nc sidecar-script-service.openbao.svc.cluster.local 3030
endscript
}

View file

@ -0,0 +1,45 @@
apiVersion: batch/v1
kind: CronJob
metadata:
name: logrotate-cronjob
namespace: openbao
spec:
schedule: "0 * * * *"
successfulJobsHistoryLimit: 1
failedJobsHistoryLimit: 1
jobTemplate:
spec:
template:
spec:
containers:
- name: logrotate
image: skymatic/logrotate:latest
securityContext:
runAsUser: 100
command: ["/bin/sh", "-c", "logrotate /etc/logrotate.conf && sleep 10"]
volumeMounts:
- name: host-log-storage
mountPath: /openbao/logs
- name: logrotate-config-volume
mountPath: /etc/logrotate.conf
subPath: logrotate.conf
readOnly: true
- name: passwd-volume
mountPath: /etc/passwd
subPath: passwd
- name: status
mountPath: /var/lib
restartPolicy: OnFailure
volumes:
- name: host-log-storage
hostPath:
path: /var/log
type: Directory
- name: logrotate-config-volume
configMap:
name: logrotate-config
- name: passwd-volume
configMap:
name: passwd-user-configmap
- name: status
emptyDir: {}

View file

@ -0,0 +1,8 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: passwd-user-configmap
data:
passwd: |
root:x:0:0:root:/root:/bin/sh
openbao:x:100:1000::/home/openbao:/sbin/nologin

View file

@ -0,0 +1,30 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: signal-sidecar-script
namespace: openbao
data:
sidecar.sh: |
#!/bin/sh
echo "Sending SIGHUP to OpenBAO..."
kill -SIGHUP $(pidof bao) || echo "OpenBAO process not found"
start.sh: |
#!/bin/sh
echo "Starting mini HTTP server on port 3030..."
while true; do
echo "Waiting for HTTP POST..."
REQUEST=$(nc -l -p 3030)
echo "$REQUEST" | grep -q "POST /" && {
echo "Received POST request, sending SIGHUP..."
/tmp/sidecar.sh
RESPONSE="HTTP/1.1 200 OK\r\nContent-Length: 26\r\n\r\nSIGHUP sent to OpenBAO"
} || {
RESPONSE="HTTP/1.1 405 Method Not Allowed\r\nContent-Length: 18\r\n\r\nMethod Not Allowed"
}
echo -e "$RESPONSE" | nc -N localhost 3031
done

View file

@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: sidecar-script-service
namespace: openbao
spec:
selector:
app.kubernetes.io/instance: openbao
component: server
ports:
- protocol: TCP
port: 3030
targetPort: 3030

View file

@ -1,9 +1,46 @@
server: server:
shareProcessNamespace: true
extraContainers:
- name: sidecar
image: alpine:latest
command: ["/bin/sh", "/tmp/start.sh"]
ports:
- containerPort: 3030
volumeMounts:
- name: sidecar-script
mountPath: /tmp/start.sh
subPath: start.sh
- name: sidecar-script
mountPath: /tmp/sidecar.sh
subPath: sidecar.sh
mode: 0755
- name: passwd-volume
mountPath: /etc/passwd
subPath: passwd
volumes:
- name: passwd-volume
configMap:
name: passwd-user-configmap
- name: host-log-storage
hostPath:
path: /var/log
type: Directory
- name: sidecar-script
configMap:
name: signal-sidecar-script
defaultMode: 0755
volumeMounts:
- mountPath: /openbao/logs
name: host-log-storage
readOnly: false
postStart: postStart:
- sh - sh
- -c - -c
- | - |
sleep 10 sleep 10
rm -rf /openbao/data/*
bao operator init >> /tmp/init.txt bao operator init >> /tmp/init.txt
cat /tmp/init.txt | grep "Key " | awk '{print $NF}' | xargs -I{} bao operator unseal {} cat /tmp/init.txt | grep "Key " | awk '{print $NF}' | xargs -I{} bao operator unseal {}
echo $(grep "Initial Root Token:" /tmp/init.txt | awk '{print $NF}')| cat > /openbao/data/initial_token.txt echo $(grep "Initial Root Token:" /tmp/init.txt | awk '{print $NF}')| cat > /openbao/data/initial_token.txt
@ -12,6 +49,8 @@ server:
echo $(grep "Unseal Key 3:" /tmp/init.txt | awk '{print $NF}')| cat > /openbao/data/unseal_key3.txt echo $(grep "Unseal Key 3:" /tmp/init.txt | awk '{print $NF}')| cat > /openbao/data/unseal_key3.txt
echo $(grep "Unseal Key 4:" /tmp/init.txt | awk '{print $NF}')| cat > /openbao/data/unseal_key4.txt echo $(grep "Unseal Key 4:" /tmp/init.txt | awk '{print $NF}')| cat > /openbao/data/unseal_key4.txt
echo $(grep "Unseal Key 5:" /tmp/init.txt | awk '{print $NF}')| cat > /openbao/data/unseal_key5.txt echo $(grep "Unseal Key 5:" /tmp/init.txt | awk '{print $NF}')| cat > /openbao/data/unseal_key5.txt
bao login $(grep "Initial Root Token:" /tmp/init.txt | awk '{print $NF}')
rm /tmp/init.txt rm /tmp/init.txt
bao audit enable -path="file" file file_path=/openbao/logs/openbao/openbao.log
ui: ui:
enabled: true enabled: true