Helm/Keycloak: Difference between revisions
Jump to navigation
Jump to search
(Created page with " helm pull oci://registry-1.docker.io/bitnamicharts/keycloak --version 22.0.0 --untar helm pull oci://registry-1.docker.io/bitnamicharts/keycloak --version 19.3.3 --untar helm pull oci://registry-1.docker.io/bitnamicharts/keycloak --untar helm pull oci://registry-1.docker.io/bitnamicharts/keycloak --version 22.0.0 helm pull oci://registry-1.docker.io/bitnamicharts/keycloak --version 19.3.3 helm pull oci://registry-1.docker.io/bitnamicharts/keycloak ==Config== <s...") |
No edit summary |
||
(16 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
helm | helm repo add bitnami https://charts.bitnami.com/bitnami | ||
helm repo update && helm repo list | |||
kubectl config get-contexts | |||
helm | |||
==Config== | ==Config== | ||
Line 16: | Line 12: | ||
==Install== | ==Install== | ||
{| | {| | ||
|colspan="2"| | |||
<syntaxhighlight lang="sql"> | |||
cat << DDL | psql -U ${USER} | |||
CREATE DATABASE keycloak; | |||
CREATE USER keycloak WITH ENCRYPTED PASSWORD 'sadaqah!'; | |||
GRANT ALL PRIVILEGES ON DATABASE keycloak TO keycloak; | |||
DDL | |||
</syntaxhighlight> | |||
|- | |||
|colspan="2"| | |||
---- | |||
|- | |||
|colspan="2"| | |colspan="2"| | ||
<syntaxhighlight lang="yaml"> | <syntaxhighlight lang="yaml"> | ||
kubectl create namespace keycloak | kubectl create namespace keycloak | ||
cat <<YML | helm -n keycloak install keycloak bitnami/keycloak --version 19.3.3 -f - | |||
cat <<YML | helm | |||
tls: | tls: | ||
enabled: false | enabled: false | ||
Line 69: | Line 77: | ||
| colspan="2" | | | colspan="2" | | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
helm | helm -n keycloak install keycloak bitnami/keycloak --version 19.3.3 | ||
helm | helm -n keycloak upgrade -i keycloak bitnami/keycloak --version 22.0.0 | ||
helm show values | helm show values bitnami/keycloak --version 19.3.3|less | ||
</syntaxhighlight> | |||
|- | |||
| colspan="2" | | |||
---- | |||
|- | |||
| colspan="2" | | |||
<syntaxhighlight lang="bash"> | |||
kubectl -n keycloak exec -it svc/keycloak -c keycloak -- /opt/bitnami/keycloak/bin/kc.sh --version | |||
kubectl -n keycloak exec -it svc/keycloak -c keycloak -- cat /opt/bitnami/keycloak/version.txt | |||
</syntaxhighlight> | |||
|- | |||
| colspan="2" | | |||
---- | |||
|- | |||
| colspan="2" | | |||
<syntaxhighlight lang="bash"> | |||
ADMIN_PASS=$(kubectl -n keycloak get secret keycloak -o json|jq -r '.data."admin-password"'|base64 -d) | |||
ADMIN_PASS=$(kubectl -n keycloak get secret keycloak -o jsonpath="{.data.admin-password}"|base64 -d) | |||
kubectl -n keycloak exec -it svc/keycloak-postgresql -c postgresql -- psql -Ukeycloak | |||
kubectl -n keycloak exec -it svc/keycloak-postgresql -c postgresql -- bash | |||
kubectl -n keycloak exec -it svc/keycloak -c keycloak -- ls -lah /var | |||
kubectl -n keycloak exec -it svc/keycloak -c keycloak -- bash | |||
kubectl -n keycloak exec -it keycloak-postgresql-0 -- bash | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 80: | Line 114: | ||
| colspan="2" | | | colspan="2" | | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
kubectl | kubectl config --kubeconfig=${HOME}/.kube/aws-kubeconfig.yaml view --flatten | ||
kubectl | kubectl config --kubeconfig=${HOME}/.kube/dev-kubeconfig.yaml view --flatten | ||
kubectl | kubectl config --kubeconfig=${HOME}/.kube/gcp-kubeconfig.yaml view --flatten | ||
kubectl config --kubeconfig=${HOME}/.kube/config view --flatten | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 91: | Line 126: | ||
| valign="top" | | | valign="top" | | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
kubectl delete all --all -n keycloak | kubectl -n keycloak delete all --all | ||
kubectl -n keycloak delete ing --all | |||
kubectl -n keycloak delete sts --all | |||
</syntaxhighlight> | </syntaxhighlight> | ||
| valign="top" | | | valign="top" | | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
kubectl delete svc --all -n keycloak | kubectl -n keycloak delete svc --all | ||
kubectl -n keycloak delete pvc --all | |||
kubectl -n keycloak delete pv --all | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 109: | Line 144: | ||
| valign="top" | | | valign="top" | | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
kubectl | kubectl -n keycloak rollout history sts keycloak | ||
kubectl | kubectl -n keycloak rollout restart sts keycloak | ||
kubectl -n keycloak rollout status sts keycloak | |||
kubectl | |||
</syntaxhighlight> | </syntaxhighlight> | ||
| valign="top" | | | valign="top" | | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
kubectl | kubectl -n keycloak exec -it keycloak-postgresql-0 -- psql -Ukeycloak | ||
kubectl -n keycloak logs -f keycloak-postgresql-0 | |||
kubectl | kubectl -n keycloak logs -f keycloak-0 | ||
kubectl | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 130: | Line 162: | ||
| valign="top" | | | valign="top" | | ||
* [https://stackoverflow.com/questions/75596795/ Helm » Pass YAML/JSON using <code>stdin</code>] | * [https://stackoverflow.com/questions/75596795/ Helm » Pass YAML/JSON using <code>stdin</code>] | ||
* [[Helm/Prometheus Stack|Helm » Prometheus Stack]] | |||
* [[Helm/Cert Manager|Helm » Cert Manager]] | |||
* [https://artifacthub.io/packages/helm/bitnami/keycloak Helm » Keycloak] | * [https://artifacthub.io/packages/helm/bitnami/keycloak Helm » Keycloak] | ||
* [[Helm]] | * [[Helm]] | ||
Line 142: | Line 176: | ||
|- | |- | ||
| valign="top" | | | valign="top" | | ||
* [https://skycloak.io/upgrade-keycloak-from-8-to-24-a-complete-guide/ Keycloak » Upgrade From 8 To 24] | |||
* [https://github.com/kubernetes/ingress-nginx/blob/main/docs/user-guide/nginx-configuration/annotations.md Keycloak » Ingress » Annotations] | |||
* [https://stackoverflow.com/questions/51744536/ Keycloak » Ingress » CORS Rules] | |||
* [https://www.keycloak.org/docs/latest/upgrading/ Keycloak » Upgrading Guide] | |||
* [https://www.keycloak.org/getting-started/getting-started-kube Keycloak » Getting started] | * [https://www.keycloak.org/getting-started/getting-started-kube Keycloak » Getting started] | ||
* [[Keycloak]] | * [[Keycloak]] | ||
Line 166: | Line 204: | ||
| valign="top" | | | valign="top" | | ||
* [https://kubernetes.io/docs/reference/kubectl/generated/kubectl_rollout/ K8s » <code>kubectl rollout</code>] | |||
* [[K8s/CSI Hostpath Driver|K8s » CSI Hostpath Driver]] | |||
* [https://kubernetes.io/docs/concepts/configuration/secret/ K8s » Config » Secrets] | |||
| valign="top" | | | valign="top" | | ||
|} | |} |
Latest revision as of 12:24, 22 August 2024
helm repo add bitnami https://charts.bitnami.com/bitnami helm repo update && helm repo list kubectl config get-contexts
Config
export KUBECONFIG="${HOME}/.kube/dev-kubeconfig.yaml"
export KUBECONFIG="${HOME}/.kube/gcp-kubeconfig.yaml"
export KUBECONFIG="${HOME}/.kube/config"
Install
cat << DDL | psql -U ${USER}
CREATE DATABASE keycloak;
CREATE USER keycloak WITH ENCRYPTED PASSWORD 'sadaqah!';
GRANT ALL PRIVILEGES ON DATABASE keycloak TO keycloak;
DDL
| |
| |
kubectl create namespace keycloak
cat <<YML | helm -n keycloak install keycloak bitnami/keycloak --version 19.3.3 -f -
tls:
enabled: false
auth:
adminUser: admin
adminPassword: "sadaqah!"
ingress:
enabled: true
hostname: keycloak.k8s.local
ingressClassName: nginx
postgresql:
enabled: true
auth:
username: keycloak
password: "sadaqah!"
database: keycloak
postgresPassword: "sadaqah!"
architecture: standalone
YML
| |
| |
xdg-open http://keycloak.k8s.local &>/dev/null &
gnome-open http://keycloak.k8s.local &>/dev/null &
|
x-www-browser http://keycloak.k8s.local &>/dev/null &
sensible-browser http://keycloak.k8s.local &>/dev/null &
|
Uninstall
helm uninstall -n keycloak keycloak
kubectl delete namespace keycloak
Playground
helm -n keycloak install keycloak bitnami/keycloak --version 19.3.3
helm -n keycloak upgrade -i keycloak bitnami/keycloak --version 22.0.0
helm show values bitnami/keycloak --version 19.3.3|less
| |
| |
kubectl -n keycloak exec -it svc/keycloak -c keycloak -- /opt/bitnami/keycloak/bin/kc.sh --version
kubectl -n keycloak exec -it svc/keycloak -c keycloak -- cat /opt/bitnami/keycloak/version.txt
| |
| |
ADMIN_PASS=$(kubectl -n keycloak get secret keycloak -o json|jq -r '.data."admin-password"'|base64 -d)
ADMIN_PASS=$(kubectl -n keycloak get secret keycloak -o jsonpath="{.data.admin-password}"|base64 -d)
kubectl -n keycloak exec -it svc/keycloak-postgresql -c postgresql -- psql -Ukeycloak
kubectl -n keycloak exec -it svc/keycloak-postgresql -c postgresql -- bash
kubectl -n keycloak exec -it svc/keycloak -c keycloak -- ls -lah /var
kubectl -n keycloak exec -it svc/keycloak -c keycloak -- bash
kubectl -n keycloak exec -it keycloak-postgresql-0 -- bash
| |
| |
kubectl config --kubeconfig=${HOME}/.kube/aws-kubeconfig.yaml view --flatten
kubectl config --kubeconfig=${HOME}/.kube/dev-kubeconfig.yaml view --flatten
kubectl config --kubeconfig=${HOME}/.kube/gcp-kubeconfig.yaml view --flatten
kubectl config --kubeconfig=${HOME}/.kube/config view --flatten
| |
| |
kubectl -n keycloak delete all --all
kubectl -n keycloak delete ing --all
kubectl -n keycloak delete sts --all
|
kubectl -n keycloak delete svc --all
kubectl -n keycloak delete pvc --all
kubectl -n keycloak delete pv --all
|
| |
kubectl -n keycloak rollout history sts keycloak
kubectl -n keycloak rollout restart sts keycloak
kubectl -n keycloak rollout status sts keycloak
|
kubectl -n keycloak exec -it keycloak-postgresql-0 -- psql -Ukeycloak
kubectl -n keycloak logs -f keycloak-postgresql-0
kubectl -n keycloak logs -f keycloak-0
|
References
| ||
| ||