forked from DevFW-CICD/stacks
Compare commits
38 commits
main
...
developmen
Author | SHA1 | Date | |
---|---|---|---|
364a65a6be | |||
303d7b3a7e | |||
1ab8119063 | |||
f81a550064 | |||
![]() |
a9c69d6c24 | ||
![]() |
c2cb410af8 | ||
2698432809 | |||
![]() |
d0cce6916d | ||
![]() |
aba4a4a088 | ||
![]() |
4ae8f6fd15 | ||
![]() |
1198250861 | ||
9bbf171980 | |||
d95ba7c12c | |||
8a38aee529 | |||
![]() |
1ef1029e1f | ||
![]() |
63a694d17c | ||
![]() |
6eb52e654c | ||
![]() |
ec31f98889 | ||
![]() |
2d3ebadd50 | ||
![]() |
b58e373da9 | ||
![]() |
688795ffad | ||
![]() |
e02d4bb272 | ||
![]() |
efa3a6e4dc | ||
![]() |
65c5321ce6 | ||
![]() |
ce6c51eea9 | ||
0f8282ead6 | |||
88d599a691 | |||
9016831286 | |||
168286cfce | |||
9cc9b864a2 | |||
265af3acff | |||
f311da6ac2 | |||
![]() |
8c84170ca2 | ||
b3306647c9 | |||
![]() |
e3f1899983 | ||
![]() |
394dc9f400 | ||
cc34792edb | |||
![]() |
03768e8399 |
51 changed files with 360 additions and 116 deletions
|
@ -13,7 +13,7 @@ spec:
|
||||||
namespace: argocd
|
namespace: argocd
|
||||||
source:
|
source:
|
||||||
path: registry
|
path: registry
|
||||||
repoURL: 'https://gitea.{{{ .Env.DOMAIN }}}/giteaAdmin/edfbuilder'
|
repoURL: 'https://{{{ .Env.DOMAIN_GITEA }}}/giteaAdmin/edfbuilder'
|
||||||
targetRevision: HEAD
|
targetRevision: HEAD
|
||||||
project: default
|
project: default
|
||||||
syncPolicy:
|
syncPolicy:
|
||||||
|
|
|
@ -13,7 +13,7 @@ spec:
|
||||||
namespace: argocd
|
namespace: argocd
|
||||||
source:
|
source:
|
||||||
path: stacks/core
|
path: stacks/core
|
||||||
repoURL: 'https://gitea.{{{ .Env.DOMAIN }}}/giteaAdmin/edfbuilder'
|
repoURL: 'https://{{{ .Env.DOMAIN_GITEA }}}/giteaAdmin/edfbuilder'
|
||||||
targetRevision: HEAD
|
targetRevision: HEAD
|
||||||
project: default
|
project: default
|
||||||
syncPolicy:
|
syncPolicy:
|
||||||
|
|
|
@ -13,7 +13,7 @@ spec:
|
||||||
namespace: argocd
|
namespace: argocd
|
||||||
source:
|
source:
|
||||||
path: stacks/local-backup
|
path: stacks/local-backup
|
||||||
repoURL: 'https://gitea.{{{ .Env.DOMAIN }}}/giteaAdmin/edfbuilder'
|
repoURL: 'https://{{{ .Env.DOMAIN_GITEA }}}/giteaAdmin/edfbuilder'
|
||||||
targetRevision: HEAD
|
targetRevision: HEAD
|
||||||
project: default
|
project: default
|
||||||
syncPolicy:
|
syncPolicy:
|
||||||
|
|
|
@ -13,7 +13,7 @@ spec:
|
||||||
namespace: argocd
|
namespace: argocd
|
||||||
source:
|
source:
|
||||||
path: stacks/monitoring
|
path: stacks/monitoring
|
||||||
repoURL: 'https://gitea.{{{ .Env.DOMAIN }}}/giteaAdmin/edfbuilder'
|
repoURL: 'https://{{{ .Env.DOMAIN_GITEA }}}/giteaAdmin/edfbuilder'
|
||||||
targetRevision: HEAD
|
targetRevision: HEAD
|
||||||
project: default
|
project: default
|
||||||
syncPolicy:
|
syncPolicy:
|
||||||
|
|
|
@ -13,7 +13,7 @@ spec:
|
||||||
namespace: argocd
|
namespace: argocd
|
||||||
source:
|
source:
|
||||||
path: stacks/ref-implementation
|
path: stacks/ref-implementation
|
||||||
repoURL: 'https://gitea.{{{ .Env.DOMAIN }}}/giteaAdmin/edfbuilder'
|
repoURL: 'https://{{{ .Env.DOMAIN_GITEA }}}/giteaAdmin/edfbuilder'
|
||||||
targetRevision: HEAD
|
targetRevision: HEAD
|
||||||
project: default
|
project: default
|
||||||
syncPolicy:
|
syncPolicy:
|
||||||
|
|
|
@ -13,7 +13,7 @@ spec:
|
||||||
namespace: argocd
|
namespace: argocd
|
||||||
source:
|
source:
|
||||||
path: stacks/second-cluster
|
path: stacks/second-cluster
|
||||||
repoURL: 'https://gitea.{{{ .Env.DOMAIN }}}/giteaAdmin/edfbuilder'
|
repoURL: 'https://{{{ .Env.DOMAIN_GITEA }}}/giteaAdmin/edfbuilder'
|
||||||
targetRevision: HEAD
|
targetRevision: HEAD
|
||||||
project: default
|
project: default
|
||||||
syncPolicy:
|
syncPolicy:
|
||||||
|
|
|
@ -18,10 +18,13 @@ spec:
|
||||||
sources:
|
sources:
|
||||||
- repoURL: https://github.com/argoproj/argo-helm
|
- repoURL: https://github.com/argoproj/argo-helm
|
||||||
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
|
||||||
|
# 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
|
||||||
targetRevision: argo-cd-7.7.5
|
targetRevision: argo-cd-7.7.5
|
||||||
helm:
|
helm:
|
||||||
valueFiles:
|
valueFiles:
|
||||||
- $values/stacks/core/argocd/values.yaml
|
- $values/stacks/core/argocd/values.yaml
|
||||||
- repoURL: https://gitea.{{{ .Env.DOMAIN }}}/giteaAdmin/edfbuilder
|
- repoURL: https://{{{ .Env.DOMAIN_GITEA }}}/giteaAdmin/edfbuilder
|
||||||
targetRevision: HEAD
|
targetRevision: HEAD
|
||||||
ref: values
|
ref: values
|
||||||
|
|
|
@ -17,7 +17,7 @@ spec:
|
||||||
namespace: crossplane-system
|
namespace: crossplane-system
|
||||||
source:
|
source:
|
||||||
path: stacks/core/crossplane-compositions
|
path: stacks/core/crossplane-compositions
|
||||||
repoURL: https://gitea.{{{ .Env.DOMAIN }}}/giteaAdmin/edfbuilder
|
repoURL: https://{{{ .Env.DOMAIN_GITEA }}}/giteaAdmin/edfbuilder
|
||||||
targetRevision: HEAD
|
targetRevision: HEAD
|
||||||
directory:
|
directory:
|
||||||
recurse: true
|
recurse: true
|
||||||
|
|
|
@ -18,6 +18,6 @@ spec:
|
||||||
namespace: crossplane-system
|
namespace: crossplane-system
|
||||||
source:
|
source:
|
||||||
path: stacks/core/crossplane-providers
|
path: stacks/core/crossplane-providers
|
||||||
repoURL: https://gitea.{{{ .Env.DOMAIN }}}/giteaAdmin/edfbuilder
|
repoURL: https://{{{ .Env.DOMAIN_GITEA }}}/giteaAdmin/edfbuilder
|
||||||
targetRevision: HEAD
|
targetRevision: HEAD
|
||||||
{{{ end }}}
|
{{{ end }}}
|
||||||
|
|
22
template/stacks/core/forgejo-runner.yaml
Normal file
22
template/stacks/core/forgejo-runner.yaml
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
apiVersion: argoproj.io/v1alpha1
|
||||||
|
kind: Application
|
||||||
|
metadata:
|
||||||
|
name: forgejo-runner
|
||||||
|
namespace: argocd
|
||||||
|
labels:
|
||||||
|
env: dev
|
||||||
|
finalizers:
|
||||||
|
- resources-finalizer.argocd.argoproj.io
|
||||||
|
spec:
|
||||||
|
project: default
|
||||||
|
syncPolicy:
|
||||||
|
automated:
|
||||||
|
selfHeal: true
|
||||||
|
syncOptions:
|
||||||
|
- CreateNamespace=true
|
||||||
|
destination:
|
||||||
|
server: "https://kubernetes.default.svc"
|
||||||
|
source:
|
||||||
|
repoURL: https://{{{ .Env.DOMAIN_GITEA }}}/giteaAdmin/edfbuilder
|
||||||
|
targetRevision: HEAD
|
||||||
|
path: "stacks/core/forgejo-runner"
|
105
template/stacks/core/forgejo-runner/dind-docker.yaml
Normal file
105
template/stacks/core/forgejo-runner/dind-docker.yaml
Normal file
|
@ -0,0 +1,105 @@
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: forgejo-runner
|
||||||
|
name: forgejo-runner
|
||||||
|
namespace: gitea
|
||||||
|
spec:
|
||||||
|
# Two replicas means that if one is busy, the other can pick up jobs.
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: forgejo-runner
|
||||||
|
strategy: {}
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
creationTimestamp: null
|
||||||
|
labels:
|
||||||
|
app: forgejo-runner
|
||||||
|
spec:
|
||||||
|
restartPolicy: Always
|
||||||
|
volumes:
|
||||||
|
- name: docker-certs
|
||||||
|
emptyDir: {}
|
||||||
|
- name: runner-data
|
||||||
|
emptyDir: {}
|
||||||
|
# Initialise our configuration file using offline registration
|
||||||
|
# https://forgejo.org/docs/v1.21/admin/actions/#offline-registration
|
||||||
|
initContainers:
|
||||||
|
- name: runner-register
|
||||||
|
image: code.forgejo.org/forgejo/runner:6.0.1
|
||||||
|
command:
|
||||||
|
- "forgejo-runner"
|
||||||
|
- "register"
|
||||||
|
- "--no-interactive"
|
||||||
|
- "--token"
|
||||||
|
- $(RUNNER_SECRET)
|
||||||
|
- "--name"
|
||||||
|
- $(RUNNER_NAME)
|
||||||
|
- "--instance"
|
||||||
|
- $(FORGEJO_INSTANCE_URL)
|
||||||
|
- "--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"
|
||||||
|
env:
|
||||||
|
- name: RUNNER_NAME
|
||||||
|
valueFrom:
|
||||||
|
fieldRef:
|
||||||
|
fieldPath: metadata.name
|
||||||
|
- name: RUNNER_SECRET
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: forgejo-runner-token
|
||||||
|
key: token
|
||||||
|
- name: FORGEJO_INSTANCE_URL
|
||||||
|
value: https://{{{ .Env.DOMAIN_GITEA }}}
|
||||||
|
volumeMounts:
|
||||||
|
- name: runner-data
|
||||||
|
mountPath: /data
|
||||||
|
containers:
|
||||||
|
- name: runner
|
||||||
|
image: code.forgejo.org/forgejo/runner:6.0.1
|
||||||
|
command:
|
||||||
|
- "sh"
|
||||||
|
- "-c"
|
||||||
|
- |
|
||||||
|
while ! nc -z 127.0.0.1 2376 </dev/null; do
|
||||||
|
echo 'waiting for docker daemon...';
|
||||||
|
sleep 5;
|
||||||
|
done
|
||||||
|
forgejo-runner generate-config > config.yml ;
|
||||||
|
sed -i -e "s|privileged: .*|privileged: true|" config.yml
|
||||||
|
sed -i -e "s|network: .*|network: host|" config.yml ;
|
||||||
|
sed -i -e "s|^ envs:$$| envs:\n DOCKER_HOST: tcp://127.0.0.1:2376\n DOCKER_TLS_VERIFY: 1\n DOCKER_CERT_PATH: /certs/client|" config.yml ;
|
||||||
|
sed -i -e "s|^ options:| options: -v /certs/client:/certs/client|" config.yml ;
|
||||||
|
sed -i -e "s| valid_volumes: \[\]$$| valid_volumes:\n - /certs/client|" config.yml ;
|
||||||
|
/bin/forgejo-runner --config config.yml daemon
|
||||||
|
securityContext:
|
||||||
|
allowPrivilegeEscalation: true
|
||||||
|
privileged: true
|
||||||
|
readOnlyRootFilesystem: false
|
||||||
|
runAsGroup: 0
|
||||||
|
runAsNonRoot: false
|
||||||
|
runAsUser: 0
|
||||||
|
env:
|
||||||
|
- name: DOCKER_HOST
|
||||||
|
value: tcp://localhost:2376
|
||||||
|
- name: DOCKER_CERT_PATH
|
||||||
|
value: /certs/client
|
||||||
|
- name: DOCKER_TLS_VERIFY
|
||||||
|
value: "1"
|
||||||
|
volumeMounts:
|
||||||
|
- name: docker-certs
|
||||||
|
mountPath: /certs
|
||||||
|
- name: runner-data
|
||||||
|
mountPath: /data
|
||||||
|
- name: daemon
|
||||||
|
image: docker:27.4.1-dind
|
||||||
|
env:
|
||||||
|
- name: DOCKER_TLS_CERTDIR
|
||||||
|
value: /certs
|
||||||
|
securityContext:
|
||||||
|
privileged: true
|
||||||
|
volumeMounts:
|
||||||
|
- name: docker-certs
|
||||||
|
mountPath: /certs
|
|
@ -22,6 +22,6 @@ spec:
|
||||||
helm:
|
helm:
|
||||||
valueFiles:
|
valueFiles:
|
||||||
- $values/stacks/core/forgejo/values.yaml
|
- $values/stacks/core/forgejo/values.yaml
|
||||||
- repoURL: https://gitea.{{{ .Env.DOMAIN }}}/giteaAdmin/edfbuilder
|
- repoURL: https://{{{ .Env.DOMAIN_GITEA }}}/giteaAdmin/edfbuilder
|
||||||
targetRevision: HEAD
|
targetRevision: HEAD
|
||||||
ref: values
|
ref: values
|
||||||
|
|
|
@ -25,8 +25,8 @@ gitea:
|
||||||
queue:
|
queue:
|
||||||
TYPE: level
|
TYPE: level
|
||||||
server:
|
server:
|
||||||
DOMAIN: 'gitea.{{{ .Env.DOMAIN }}}'
|
DOMAIN: '{{{ .Env.DOMAIN_GITEA }}}'
|
||||||
ROOT_URL: 'https://gitea.{{{ .Env.DOMAIN }}}:443'
|
ROOT_URL: 'https://{{{ .Env.DOMAIN_GITEA }}}:443'
|
||||||
|
|
||||||
service:
|
service:
|
||||||
ssh:
|
ssh:
|
||||||
|
@ -53,3 +53,4 @@ forgejo:
|
||||||
- docker:docker://node:16-bullseye
|
- docker:docker://node:16-bullseye
|
||||||
- self-hosted:docker://ghcr.io/catthehacker/ubuntu:act-22.04
|
- self-hosted:docker://ghcr.io/catthehacker/ubuntu:act-22.04
|
||||||
- ubuntu-22.04:docker://ghcr.io/catthehacker/ubuntu:act-22.04
|
- ubuntu-22.04:docker://ghcr.io/catthehacker/ubuntu:act-22.04
|
||||||
|
- ubuntu-latest:docker://ghcr.io/catthehacker/ubuntu:act-22.04
|
||||||
|
|
|
@ -11,7 +11,7 @@ spec:
|
||||||
destination:
|
destination:
|
||||||
server: "https://kubernetes.default.svc"
|
server: "https://kubernetes.default.svc"
|
||||||
source:
|
source:
|
||||||
repoURL: https://gitea.{{{ .Env.DOMAIN }}}/giteaAdmin/edfbuilder
|
repoURL: https://{{{ .Env.DOMAIN_GITEA }}}/giteaAdmin/edfbuilder
|
||||||
targetRevision: HEAD
|
targetRevision: HEAD
|
||||||
path: "stacks/core/ingress-apps"
|
path: "stacks/core/ingress-apps"
|
||||||
project: default
|
project: default
|
||||||
|
|
|
@ -6,7 +6,7 @@ metadata:
|
||||||
nginx.ingress.kubernetes.io/proxy-body-size: 512m
|
nginx.ingress.kubernetes.io/proxy-body-size: 512m
|
||||||
{{{ 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: gitea.{{{ .Env.DOMAIN }}}
|
dns.gardener.cloud/dnsnames: {{{ .Env.DOMAIN_GITEA }}}
|
||||||
dns.gardener.cloud/ttl: "600"
|
dns.gardener.cloud/ttl: "600"
|
||||||
{{{ end }}}
|
{{{ end }}}
|
||||||
name: forgejo
|
name: forgejo
|
||||||
|
@ -14,7 +14,7 @@ metadata:
|
||||||
spec:
|
spec:
|
||||||
ingressClassName: nginx
|
ingressClassName: nginx
|
||||||
rules:
|
rules:
|
||||||
- host: gitea.{{{ .Env.DOMAIN }}}
|
- host: {{{ .Env.DOMAIN_GITEA }}}
|
||||||
http:
|
http:
|
||||||
paths:
|
paths:
|
||||||
- backend:
|
- backend:
|
||||||
|
@ -26,5 +26,5 @@ spec:
|
||||||
pathType: Prefix
|
pathType: Prefix
|
||||||
tls:
|
tls:
|
||||||
- hosts:
|
- hosts:
|
||||||
- gitea.{{{ .Env.DOMAIN }}}
|
- {{{ .Env.DOMAIN_GITEA }}}
|
||||||
secretName: forgejo-net-tls
|
secretName: forgejo-net-tls
|
||||||
|
|
|
@ -22,6 +22,6 @@ spec:
|
||||||
helm:
|
helm:
|
||||||
valueFiles:
|
valueFiles:
|
||||||
- $values/stacks/core/ingress-nginx/values.yaml
|
- $values/stacks/core/ingress-nginx/values.yaml
|
||||||
- repoURL: https://gitea.{{{ .Env.DOMAIN }}}/giteaAdmin/edfbuilder
|
- repoURL: https://{{{ .Env.DOMAIN_GITEA }}}/giteaAdmin/edfbuilder
|
||||||
targetRevision: HEAD
|
targetRevision: HEAD
|
||||||
ref: values
|
ref: values
|
||||||
|
|
|
@ -17,10 +17,10 @@ spec:
|
||||||
valueFiles:
|
valueFiles:
|
||||||
- $values/stacks/local-backup/minio/helm/values.yaml
|
- $values/stacks/local-backup/minio/helm/values.yaml
|
||||||
chart: minio
|
chart: minio
|
||||||
- repoURL: https://gitea.{{{ .Env.DOMAIN }}}/giteaAdmin/edfbuilder
|
- repoURL: https://{{{ .Env.DOMAIN_GITEA }}}/giteaAdmin/edfbuilder
|
||||||
targetRevision: HEAD
|
targetRevision: HEAD
|
||||||
ref: values
|
ref: values
|
||||||
- repoURL: https://gitea.{{{ .Env.DOMAIN }}}/giteaAdmin/edfbuilder
|
- repoURL: https://{{{ .Env.DOMAIN_GITEA }}}/giteaAdmin/edfbuilder
|
||||||
targetRevision: HEAD
|
targetRevision: HEAD
|
||||||
path: "stacks/local-backup/minio/manifests"
|
path: "stacks/local-backup/minio/manifests"
|
||||||
destination:
|
destination:
|
||||||
|
|
|
@ -17,7 +17,7 @@ spec:
|
||||||
valueFiles:
|
valueFiles:
|
||||||
- $values/stacks/local-backup/velero/helm/values.yaml
|
- $values/stacks/local-backup/velero/helm/values.yaml
|
||||||
chart: velero
|
chart: velero
|
||||||
- repoURL: https://gitea.{{{ .Env.DOMAIN }}}/giteaAdmin/edfbuilder
|
- repoURL: https://{{{ .Env.DOMAIN_GITEA }}}/giteaAdmin/edfbuilder
|
||||||
targetRevision: HEAD
|
targetRevision: HEAD
|
||||||
ref: values
|
ref: values
|
||||||
destination:
|
destination:
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
apiVersion: argoproj.io/v1alpha1
|
apiVersion: argoproj.io/v1alpha1
|
||||||
kind: Application
|
kind: Application
|
||||||
metadata:
|
metadata:
|
||||||
name: forgejo-runner
|
name: alloy
|
||||||
namespace: argocd
|
namespace: argocd
|
||||||
labels:
|
labels:
|
||||||
env: dev
|
env: dev
|
||||||
|
@ -16,14 +16,14 @@ spec:
|
||||||
- CreateNamespace=true
|
- CreateNamespace=true
|
||||||
destination:
|
destination:
|
||||||
name: in-cluster
|
name: in-cluster
|
||||||
namespace: gitea
|
namespace: monitoring
|
||||||
sources:
|
sources:
|
||||||
- repoURL: https://forgejo.edf-bootstrap.cx.fg1.ffm.osc.live/DevFW-CICD/forgejo-runner.git
|
- repoURL: https://github.com/grafana/alloy.git
|
||||||
path: forgejo-runner
|
path: operations/helm/charts/alloy
|
||||||
targetRevision: HEAD
|
targetRevision: HEAD
|
||||||
helm:
|
helm:
|
||||||
valueFiles:
|
valueFiles:
|
||||||
- $values/stacks/ref-implementation/forgejo-runner/values.yaml
|
- $values/stacks/monitoring/alloy/values.yaml
|
||||||
- repoURL: https://gitea.{{{ .Env.DOMAIN }}}/giteaAdmin/edfbuilder
|
- repoURL: https://{{{ .Env.DOMAIN_GITEA }}}/giteaAdmin/edfbuilder
|
||||||
targetRevision: HEAD
|
targetRevision: HEAD
|
||||||
ref: values
|
ref: values
|
4
template/stacks/monitoring/alloy/values.yaml
Normal file
4
template/stacks/monitoring/alloy/values.yaml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
alloy:
|
||||||
|
create: false
|
||||||
|
name: alloy-config
|
||||||
|
key: config.alloy
|
|
@ -10,7 +10,7 @@ metadata:
|
||||||
spec:
|
spec:
|
||||||
project: default
|
project: default
|
||||||
source:
|
source:
|
||||||
repoURL: https://gitea.{{{ .Env.DOMAIN }}}/giteaAdmin/edfbuilder
|
repoURL: https://{{{ .Env.DOMAIN_GITEA }}}/giteaAdmin/edfbuilder
|
||||||
targetRevision: HEAD
|
targetRevision: HEAD
|
||||||
path: "stacks/monitoring/kube-prometheus/dashboards"
|
path: "stacks/monitoring/kube-prometheus/dashboards"
|
||||||
destination:
|
destination:
|
||||||
|
|
29
template/stacks/monitoring/kube-prometheus-sso.yaml
Normal file
29
template/stacks/monitoring/kube-prometheus-sso.yaml
Normal 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
|
|
@ -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
|
|
@ -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
|
||||||
|
@ -25,6 +31,6 @@ spec:
|
||||||
helm:
|
helm:
|
||||||
valueFiles:
|
valueFiles:
|
||||||
- $values/stacks/monitoring/kube-prometheus/values.yaml
|
- $values/stacks/monitoring/kube-prometheus/values.yaml
|
||||||
- repoURL: https://gitea.{{{ .Env.DOMAIN }}}/giteaAdmin/edfbuilder
|
- repoURL: https://{{{ .Env.DOMAIN_GITEA }}}/giteaAdmin/edfbuilder
|
||||||
targetRevision: HEAD
|
targetRevision: HEAD
|
||||||
ref: values
|
ref: values
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -24,7 +24,7 @@ spec:
|
||||||
helm:
|
helm:
|
||||||
valueFiles:
|
valueFiles:
|
||||||
- $values/stacks/monitoring/loki/values.yaml
|
- $values/stacks/monitoring/loki/values.yaml
|
||||||
- repoURL: https://gitea.{{{ .Env.DOMAIN }}}/giteaAdmin/edfbuilder
|
- repoURL: https://{{{ .Env.DOMAIN_GITEA }}}/giteaAdmin/edfbuilder
|
||||||
targetRevision: HEAD
|
targetRevision: HEAD
|
||||||
ref: values
|
ref: values
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,6 @@ spec:
|
||||||
helm:
|
helm:
|
||||||
valueFiles:
|
valueFiles:
|
||||||
- $values/stacks/monitoring/promtail/values.yaml
|
- $values/stacks/monitoring/promtail/values.yaml
|
||||||
- repoURL: https://gitea.{{{ .Env.DOMAIN }}}/giteaAdmin/edfbuilder
|
- repoURL: https://{{{ .Env.DOMAIN_GITEA }}}/giteaAdmin/edfbuilder
|
||||||
targetRevision: HEAD
|
targetRevision: HEAD
|
||||||
ref: values
|
ref: values
|
|
@ -10,7 +10,7 @@ metadata:
|
||||||
spec:
|
spec:
|
||||||
project: default
|
project: default
|
||||||
source:
|
source:
|
||||||
repoURL: https://gitea.{{{ .Env.DOMAIN }}}/giteaAdmin/edfbuilder
|
repoURL: https://{{{ .Env.DOMAIN_GITEA }}}/giteaAdmin/edfbuilder
|
||||||
targetRevision: HEAD
|
targetRevision: HEAD
|
||||||
path: "stacks/ref-implementation/argo-workflows/manifests/dev"
|
path: "stacks/ref-implementation/argo-workflows/manifests/dev"
|
||||||
destination:
|
destination:
|
||||||
|
@ -23,3 +23,7 @@ spec:
|
||||||
selfHeal: true
|
selfHeal: true
|
||||||
retry:
|
retry:
|
||||||
limit: -1
|
limit: -1
|
||||||
|
backoff:
|
||||||
|
duration: 15s
|
||||||
|
factor: 1
|
||||||
|
maxDuration: 15s
|
||||||
|
|
|
@ -10,7 +10,7 @@ metadata:
|
||||||
spec:
|
spec:
|
||||||
project: default
|
project: default
|
||||||
source:
|
source:
|
||||||
repoURL: https://gitea.{{{ .Env.DOMAIN }}}/giteaAdmin/edfbuilder
|
repoURL: https://{{{ .Env.DOMAIN_GITEA }}}/giteaAdmin/edfbuilder
|
||||||
targetRevision: HEAD
|
targetRevision: HEAD
|
||||||
path: "stacks/ref-implementation/backstage-templates/entities"
|
path: "stacks/ref-implementation/backstage-templates/entities"
|
||||||
directory:
|
directory:
|
||||||
|
|
|
@ -20,7 +20,7 @@ metadata:
|
||||||
backstage.io/kubernetes-namespace: default
|
backstage.io/kubernetes-namespace: default
|
||||||
argocd/app-name: ${{values.name | dump}}
|
argocd/app-name: ${{values.name | dump}}
|
||||||
links:
|
links:
|
||||||
- url: https://gitea.{{{ .Env.DOMAIN }}}:443
|
- url: https://{{{ .Env.DOMAIN_GITEA }}}:443
|
||||||
title: Repo URL
|
title: Repo URL
|
||||||
icon: github
|
icon: github
|
||||||
spec:
|
spec:
|
||||||
|
|
|
@ -100,7 +100,7 @@ spec:
|
||||||
input:
|
input:
|
||||||
description: This is an example app
|
description: This is an example app
|
||||||
# Hard coded value for this demo purposes only.
|
# Hard coded value for this demo purposes only.
|
||||||
repoUrl: gitea.{{{ .Env.DOMAIN }}}:443/?repo=${{parameters.name}}
|
repoUrl: {{{ .Env.DOMAIN_GITEA }}}:443/?repo=${{parameters.name}}
|
||||||
defaultBranch: main
|
defaultBranch: main
|
||||||
- id: create-argocd-app
|
- id: create-argocd-app
|
||||||
name: Create ArgoCD App
|
name: Create ArgoCD App
|
||||||
|
@ -111,7 +111,7 @@ spec:
|
||||||
argoInstance: in-cluster
|
argoInstance: in-cluster
|
||||||
projectName: default
|
projectName: default
|
||||||
# necessary until we generate our own cert
|
# necessary until we generate our own cert
|
||||||
repoUrl: https://gitea.{{{ .Env.DOMAIN }}}:443/giteaAdmin/${{parameters.name}}
|
repoUrl: https://{{{ .Env.DOMAIN_GITEA }}}:443/giteaAdmin/${{parameters.name}}
|
||||||
path: "kustomize/base"
|
path: "kustomize/base"
|
||||||
- id: register
|
- id: register
|
||||||
name: Register
|
name: Register
|
||||||
|
|
|
@ -14,7 +14,7 @@ metadata:
|
||||||
apache-spark.cnoe.io/label-selector: env=dev,entity-id=${{values.name}}
|
apache-spark.cnoe.io/label-selector: env=dev,entity-id=${{values.name}}
|
||||||
apache-spark.cnoe.io/cluster-name: local
|
apache-spark.cnoe.io/cluster-name: local
|
||||||
links:
|
links:
|
||||||
- url: https://gitea.{{{ .Env.DOMAIN }}}:443
|
- url: https://{{{ .Env.DOMAIN_GITEA }}}:443
|
||||||
title: Repo URL
|
title: Repo URL
|
||||||
icon: github
|
icon: github
|
||||||
spec:
|
spec:
|
||||||
|
|
|
@ -35,7 +35,7 @@ spec:
|
||||||
input:
|
input:
|
||||||
description: This is an example app
|
description: This is an example app
|
||||||
# Hard coded value for this demo purposes only.
|
# Hard coded value for this demo purposes only.
|
||||||
repoUrl: gitea.{{{ .Env.DOMAIN }}}:443/?repo=${{parameters.name}}
|
repoUrl: {{{ .Env.DOMAIN_GITEA }}}:443/?repo=${{parameters.name}}
|
||||||
defaultBranch: main
|
defaultBranch: main
|
||||||
- id: create-argocd-app
|
- id: create-argocd-app
|
||||||
name: Create ArgoCD App
|
name: Create ArgoCD App
|
||||||
|
@ -46,7 +46,7 @@ spec:
|
||||||
argoInstance: in-cluster
|
argoInstance: in-cluster
|
||||||
projectName: default
|
projectName: default
|
||||||
# necessary until we generate our own cert
|
# necessary until we generate our own cert
|
||||||
repoUrl: https://gitea.{{{ .Env.DOMAIN }}}:443/giteaAdmin/${{parameters.name}}
|
repoUrl: https://{{{ .Env.DOMAIN_GITEA }}}:443/giteaAdmin/${{parameters.name}}
|
||||||
path: "manifests"
|
path: "manifests"
|
||||||
- id: register
|
- id: register
|
||||||
name: Register
|
name: Register
|
||||||
|
|
|
@ -10,7 +10,7 @@ metadata:
|
||||||
backstage.io/kubernetes-namespace: default
|
backstage.io/kubernetes-namespace: default
|
||||||
argocd/app-name: ${{values.name | dump}}
|
argocd/app-name: ${{values.name | dump}}
|
||||||
links:
|
links:
|
||||||
- url: https://gitea.{{{ .Env.DOMAIN }}}:443
|
- url: https://{{{ .Env.DOMAIN_GITEA }}}:443
|
||||||
title: Repo URL
|
title: Repo URL
|
||||||
icon: github
|
icon: github
|
||||||
spec:
|
spec:
|
||||||
|
|
|
@ -31,7 +31,7 @@ spec:
|
||||||
input:
|
input:
|
||||||
description: This is an example app
|
description: This is an example app
|
||||||
# Hard coded value for this demo purposes only.
|
# Hard coded value for this demo purposes only.
|
||||||
repoUrl: gitea.{{{ .Env.DOMAIN }}}:443/?repo=${{parameters.name}}
|
repoUrl: {{{ .Env.DOMAIN_GITEA }}}:443/?repo=${{parameters.name}}
|
||||||
defaultBranch: main
|
defaultBranch: main
|
||||||
- id: create-argocd-app
|
- id: create-argocd-app
|
||||||
name: Create ArgoCD App
|
name: Create ArgoCD App
|
||||||
|
@ -42,7 +42,7 @@ spec:
|
||||||
argoInstance: in-cluster
|
argoInstance: in-cluster
|
||||||
projectName: default
|
projectName: default
|
||||||
# necessary until we generate our own cert
|
# necessary until we generate our own cert
|
||||||
repoUrl: https://gitea.{{{ .Env.DOMAIN }}}:443/giteaAdmin/${{parameters.name}}
|
repoUrl: https://{{{ .Env.DOMAIN_GITEA }}}:443/giteaAdmin/${{parameters.name}}
|
||||||
path: "manifests"
|
path: "manifests"
|
||||||
- id: register
|
- id: register
|
||||||
name: Register
|
name: Register
|
||||||
|
|
|
@ -9,7 +9,7 @@ metadata:
|
||||||
backstage.io/kubernetes-label-selector: 'entity-id=${{ values.name }}'
|
backstage.io/kubernetes-label-selector: 'entity-id=${{ values.name }}'
|
||||||
backstage.io/kubernetes-namespace: gitea
|
backstage.io/kubernetes-namespace: gitea
|
||||||
links:
|
links:
|
||||||
- url: https://gitea.{{{ .Env.DOMAIN }}}:443
|
- url: https://{{{ .Env.DOMAIN_GITEA }}}:443
|
||||||
title: Repo URL
|
title: Repo URL
|
||||||
icon: git
|
icon: git
|
||||||
spec:
|
spec:
|
||||||
|
@ -26,7 +26,7 @@ metadata:
|
||||||
annotations:
|
annotations:
|
||||||
backstage.io/techdocs-ref: dir:.
|
backstage.io/techdocs-ref: dir:.
|
||||||
links:
|
links:
|
||||||
- url: https://gitea.{{{ .Env.DOMAIN }}}:443
|
- url: https://{{{ .Env.DOMAIN_GITEA }}}:443
|
||||||
title: Gitea Repo
|
title: Gitea Repo
|
||||||
icon: git
|
icon: git
|
||||||
spec:
|
spec:
|
||||||
|
|
|
@ -33,7 +33,7 @@ spec:
|
||||||
name: Publish to Gitea
|
name: Publish to Gitea
|
||||||
action: publish:gitea
|
action: publish:gitea
|
||||||
input:
|
input:
|
||||||
repoUrl: gitea.{{{ .Env.DOMAIN }}}:443/?repo=${{parameters.name}}
|
repoUrl: {{{ .Env.DOMAIN_GITEA }}}:443/?repo=${{parameters.name}}
|
||||||
description: This is the repository for ${{ parameters.name }}
|
description: This is the repository for ${{ parameters.name }}
|
||||||
sourcePath: ./skeleton
|
sourcePath: ./skeleton
|
||||||
defaultBranch: main
|
defaultBranch: main
|
||||||
|
|
|
@ -1,32 +0,0 @@
|
||||||
# This workflow will build a Java project with Gradle, and cache/restore any dependencies to improve the workflow execution time
|
|
||||||
# For more information see: https://docs.github.com/en/actions/use-cases-and-examples/building-and-testing/building-and-testing-java-with-gradle
|
|
||||||
|
|
||||||
name: Java CI with Gradle
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ main ]
|
|
||||||
pull_request:
|
|
||||||
branches: [ main ]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
java: [ '17' ]
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Set up JDK {% raw %}${{matrix.java}}{% endraw %}
|
|
||||||
uses: https://github.com/actions/setup-java@v4
|
|
||||||
with:
|
|
||||||
java-version: '{% raw %}${{matrix.java}}{% endraw %}'
|
|
||||||
distribution: 'adopt'
|
|
||||||
cache: maven
|
|
||||||
- name: Setup Gradle
|
|
||||||
uses: https://github.com/gradle/actions/setup-gradle@v4
|
|
||||||
- name: Build with Gradle
|
|
||||||
run: ./gradlew build
|
|
||||||
|
|
|
@ -28,12 +28,12 @@ jobs:
|
||||||
distribution: 'adopt'
|
distribution: 'adopt'
|
||||||
cache: maven
|
cache: maven
|
||||||
- name: Build with Maven Wrapper
|
- name: Build with Maven Wrapper
|
||||||
run: ./mvnw -B verify
|
run: ./mvnw -B -DskipTests verify
|
||||||
- name: Build image
|
- name: Build image
|
||||||
#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=gitea.{{{ .Env.DOMAIN }}}/${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 %}${{ github.actor }}{% 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
|
||||||
|
|
|
@ -9,7 +9,7 @@ metadata:
|
||||||
backstage.io/kubernetes-label-selector: 'entity-id=${{ values.name }}'
|
backstage.io/kubernetes-label-selector: 'entity-id=${{ values.name }}'
|
||||||
backstage.io/kubernetes-namespace: gitea
|
backstage.io/kubernetes-namespace: gitea
|
||||||
links:
|
links:
|
||||||
- url: https://gitea.{{{ .Env.DOMAIN }}}:443
|
- url: https://{{{ .Env.DOMAIN_GITEA }}}:443
|
||||||
title: Repo URL
|
title: Repo URL
|
||||||
icon: git
|
icon: git
|
||||||
spec:
|
spec:
|
||||||
|
@ -26,7 +26,7 @@ metadata:
|
||||||
annotations:
|
annotations:
|
||||||
backstage.io/techdocs-ref: dir:.
|
backstage.io/techdocs-ref: dir:.
|
||||||
links:
|
links:
|
||||||
- url: https://gitea.{{{ .Env.DOMAIN }}}:443
|
- url: https://{{{ .Env.DOMAIN_GITEA }}}:443
|
||||||
title: Gitea Repo
|
title: Gitea Repo
|
||||||
icon: git
|
icon: git
|
||||||
spec:
|
spec:
|
||||||
|
|
|
@ -58,7 +58,7 @@ spec:
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: workload
|
- name: workload
|
||||||
image: gitea.{{{ .Env.DOMAIN }}}/giteaadmin/${{ values.name }}
|
image: {{{ .Env.DOMAIN_GITEA }}}/giteaadmin/${{ values.name }}
|
||||||
env:
|
env:
|
||||||
- name: SPRING_PROFILES_ACTIVE
|
- name: SPRING_PROFILES_ACTIVE
|
||||||
value: postgres
|
value: postgres
|
||||||
|
|
|
@ -50,7 +50,7 @@ spec:
|
||||||
name: Publish to Gitea
|
name: Publish to Gitea
|
||||||
action: publish:gitea
|
action: publish:gitea
|
||||||
input:
|
input:
|
||||||
repoUrl: gitea.{{{ .Env.DOMAIN }}}:443/?repo=${{parameters.name}}
|
repoUrl: {{{ .Env.DOMAIN_GITEA }}}:443/?repo=${{parameters.name}}
|
||||||
description: This is the repository for ${{ parameters.name }}
|
description: This is the repository for ${{ parameters.name }}
|
||||||
sourcePath: ./
|
sourcePath: ./
|
||||||
defaultBranch: main
|
defaultBranch: main
|
||||||
|
@ -64,7 +64,7 @@ spec:
|
||||||
argoInstance: in-cluster
|
argoInstance: in-cluster
|
||||||
projectName: default
|
projectName: default
|
||||||
# necessary until we generate our own cert
|
# necessary until we generate our own cert
|
||||||
repoUrl: https://gitea.{{{ .Env.DOMAIN }}}:443/giteaAdmin/${{parameters.name}}
|
repoUrl: https://{{{ .Env.DOMAIN_GITEA }}}:443/giteaAdmin/${{parameters.name}}
|
||||||
path: "k8s"
|
path: "k8s"
|
||||||
|
|
||||||
- id: register
|
- id: register
|
||||||
|
|
|
@ -10,7 +10,7 @@ metadata:
|
||||||
spec:
|
spec:
|
||||||
project: default
|
project: default
|
||||||
source:
|
source:
|
||||||
repoURL: https://gitea.{{{ .Env.DOMAIN }}}/giteaAdmin/edfbuilder
|
repoURL: https://{{{ .Env.DOMAIN_GITEA }}}/giteaAdmin/edfbuilder
|
||||||
targetRevision: HEAD
|
targetRevision: HEAD
|
||||||
path: "stacks/ref-implementation/backstage/manifests"
|
path: "stacks/ref-implementation/backstage/manifests"
|
||||||
destination:
|
destination:
|
||||||
|
@ -23,3 +23,7 @@ spec:
|
||||||
selfHeal: true
|
selfHeal: true
|
||||||
retry:
|
retry:
|
||||||
limit: -1
|
limit: -1
|
||||||
|
backoff:
|
||||||
|
duration: 15s
|
||||||
|
factor: 1
|
||||||
|
maxDuration: 15s
|
||||||
|
|
|
@ -106,12 +106,12 @@ data:
|
||||||
|
|
||||||
integrations:
|
integrations:
|
||||||
gitea:
|
gitea:
|
||||||
- baseUrl: https://gitea.{{{ .Env.DOMAIN }}}:443
|
- baseUrl: https://{{{ .Env.DOMAIN_GITEA }}}:443
|
||||||
host: gitea.{{{ .Env.DOMAIN }}}:443
|
host: {{{ .Env.DOMAIN_GITEA }}}:443
|
||||||
username: ${GITEA_USERNAME}
|
username: ${GITEA_USERNAME}
|
||||||
password: ${GITEA_PASSWORD}
|
password: ${GITEA_PASSWORD}
|
||||||
- baseUrl: https://gitea.{{{ .Env.DOMAIN }}}
|
- baseUrl: https://{{{ .Env.DOMAIN_GITEA }}}
|
||||||
host: gitea.{{{ .Env.DOMAIN }}}
|
host: {{{ .Env.DOMAIN_GITEA }}}
|
||||||
username: ${GITEA_USERNAME}
|
username: ${GITEA_USERNAME}
|
||||||
password: ${GITEA_PASSWORD}
|
password: ${GITEA_PASSWORD}
|
||||||
- baseUrl: https://forgejo.edf-bootstrap.cx.fg1.ffm.osc.live
|
- baseUrl: https://forgejo.edf-bootstrap.cx.fg1.ffm.osc.live
|
||||||
|
@ -167,7 +167,7 @@ data:
|
||||||
locations:
|
locations:
|
||||||
# Examples from a public GitHub repository.
|
# Examples from a public GitHub repository.
|
||||||
- type: url
|
- type: url
|
||||||
target: https://gitea.{{{ .Env.DOMAIN }}}:443/giteaAdmin/edfbuilder/raw/branch/main/stacks/ref-implementation/backstage-templates/entities/catalog-info.yaml
|
target: https://{{{ .Env.DOMAIN_GITEA }}}:443/giteaAdmin/edfbuilder/raw/branch/main/stacks/ref-implementation/backstage-templates/entities/catalog-info.yaml
|
||||||
rules:
|
rules:
|
||||||
- allow: [Component, System, API, Resource, Location, Template, User, Group]
|
- allow: [Component, System, API, Resource, Location, Template, User, Group]
|
||||||
kubernetes:
|
kubernetes:
|
||||||
|
|
|
@ -12,7 +12,7 @@ spec:
|
||||||
namespace: external-secrets
|
namespace: external-secrets
|
||||||
server: "https://kubernetes.default.svc"
|
server: "https://kubernetes.default.svc"
|
||||||
source:
|
source:
|
||||||
repoURL: https://gitea.{{{ .Env.DOMAIN }}}/giteaAdmin/edfbuilder
|
repoURL: https://{{{ .Env.DOMAIN_GITEA }}}/giteaAdmin/edfbuilder
|
||||||
targetRevision: HEAD
|
targetRevision: HEAD
|
||||||
path: "stacks/ref-implementation/external-secrets/manifests"
|
path: "stacks/ref-implementation/external-secrets/manifests"
|
||||||
project: default
|
project: default
|
||||||
|
|
|
@ -10,7 +10,7 @@ metadata:
|
||||||
spec:
|
spec:
|
||||||
project: default
|
project: default
|
||||||
source:
|
source:
|
||||||
repoURL: https://gitea.{{{ .Env.DOMAIN }}}/giteaAdmin/edfbuilder
|
repoURL: https://{{{ .Env.DOMAIN_GITEA }}}/giteaAdmin/edfbuilder
|
||||||
targetRevision: HEAD
|
targetRevision: HEAD
|
||||||
path: "stacks/ref-implementation/fibonacci-app"
|
path: "stacks/ref-implementation/fibonacci-app"
|
||||||
destination:
|
destination:
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
replicaCount: 1
|
|
||||||
|
|
||||||
image:
|
|
||||||
repository: code.forgejo.org/forgejo/runner
|
|
||||||
pullPolicy: IfNotPresent
|
|
||||||
tag: "3.5.1"
|
|
||||||
|
|
||||||
resources:
|
|
||||||
limits:
|
|
||||||
memory: 2Gi
|
|
||||||
requests:
|
|
||||||
memory: 1Gi
|
|
||||||
|
|
||||||
forgejoUrl: http://forgejo-http.gitea.svc.cluster.local:3000
|
|
|
@ -12,7 +12,7 @@ spec:
|
||||||
namespace: keycloak
|
namespace: keycloak
|
||||||
server: "https://kubernetes.default.svc"
|
server: "https://kubernetes.default.svc"
|
||||||
source:
|
source:
|
||||||
repoURL: https://gitea.{{{ .Env.DOMAIN }}}/giteaAdmin/edfbuilder
|
repoURL: https://{{{ .Env.DOMAIN_GITEA }}}/giteaAdmin/edfbuilder
|
||||||
targetRevision: HEAD
|
targetRevision: HEAD
|
||||||
path: "stacks/ref-implementation/keycloak/manifests"
|
path: "stacks/ref-implementation/keycloak/manifests"
|
||||||
project: default
|
project: default
|
||||||
|
|
|
@ -100,11 +100,11 @@ data:
|
||||||
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"
|
||||||
],
|
],
|
||||||
|
@ -113,11 +113,11 @@ data:
|
||||||
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"
|
||||||
],
|
],
|
||||||
|
@ -181,6 +181,44 @@ data:
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
---
|
---
|
||||||
apiVersion: batch/v1
|
apiVersion: batch/v1
|
||||||
kind: Job
|
kind: Job
|
||||||
|
@ -247,7 +285,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"
|
||||||
|
@ -330,7 +372,24 @@ spec:
|
||||||
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}" \
|
||||||
|
@ -365,6 +424,8 @@ 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
|
||||||
" > /tmp/secret.yaml
|
" > /tmp/secret.yaml
|
||||||
|
|
||||||
./kubectl apply -f /tmp/secret.yaml
|
./kubectl apply -f /tmp/secret.yaml
|
||||||
|
|
|
@ -24,7 +24,7 @@ spec:
|
||||||
helm:
|
helm:
|
||||||
valueFiles:
|
valueFiles:
|
||||||
- $values/stacks/ref-implementation/openbao/values.yaml
|
- $values/stacks/ref-implementation/openbao/values.yaml
|
||||||
- repoURL: https://gitea.{{{ .Env.DOMAIN }}}/giteaAdmin/edfbuilder
|
- repoURL: https://{{{ .Env.DOMAIN_GITEA }}}/giteaAdmin/edfbuilder
|
||||||
targetRevision: HEAD
|
targetRevision: HEAD
|
||||||
ref: values
|
ref: values
|
||||||
ignoreDifferences:
|
ignoreDifferences:
|
||||||
|
|
|
@ -19,5 +19,5 @@ spec:
|
||||||
namespace: crossplane-system
|
namespace: crossplane-system
|
||||||
source:
|
source:
|
||||||
path: stacks/second-cluster/create-new-cluster-guestbook
|
path: stacks/second-cluster/create-new-cluster-guestbook
|
||||||
repoURL: https://gitea.{{{ .Env.DOMAIN }}}/giteaAdmin/edfbuilder
|
repoURL: https://{{{ .Env.DOMAIN_GITEA }}}/giteaAdmin/edfbuilder
|
||||||
targetRevision: HEAD
|
targetRevision: HEAD
|
||||||
|
|
Loading…
Reference in a new issue