Finished keycloak deployment
This commit is contained in:
23
keycloak-argocd-apps/.helmignore
Normal file
23
keycloak-argocd-apps/.helmignore
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
# Patterns to ignore when building packages.
|
||||||
|
# This supports shell glob matching, relative path matching, and
|
||||||
|
# negation (prefixed with !). Only one pattern per line.
|
||||||
|
.DS_Store
|
||||||
|
# Common VCS dirs
|
||||||
|
.git/
|
||||||
|
.gitignore
|
||||||
|
.bzr/
|
||||||
|
.bzrignore
|
||||||
|
.hg/
|
||||||
|
.hgignore
|
||||||
|
.svn/
|
||||||
|
# Common backup files
|
||||||
|
*.swp
|
||||||
|
*.bak
|
||||||
|
*.tmp
|
||||||
|
*.orig
|
||||||
|
*~
|
||||||
|
# Various IDEs
|
||||||
|
.project
|
||||||
|
.idea/
|
||||||
|
*.tmproj
|
||||||
|
.vscode/
|
||||||
5
keycloak-argocd-apps/Chart.yaml
Normal file
5
keycloak-argocd-apps/Chart.yaml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
apiVersion: v2
|
||||||
|
name: keycloak-argocd-apps
|
||||||
|
description: A Helm chart for deploying the different argocd apps to deploy Keycloak
|
||||||
|
type: application
|
||||||
|
version: 0.1.0
|
||||||
62
keycloak-argocd-apps/templates/_helpers.tpl
Normal file
62
keycloak-argocd-apps/templates/_helpers.tpl
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
{{/*
|
||||||
|
Expand the name of the chart.
|
||||||
|
*/}}
|
||||||
|
{{- define "keycloak-argocd-apps.name" -}}
|
||||||
|
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Create a default fully qualified app name.
|
||||||
|
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||||
|
If release name contains chart name it will be used as a full name.
|
||||||
|
*/}}
|
||||||
|
{{- define "keycloak-argocd-apps.fullname" -}}
|
||||||
|
{{- if .Values.fullnameOverride }}
|
||||||
|
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
|
||||||
|
{{- else }}
|
||||||
|
{{- $name := default .Chart.Name .Values.nameOverride }}
|
||||||
|
{{- if contains $name .Release.Name }}
|
||||||
|
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
|
||||||
|
{{- else }}
|
||||||
|
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Create chart name and version as used by the chart label.
|
||||||
|
*/}}
|
||||||
|
{{- define "keycloak-argocd-apps.chart" -}}
|
||||||
|
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Common labels
|
||||||
|
*/}}
|
||||||
|
{{- define "keycloak-argocd-apps.labels" -}}
|
||||||
|
helm.sh/chart: {{ include "keycloak-argocd-apps.chart" . }}
|
||||||
|
{{ include "keycloak-argocd-apps.selectorLabels" . }}
|
||||||
|
{{- if .Chart.AppVersion }}
|
||||||
|
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||||
|
{{- end }}
|
||||||
|
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Selector labels
|
||||||
|
*/}}
|
||||||
|
{{- define "keycloak-argocd-apps.selectorLabels" -}}
|
||||||
|
app.kubernetes.io/name: {{ include "keycloak-argocd-apps.name" . }}
|
||||||
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Create the name of the service account to use
|
||||||
|
*/}}
|
||||||
|
{{- define "keycloak-argocd-apps.serviceAccountName" -}}
|
||||||
|
{{- if .Values.serviceAccount.create }}
|
||||||
|
{{- default (include "keycloak-argocd-apps.fullname" .) .Values.serviceAccount.name }}
|
||||||
|
{{- else }}
|
||||||
|
{{- default "default" .Values.serviceAccount.name }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
31
keycloak-argocd-apps/templates/keycloak-deployment-app.yaml
Normal file
31
keycloak-argocd-apps/templates/keycloak-deployment-app.yaml
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
apiVersion: argoproj.io/v1alpha1
|
||||||
|
kind: Application
|
||||||
|
metadata:
|
||||||
|
name: keycloak-deployment
|
||||||
|
namespace: {{ .Values.argocd.namespace }}
|
||||||
|
annotations:
|
||||||
|
argocd.argoproj.io/sync-wave: "0"
|
||||||
|
notifications.argoproj.io/subscribe.on-sync-succeeded.telegram: "-1002270587578"
|
||||||
|
spec:
|
||||||
|
project: {{ .Values.argocd.project }}
|
||||||
|
source:
|
||||||
|
repoURL: "https://git.blarre.net/thomas/helm-charts.git"
|
||||||
|
targetRevision: HEAD
|
||||||
|
path: keycloak-deployment
|
||||||
|
helm:
|
||||||
|
releaseName: keycloak-deployment
|
||||||
|
valuesObject:
|
||||||
|
keycloakDeployment:
|
||||||
|
numInstances: {{ .Values.keycloakDeployment.numInstances }}
|
||||||
|
hostname: {{ .Values.keycloakDeployment.hostname }}
|
||||||
|
destination:
|
||||||
|
server: {{ .Values.mainDestination }}
|
||||||
|
namespace: {{ .Values.mainNamespace }}
|
||||||
|
syncPolicy:
|
||||||
|
automated:
|
||||||
|
prune: true # Automatically remove resources no longer in the repo
|
||||||
|
selfHeal: true # Automatically self-heal when drift is detected
|
||||||
|
syncOptions:
|
||||||
|
- ApplyOutOfSyncOnly=true
|
||||||
|
- ServerSideApply=true
|
||||||
|
- CreateNamespace=true
|
||||||
30
keycloak-argocd-apps/templates/keycloak-postinstall-app.yaml
Normal file
30
keycloak-argocd-apps/templates/keycloak-postinstall-app.yaml
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
apiVersion: argoproj.io/v1alpha1
|
||||||
|
kind: Application
|
||||||
|
metadata:
|
||||||
|
name: keycloak-postinstall
|
||||||
|
namespace: {{ .Values.argocd.namespace }}
|
||||||
|
annotations:
|
||||||
|
argocd.argoproj.io/sync-wave: "1"
|
||||||
|
notifications.argoproj.io/subscribe.on-sync-succeeded.telegram: "-1002270587578"
|
||||||
|
spec:
|
||||||
|
project: {{ .Values.argocd.project }}
|
||||||
|
source:
|
||||||
|
repoURL: "https://git.blarre.net/thomas/helm-charts.git"
|
||||||
|
targetRevision: HEAD
|
||||||
|
path: keycloak-postinstall
|
||||||
|
helm:
|
||||||
|
releaseName: keycloak-postinstall
|
||||||
|
valuesObject:
|
||||||
|
tailscaleIngresses:
|
||||||
|
keycloakHostname: {{ .Values.tailscaleIngresses.keycloakHostname }}
|
||||||
|
destination:
|
||||||
|
server: {{ .Values.mainDestination }}
|
||||||
|
namespace: {{ .Values.mainNamespace }}
|
||||||
|
syncPolicy:
|
||||||
|
automated:
|
||||||
|
prune: true # Automatically remove resources no longer in the repo
|
||||||
|
selfHeal: true # Automatically self-heal when drift is detected
|
||||||
|
syncOptions:
|
||||||
|
- ApplyOutOfSyncOnly=true
|
||||||
|
- ServerSideApply=true
|
||||||
|
- CreateNamespace=true
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
apiVersion: argoproj.io/v1alpha1
|
||||||
|
kind: Application
|
||||||
|
metadata:
|
||||||
|
name: keycloak-requirements
|
||||||
|
namespace: {{ .Values.argocd.namespace }}
|
||||||
|
annotations:
|
||||||
|
argocd.argoproj.io/sync-wave: "-1"
|
||||||
|
notifications.argoproj.io/subscribe.on-sync-succeeded.telegram: "-1002270587578"
|
||||||
|
spec:
|
||||||
|
project: {{ .Values.argocd.project }}
|
||||||
|
source:
|
||||||
|
repoURL: "https://git.blarre.net/thomas/helm-charts.git"
|
||||||
|
targetRevision: HEAD
|
||||||
|
path: keycloak-requirements
|
||||||
|
helm:
|
||||||
|
releaseName: keycloak-requirements
|
||||||
|
valuesObject:
|
||||||
|
dbCluster:
|
||||||
|
size: {{ .Values.dbCluster.size }}
|
||||||
|
numInstances: {{ .Values.dbCluster.numInstances }}
|
||||||
|
destination:
|
||||||
|
server: {{ .Values.mainDestination }}
|
||||||
|
namespace: {{ .Values.mainNamespace }}
|
||||||
|
syncPolicy:
|
||||||
|
automated:
|
||||||
|
prune: true # Automatically remove resources no longer in the repo
|
||||||
|
selfHeal: true # Automatically self-heal when drift is detected
|
||||||
|
syncOptions:
|
||||||
|
- ApplyOutOfSyncOnly=true
|
||||||
|
- ServerSideApply=true
|
||||||
|
- CreateNamespace=true
|
||||||
9
keycloak-argocd-apps/values.yaml
Normal file
9
keycloak-argocd-apps/values.yaml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
dbCluster:
|
||||||
|
size: 1Gi
|
||||||
|
numInstances: 3
|
||||||
|
mainNamespace: keycloak
|
||||||
|
keycloakDeployment:
|
||||||
|
numInstances: 1
|
||||||
|
hostname: sso.domain.net
|
||||||
|
tailscaleIngresses:
|
||||||
|
keycloakHostname: sso
|
||||||
23
keycloak-deployment/.helmignore
Normal file
23
keycloak-deployment/.helmignore
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
# Patterns to ignore when building packages.
|
||||||
|
# This supports shell glob matching, relative path matching, and
|
||||||
|
# negation (prefixed with !). Only one pattern per line.
|
||||||
|
.DS_Store
|
||||||
|
# Common VCS dirs
|
||||||
|
.git/
|
||||||
|
.gitignore
|
||||||
|
.bzr/
|
||||||
|
.bzrignore
|
||||||
|
.hg/
|
||||||
|
.hgignore
|
||||||
|
.svn/
|
||||||
|
# Common backup files
|
||||||
|
*.swp
|
||||||
|
*.bak
|
||||||
|
*.tmp
|
||||||
|
*.orig
|
||||||
|
*~
|
||||||
|
# Various IDEs
|
||||||
|
.project
|
||||||
|
.idea/
|
||||||
|
*.tmproj
|
||||||
|
.vscode/
|
||||||
5
keycloak-deployment/Chart.yaml
Normal file
5
keycloak-deployment/Chart.yaml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
apiVersion: v2
|
||||||
|
name: keycloak-deployment
|
||||||
|
description: A Helm chart for deploying the actual keycloak pod through the keycloak operator
|
||||||
|
type: application
|
||||||
|
version: 0.1.0
|
||||||
62
keycloak-deployment/templates/_helpers.tpl
Normal file
62
keycloak-deployment/templates/_helpers.tpl
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
{{/*
|
||||||
|
Expand the name of the chart.
|
||||||
|
*/}}
|
||||||
|
{{- define "keycloak-deployment.name" -}}
|
||||||
|
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Create a default fully qualified app name.
|
||||||
|
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||||
|
If release name contains chart name it will be used as a full name.
|
||||||
|
*/}}
|
||||||
|
{{- define "keycloak-deployment.fullname" -}}
|
||||||
|
{{- if .Values.fullnameOverride }}
|
||||||
|
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
|
||||||
|
{{- else }}
|
||||||
|
{{- $name := default .Chart.Name .Values.nameOverride }}
|
||||||
|
{{- if contains $name .Release.Name }}
|
||||||
|
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
|
||||||
|
{{- else }}
|
||||||
|
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Create chart name and version as used by the chart label.
|
||||||
|
*/}}
|
||||||
|
{{- define "keycloak-deployment.chart" -}}
|
||||||
|
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Common labels
|
||||||
|
*/}}
|
||||||
|
{{- define "keycloak-deployment.labels" -}}
|
||||||
|
helm.sh/chart: {{ include "keycloak-deployment.chart" . }}
|
||||||
|
{{ include "keycloak-deployment.selectorLabels" . }}
|
||||||
|
{{- if .Chart.AppVersion }}
|
||||||
|
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||||
|
{{- end }}
|
||||||
|
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Selector labels
|
||||||
|
*/}}
|
||||||
|
{{- define "keycloak-deployment.selectorLabels" -}}
|
||||||
|
app.kubernetes.io/name: {{ include "keycloak-deployment.name" . }}
|
||||||
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Create the name of the service account to use
|
||||||
|
*/}}
|
||||||
|
{{- define "keycloak-deployment.serviceAccountName" -}}
|
||||||
|
{{- if .Values.serviceAccount.create }}
|
||||||
|
{{- default (include "keycloak-deployment.fullname" .) .Values.serviceAccount.name }}
|
||||||
|
{{- else }}
|
||||||
|
{{- default "default" .Values.serviceAccount.name }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
25
keycloak-deployment/templates/keycloak-deployment.yaml
Normal file
25
keycloak-deployment/templates/keycloak-deployment.yaml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
apiVersion: k8s.keycloak.org/v2alpha1
|
||||||
|
kind: Keycloak
|
||||||
|
metadata:
|
||||||
|
name: linode-keycloak
|
||||||
|
spec:
|
||||||
|
instances: {{ .Values.keycloakDeployment.numInstances }}
|
||||||
|
db:
|
||||||
|
vendor: postgres
|
||||||
|
host: keycloak-db-rw
|
||||||
|
usernameSecret:
|
||||||
|
name: keycloak-db-app
|
||||||
|
key: user
|
||||||
|
passwordSecret:
|
||||||
|
name: keycloak-db-app
|
||||||
|
key: password
|
||||||
|
database: app
|
||||||
|
ingress:
|
||||||
|
enabled: false
|
||||||
|
http:
|
||||||
|
httpEnabled: true
|
||||||
|
hostname:
|
||||||
|
hostname: {{ .Values.keycloakDeployment.hostname }}
|
||||||
|
strict: false
|
||||||
|
proxy:
|
||||||
|
headers: xforwarded # double check your reverse proxy sets and overwrites the X-Forwarded-* headers
|
||||||
3
keycloak-deployment/values.yaml
Normal file
3
keycloak-deployment/values.yaml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
keycloakDeployment:
|
||||||
|
numInstances: 1
|
||||||
|
hostname: sso.domain.net
|
||||||
23
keycloak-postinstall/.helmignore
Normal file
23
keycloak-postinstall/.helmignore
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
# Patterns to ignore when building packages.
|
||||||
|
# This supports shell glob matching, relative path matching, and
|
||||||
|
# negation (prefixed with !). Only one pattern per line.
|
||||||
|
.DS_Store
|
||||||
|
# Common VCS dirs
|
||||||
|
.git/
|
||||||
|
.gitignore
|
||||||
|
.bzr/
|
||||||
|
.bzrignore
|
||||||
|
.hg/
|
||||||
|
.hgignore
|
||||||
|
.svn/
|
||||||
|
# Common backup files
|
||||||
|
*.swp
|
||||||
|
*.bak
|
||||||
|
*.tmp
|
||||||
|
*.orig
|
||||||
|
*~
|
||||||
|
# Various IDEs
|
||||||
|
.project
|
||||||
|
.idea/
|
||||||
|
*.tmproj
|
||||||
|
.vscode/
|
||||||
5
keycloak-postinstall/Chart.yaml
Normal file
5
keycloak-postinstall/Chart.yaml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
apiVersion: v2
|
||||||
|
name: keycloak-postinstall
|
||||||
|
description: A Helm chart for after deploying keycloak - mainly ingress
|
||||||
|
type: application
|
||||||
|
version: 0.1.0
|
||||||
62
keycloak-postinstall/templates/_helpers.tpl
Normal file
62
keycloak-postinstall/templates/_helpers.tpl
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
{{/*
|
||||||
|
Expand the name of the chart.
|
||||||
|
*/}}
|
||||||
|
{{- define "keycloak-postinstall.name" -}}
|
||||||
|
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Create a default fully qualified app name.
|
||||||
|
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||||
|
If release name contains chart name it will be used as a full name.
|
||||||
|
*/}}
|
||||||
|
{{- define "keycloak-postinstall.fullname" -}}
|
||||||
|
{{- if .Values.fullnameOverride }}
|
||||||
|
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
|
||||||
|
{{- else }}
|
||||||
|
{{- $name := default .Chart.Name .Values.nameOverride }}
|
||||||
|
{{- if contains $name .Release.Name }}
|
||||||
|
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
|
||||||
|
{{- else }}
|
||||||
|
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Create chart name and version as used by the chart label.
|
||||||
|
*/}}
|
||||||
|
{{- define "keycloak-postinstall.chart" -}}
|
||||||
|
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Common labels
|
||||||
|
*/}}
|
||||||
|
{{- define "keycloak-postinstall.labels" -}}
|
||||||
|
helm.sh/chart: {{ include "keycloak-postinstall.chart" . }}
|
||||||
|
{{ include "keycloak-postinstall.selectorLabels" . }}
|
||||||
|
{{- if .Chart.AppVersion }}
|
||||||
|
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||||
|
{{- end }}
|
||||||
|
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Selector labels
|
||||||
|
*/}}
|
||||||
|
{{- define "keycloak-postinstall.selectorLabels" -}}
|
||||||
|
app.kubernetes.io/name: {{ include "keycloak-postinstall.name" . }}
|
||||||
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Create the name of the service account to use
|
||||||
|
*/}}
|
||||||
|
{{- define "keycloak-postinstall.serviceAccountName" -}}
|
||||||
|
{{- if .Values.serviceAccount.create }}
|
||||||
|
{{- default (include "keycloak-postinstall.fullname" .) .Values.serviceAccount.name }}
|
||||||
|
{{- else }}
|
||||||
|
{{- default "default" .Values.serviceAccount.name }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
16
keycloak-postinstall/templates/ts-ingress.yaml
Normal file
16
keycloak-postinstall/templates/ts-ingress.yaml
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: ts-keycloak
|
||||||
|
annotations:
|
||||||
|
tailscale.com/funnel: "true"
|
||||||
|
spec:
|
||||||
|
defaultBackend:
|
||||||
|
service:
|
||||||
|
name: linode-keycloak-service
|
||||||
|
port:
|
||||||
|
number: 8080
|
||||||
|
ingressClassName: tailscale
|
||||||
|
tls:
|
||||||
|
- hosts:
|
||||||
|
- {{ .Values.tailscaleIngresses.keycloakHostname }}
|
||||||
2
keycloak-postinstall/values.yaml
Normal file
2
keycloak-postinstall/values.yaml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
tailscaleIngresses:
|
||||||
|
keycloakHostname: sso
|
||||||
Reference in New Issue
Block a user