streams-manifests/keycloak/readme.md

57 lines
1.1 KiB
Markdown
Raw Permalink Normal View History

2025-01-30 12:09:52 +01:00
# Kubernetes Commands for Keycloak Setup
2025-01-30 12:03:55 +01:00
2025-01-30 12:09:52 +01:00
## **Namespace Creation**
2025-01-30 12:03:55 +01:00
2025-01-30 12:09:52 +01:00
Create a namespace for **Keycloak**:
2025-01-30 12:03:55 +01:00
```bash
2025-01-30 12:09:52 +01:00
kubectl create ns keycloak
2025-01-30 12:03:55 +01:00
```
2025-01-30 12:09:52 +01:00
## **Apply Configuration Files**
2025-01-30 12:03:55 +01:00
2025-01-30 12:09:52 +01:00
Deploy persistent storage, deployment, services, and secrets for Keycloak:
2025-01-30 12:03:55 +01:00
```bash
2025-01-30 12:09:52 +01:00
kubectl -n keycloak apply -f keycloak-pvc.yaml
kubectl -n keycloak apply -f keycloak-admin-secret.yaml
kubectl -n keycloak apply -f keycloak-deployment.yaml
kubectl -n keycloak apply -f keycloak-service.yaml
kubectl -n keycloak apply -f keycloak-ingress.yaml
2025-01-30 12:03:55 +01:00
```
2025-01-30 12:09:52 +01:00
## **Persistent Volume Claims (PVC)**
2025-01-30 12:03:55 +01:00
2025-01-30 12:09:52 +01:00
Check the status of PVCs in the Keycloak namespace:
2025-01-30 12:03:55 +01:00
```bash
2025-01-30 12:09:52 +01:00
kubectl get pvc -n keycloak
2025-01-30 12:03:55 +01:00
```
2025-01-30 12:09:52 +01:00
## **Port Forwarding**
2025-01-30 12:03:55 +01:00
2025-01-30 12:09:52 +01:00
Forward the Keycloak service to a local port for easy access:
2025-01-30 12:03:55 +01:00
```bash
2025-01-30 12:09:52 +01:00
kubectl -n keycloak port-forward svc/keycloak 8080:8080
2025-01-30 12:03:55 +01:00
```
## **Logs & Debugging**
2025-01-30 12:03:55 +01:00
2025-01-30 12:09:52 +01:00
Check logs or describe the Keycloak pod:
2025-01-30 12:03:55 +01:00
```bash
2025-01-30 12:09:52 +01:00
kubectl -n keycloak logs <pod-name>
kubectl -n keycloak describe <pod-name>
2025-01-30 12:03:55 +01:00
```
2025-01-30 12:09:52 +01:00
## **Apply Argo Application**
2025-01-30 12:03:55 +01:00
2025-01-30 12:09:52 +01:00
### **Deploy Argo Application**
2025-01-30 12:03:55 +01:00
2025-01-30 12:09:52 +01:00
Apply the ArgoCD application configuration for Keycloak:
2025-01-30 12:03:55 +01:00
```bash
2025-01-30 12:09:52 +01:00
kubectl -n argocd apply -f keycloak-application.yaml
2025-01-30 12:03:55 +01:00
```