Try with Helm
This page describes how to deploy Casdoor on Kubernetes using Helm.
Voraussetzungen
- A running Kubernetes cluster (1.19+)
- Helm v3.8+
Installation
Step 1: Install the Casdoor chart
Install the Casdoor Helm chart:
helm install casdoor oci://registry-1.docker.io/casbin/casdoor-helm-charts --version <version>
To install with a custom values file:
helm install casdoor oci://registry-1.docker.io/casbin/casdoor-helm-charts \
--version <version> \
-f my-values.yaml
Step 2: Access Casdoor
After installation, use the service URL provided by your cluster to access Casdoor.
Customization
Override values.yaml to customize the deployment. Key parameters:
| Parameter | Beschreibung | Standardwert |
|---|---|---|
replicaCount | Anzahl der Replikate der Casdoor-Anwendung, die ausgeführt werden sollen. | 1 |
image.repository | Repository für das Casdoor-Docker-Image. | casbin |
image.name | Name des Casdoor-Docker-Images. | casdoor |
image.pullPolicy | Pull-Richtlinie für das Casdoor-Docker-Image. | IfNotPresent |
image.tag | Tag für das Casdoor-Docker-Image. | "" |
config | Konfigurationseinstellungen für die Casdoor-Anwendung. | See values.yaml |
database.driver | Database driver to use (mysql, postgres, cockroachdb, sqlite). | sqlite |
database.user | Datenbankbenutzername. | "" |
database.password | Datenbankpasswort. | "" |
database.host | Datenbankhost. | "" |
database.port | Datenbankport. | "" |
database.databaseName | Name der von Casdoor verwendeten Datenbank. | casdoor |
database.sslMode | SSL-Modus für die Datenbankverbindung. | disable |
service.type | Type of Kubernetes service (ClusterIP, NodePort, LoadBalancer). | ClusterIP |
service.port | Portnummer für den Casdoor-Dienst. | 8000 |
ingress.enabled | Ob Ingress für Casdoor aktiviert werden soll. | false |
ingress.annotations | Annotationen für die Ingress-Ressource. | {} |
ingress.hosts | Hostnamen für die Ingress-Ressource. | [] |
resources | Ressourcenanforderungen und -grenzen für den Casdoor-Container. | {} |
autoscaling.enabled | Ob Horizontal Pod Autoscaler für Casdoor aktiviert werden soll. | false |
autoscaling.minReplicas | Minimum number of replicas for HPA. | 1 |
autoscaling.maxReplicas | Maximum number of replicas for HPA. | 100 |
autoscaling.targetCPUUtilizationPercentage | Target CPU utilization percentage for HPA. | 80 |
nodeSelector | Knotenlabels für die Pod-Zuweisung. | {} |
tolerations | Toleranzlabels für die Pod-Zuweisung. | [] |
affinity | Affinitätseinstellungen für die Pod-Zuweisung. | {} |
extraContainersEnabled | Ob zusätzliche Sidecar-Container aktiviert werden sollen. | false |
extraContainers | Zusätzliche Sidecar-Container. | "" |
extraVolumeMounts | Zusätzliche Volume-Mounts für den Casdoor-Container. | [] |
extraVolumes | Zusätzliche Volumes für den Casdoor-Container. | [] |
envFromSecret | Environment variables from individual Secret keys. | [] |
envFromConfigmap | Environment variables from individual ConfigMap keys. | [] |
envFrom | Environment variables from entire Secrets or ConfigMaps. | [] |
Exposing Casdoor
Option 1: Ingress (classic)
Enable and configure Ingress:
ingress:
enabled: true
className: nginx
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
hosts:
- host: casdoor.example.com
paths:
- path: /
pathType: Prefix
tls:
- secretName: casdoor-tls
hosts:
- casdoor.example.com
Option 2: Gateway API (modern)
The Kubernetes Gateway API is the next-generation successor to Ingress, officially GA since Kubernetes 1.31. It is supported by Istio, Envoy Gateway, Cilium, Kong, NGINX Gateway Fabric, and others.
Tipp
Prerequisites
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.2.0/standard-install.yaml
You also need a compatible Gateway controller running in your cluster.
Attach to an existing Gateway
If you already have a Gateway resource in your cluster, point the HTTPRoute at it:
gatewayApi:
enabled: true
parentRefs:
- name: my-gateway
namespace: gateway-system
sectionName: https
hostnames:
- casdoor.example.com
Create a new Gateway (e.g. with Istio)
Let the chart create a Gateway and HTTPRoute together:
gatewayApi:
enabled: true
createGateway: true
hostnames:
- casdoor.example.com
gateway:
gatewayClassName: istio
listeners:
- name: http
protocol: HTTP
port: 80
allowedRoutes:
namespaces:
from: Same