Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • stackspin/stackspin-flux-example
  • xeruf/stackspout
2 results
Show changes
Commits on Source (76)
Showing
with 385 additions and 41 deletions
......@@ -28,17 +28,16 @@ basic/install.sh
List the resource created by this flux repo:
```sh
kubectl -n example-basic get gitrepositories
kubectl -n example-basic get kustomizations
kubectl -n example-basic get helmreleases
kubectl -n example-basic get pods
kubectl -n stackspout get gitrepositories
kubectl -n stackspout get kustomizations
kubectl -n stackspout get helmreleases
kubectl -n stackspout get pods
```
Show output of the single app applied, [podinfo](https://github.com/stefanprodan/podinfo)
## Customizations
```sh
curl --resolve podinfo.local:80:CLUSTER_IPV4_ADDRESS http://podinfo.local
```
- Nextcloud apps overrides
- Gitea installed
## What's next ?
......
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: gitea-data
namespace: stackspout
labels:
stackspin.net/backupSet: "gitea"
spec:
accessModes:
- ReadWriteOnce
volumeMode: Filesystem
resources:
requests:
storage: 2Gi
storageClassName: local-path
apiVersion: hydra.ory.sh/v1alpha1
kind: OAuth2Client
metadata:
name: gitea-oauth-client
# Has to live in the same namespace as the stackspin-wordpress-oauth-variables secret
namespace: flux-system
spec:
# TODO copied from wekan: https://github.com/wekan/wekan/wiki/Keycloak
grantTypes:
- authorization_code
- refresh_token
- client_credentials
- implicit
responseTypes:
- id_token
- code
scope: "openid profile email stackspin_roles"
secretName: stackspin-gitea-oauth-variables
redirectUris:
- https://dev.${domain}/user/oauth2/Stackspin/callback
tokenEndpointAuthMethod: client_secret_post
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: gitea-postgres
namespace: stackspout
labels:
stackspin.net/backupSet: "gitea"
spec:
accessModes:
- ReadWriteOnce
volumeMode: Filesystem
resources:
requests:
storage: 2Gi
storageClassName: local-path
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: gitea
namespace: stackspout
spec:
releaseName: gitea
chart:
spec:
chart: gitea
version: 5.0.9
sourceRef:
kind: HelmRepository
name: gitea
namespace: flux-system
interval: 5m
valuesFrom:
- kind: ConfigMap
name: stackspin-gitea-values
optional: false
# Allow overriding values by ConfigMap or Secret
- kind: ConfigMap
name: stackspin-gitea-override
optional: true
- kind: Secret
name: stackspin-gitea-override
optional: true
---
apiVersion: v1
kind: ConfigMap
metadata:
name: stackspin-gitea-values
namespace: stackspout
data:
values.yaml: |
ingress:
enabled: true
annotations:
kubernetes.io/tls-acme: "true"
hosts:
- host: "dev.${domain}"
paths:
- path: /
pathType: Prefix
tls:
- secretName: gitea-tls
hosts:
- "dev.${domain}"
- "tmpdev.${domain}"
gitea:
oauth:
- name: Stackspin
provider: "openidConnect"
key: "${client_id}"
secret: "${client_secret}"
autoDiscoverUrl: "https://sso.${domain}/.well-known/openid-configuration"
config:
server:
ROOT_URL: "https://dev.${domain}"
persistence:
enabled: true
existingClaim: gitea-data
postgresql:
persistence:
enabled: true
existingClaim: gitea-postgres
apiVersion: hydra.ory.sh/v1alpha1
kind: OAuth2Client
metadata:
name: vikunja-oauth-client
# Has to live in the same namespace as the stackspin-wordpress-oauth-variables secret
namespace: flux-system
spec:
# TODO copied from wekan: https://github.com/wekan/wekan/wiki/Keycloak
grantTypes:
- authorization_code
- refresh_token
- client_credentials
- implicit
responseTypes:
- id_token
- code
scope: "openid profile email stackspin_roles"
secretName: stackspin-vikunja-oauth-variables
redirectUris:
- https://do.${domain}/auth/openid/stackspin
tokenEndpointAuthMethod: client_secret_post
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: vikunja
namespace: stackspout
spec:
releaseName: vikunja
chart:
spec:
chart: vikunja
version: 5.5.3
sourceRef:
kind: HelmRepository
name: k8s-at-home
namespace: flux-system
interval: 5m
valuesFrom:
- kind: ConfigMap
name: stackspin-vikunja-values
optional: false
# Allow overriding values by ConfigMap or Secret
- kind: ConfigMap
name: stackspin-vikunja-override
optional: true
- kind: Secret
name: stackspin-vikunja-override
optional: true
---
apiVersion: v1
kind: ConfigMap
metadata:
name: stackspin-vikunja-values
namespace: stackspout
data:
# Defaults: https://github.com/k8s-at-home/charts/blob/master/charts/stable/vikunja/values.yaml
# Inherits: https://github.com/k8s-at-home/library-charts/blob/main/charts/stable/common/values.yaml
values.yaml: |
vikunja:
config: |-
auth:
openid:
# https://vikunja.io/docs/config-options/#openid
# Example: https://github.com/go-vikunja/api/blob/main/config.yml.sample#L289-L312
enabled: true
redirecturl: "https://do.${domain}/auth/openid/"
providers:
- name: Stackspin
authurl: "https://sso.${domain}/"
clientid: "${client_id}"
clientsecret: "${client_secret}"
local:
enabled: false
ingress:
main:
enabled: true
primary: false
annotations:
kubernetes.io/tls-acme: "true"
hosts:
- host: "do.${domain}"
paths:
- path: /
pathType: Prefix
tls:
- secretName: vikunja-tls
hosts:
- "do.${domain}"
- "tmpdo.${domain}"
additionalContainers:
api:
image: vikunja/api:0.18.1
frontend:
image: vikunja/frontend:0.18.2
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: podinfo
namespace: example-basic
spec:
releaseName: podinfo
chart:
spec:
# https://artifacthub.io/packages/helm/podinfo/podinfo
chart: podinfo
version: 6.1.1
sourceRef:
kind: HelmRepository
name: podinfo
namespace: example-basic
interval: 60m
# Default values
# https://github.com/stefanprodan/podinfo/blob/master/charts/podinfo/values.yaml
values:
ingress:
enabled: true
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: suitecrm
namespace: stackspout
spec:
releaseName: suitecrm
chart:
spec:
chart: suitecrm
version: 11.1.10
sourceRef:
kind: HelmRepository
name: bitnami
namespace: flux-system
interval: 5m
valuesFrom:
- kind: ConfigMap
name: stackspin-suitecrm-values
optional: false
# Allow overriding values by ConfigMap or Secret
- kind: ConfigMap
name: stackspin-suitecrm-override
optional: true
- kind: Secret
name: stackspin-suitecrm-override
optional: true
---
apiVersion: v1
kind: ConfigMap
metadata:
name: stackspin-suitecrm-values
namespace: stackspout
data:
values.yaml: |
ingress:
enabled: true
#annotations:
# kubernetes.io/tls-acme: "true"
hostname: "people.${domain}"
tls: true
certManager: true
suitecrmUsername: "admin"
suitecrmEmail: "${admin_email}"
existingSecret: stackspin-suitecrm-variables
mariadb:
auth:
password: "${mariadb-password}"
rootPassword: "${mariadb-root-password}"
# TODO Adjust OIDC SSO to service
# - name: Stackspin
# key: "${client_id}"
# secret: "${client_secret}"
# customAuthUrl: "https://people.${domain}/login/login"
---
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
kind: Kustomization
metadata:
name: gitea
namespace: flux-system
spec:
interval: 30m
wait: true
timeout: 1h
dependsOn:
- name: single-sign-on
sourceRef:
kind: GitRepository
name: stackspout
path: ./basic/apps/dev
prune: true
postBuild:
substituteFrom:
#- kind: Secret
# name: stackspin-gitea-variables
- kind: Secret
name: stackspin-gitea-oauth-variables
- kind: Secret
name: stackspin-cluster-variables
apiVersion: kustomize.toolkit.fluxcd.io/v1beta1
kind: Kustomization
metadata:
name: example-infrastructure
namespace: example-basic
name: stackspout-namespace
namespace: flux-system
spec:
interval: 24h
interval: 30m
sourceRef:
kind: GitRepository
name: stackspin-flux-example
path: ./basic/infrastructure
name: stackspout
path: ./basic/infrastructure/namespaces
prune: true
validation: client
apiVersion: kustomize.toolkit.fluxcd.io/v1beta1
kind: Kustomization
metadata:
name: stackspout-overrides
namespace: flux-system
spec:
interval: 2m
sourceRef:
kind: GitRepository
name: stackspout
path: ./basic/overrides
prune: true
validation: client
postBuild:
substituteFrom:
- kind: Secret
name: stackspin-cluster-variables
apiVersion: kustomize.toolkit.fluxcd.io/v1beta1
kind: Kustomization
metadata:
name: examle-apps
namespace: example-basic
name: stackspout-sources
namespace: flux-system
spec:
interval: 24h
interval: 30m
sourceRef:
kind: GitRepository
name: stackspin-flux-example
path: ./basic/apps
name: stackspout
path: ./basic/infrastructure/sources
prune: true
validation: client
---
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
kind: Kustomization
metadata:
name: suitecrm
namespace: flux-system
spec:
interval: 30m
wait: true
timeout: 1h
#dependsOn:
# - name: single-sign-on
sourceRef:
kind: GitRepository
name: stackspout
path: ./basic/apps/people
prune: true
postBuild:
substituteFrom:
- kind: Secret
name: stackspin-suitecrm-variables
#- kind: Secret
# name: stackspin-suitecrm-oauth-variables
- kind: Secret
name: stackspin-cluster-variables
---
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
kind: Kustomization
metadata:
name: vikunja
namespace: flux-system
spec:
interval: 30m
wait: true
timeout: 1h
dependsOn:
- name: single-sign-on
sourceRef:
kind: GitRepository
name: stackspout
path: ./basic/apps/do
prune: true
postBuild:
substituteFrom:
#- kind: Secret
# name: stackspin-vikunja-variables
- kind: Secret
name: stackspin-vikunja-oauth-variables
- kind: Secret
name: stackspin-cluster-variables
apiVersion: v1
kind: Namespace
metadata:
name: example-basic
name: stackspout
apiVersion: source.toolkit.fluxcd.io/v1beta1
kind: HelmRepository
metadata:
name: podinfo
namespace: example-basic
name: gitea
namespace: flux-system
spec:
interval: 1h
url: https://stefanprodan.github.io/podinfo
interval: 60m
url: https://dl.gitea.io/charts/