Get breakglass running in 5 minutes.
- Kubernetes 1.24+ (hub cluster to run breakglass)
- kubectl configured to access hub cluster
- OIDC provider (Keycloak, Azure AD, etc.) for authentication
- Network access from tenant clusters to hub cluster
Copy the example config:
cp config.example.yaml config.yamlEdit config.yaml with your settings:
server:
listenAddress: :8080
frontend:
baseURL: https://breakglass.example.com
brandingName: "My Breakglass" # optional
kubernetes:
context: ""
oidcPrefixes:
- "oidc:"Notes:
- OIDC/IDP configuration is managed via IdentityProvider CRDs (see step 2)
- Email configuration is managed via MailProvider CRDs (see step 3)
This is REQUIRED - Breakglass will not start without it.
Create identity-provider.yaml:
apiVersion: breakglass.t-caas.telekom.com/v1alpha1
kind: IdentityProvider
metadata:
name: production-idp
spec:
primary: true
oidc:
authority: "https://keycloak.example.com/realms/master"
clientID: "breakglass-ui"Deploy to hub cluster:
kubectl apply -f identity-provider.yaml -n breakglass-systemVerify:
kubectl get identityprovidersThis is REQUIRED for email notifications.
Create mail-provider.yaml:
apiVersion: breakglass.t-caas.telekom.com/v1alpha1
kind: MailProvider
metadata:
name: production-smtp
spec:
displayName: "Production SMTP"
default: true
smtp:
host: smtp.example.com
port: 587
username: [email protected]
passwordRef:
name: smtp-credentials
namespace: breakglass-system
key: password
sender:
address: [email protected]
name: "Breakglass System"Create SMTP secret and deploy:
kubectl create secret generic smtp-credentials \
-n breakglass-system \
--from-literal=password=<smtp-password>
kubectl apply -f mail-provider.yamlVerify:
kubectl get mailprovidersUpdate deployment configuration:
# Edit to use your config
sed -i 's/your-config/config.yaml/' config/default/config.yamlDeploy:
make deployVerify deployment:
kubectl get pods -n breakglass-system
kubectl get crd | grep breakglassCreate a file escalation-policy.yaml:
apiVersion: breakglass.t-caas.telekom.com/v1alpha1
kind: BreakglassEscalation
metadata:
name: sre-production-access
spec:
escalatedGroup: "cluster-admin"
allowed:
clusters: ["prod-cluster"]
groups: ["site-reliability-engineers"]
approvers:
groups: ["security-team"]
maxValidFor: "2h"
idleTimeout: "1h"Deploy:
kubectl apply -f escalation-policy.yamlOn the tenant cluster that needs breakglass authorization:
Create webhook kubeconfig:
apiVersion: v1
kind: Config
clusters:
- name: breakglass
cluster:
server: https://breakglass.example.com/api/breakglass/webhook/authorize/prod-cluster
certificate-authority-data: <BASE64_CA_CERT>
users:
- name: kube-apiserver
user:
token: <SECURE_TOKEN>
contexts:
- name: webhook
context:
cluster: breakglass
user: kube-apiserver
current-context: webhookUpdate API server authorization config (/etc/kubernetes/authorization-config.yaml):
apiVersion: apiserver.config.k8s.io/v1beta1
kind: AuthorizationConfiguration
authorizers:
- type: Node
name: node
- type: RBAC
name: rbac
- type: Webhook
name: breakglass
webhook:
timeout: 3s
authorizedTTL: 30s
unauthorizedTTL: 30s
subjectAccessReviewVersion: v1
failurePolicy: Deny
connectionInfo:
type: KubeConfigFile
kubeConfigFile: /etc/kubernetes/breakglass-webhook-kubeconfig.yaml
matchConditions:
- expression: "'system:authenticated' in request.groups"
- expression: "!request.user.startsWith('system:')"Restart kube-apiserver:
# For kubeadm clusters
ssh node systemctl restart kubeletCreate a secret with tenant cluster admin kubeconfig on hub:
kubectl create secret generic prod-cluster-admin \
--from-file=kubeconfig=/path/to/tenant/kubeconfig.yaml \
-n defaultCreate ClusterConfig resource:
apiVersion: breakglass.t-caas.telekom.com/v1alpha1
kind: ClusterConfig
metadata:
name: prod-cluster
spec:
clusterID: prod-cluster
environment: prod
kubeconfigSecretRef:
name: prod-cluster-admin
namespace: default
key: kubeconfig
qps: 100
burst: 200Deploy:
kubectl apply -f clusterconfig.yamlVerify connection:
kubectl get clusterconfig prod-cluster
kubectl describe clusterconfig prod-cluster# Get your token
TOKEN=$(oidc-token)
# Request access
curl -X POST https://breakglass.example.com/api/breakglass/request \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"cluster": "prod-cluster",
"user": "[email protected]",
"group": "cluster-admin"
}'As an approver:
curl -X POST https://breakglass.example.com/api/breakglass/approve/[email protected] \
-H "Authorization: Bearer $APPROVER_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"cluster": "prod-cluster",
"group": "cluster-admin"
}'# Now your kubectl requests will be authorized by breakglass
kubectl get pods --all-namespacesOpen browser to: https://breakglass.example.com
- Login with your OIDC credentials
- View available escalations
- Request access
- Approvers can approve/deny requests
- Learn about escalation policies
- Configure deny policies
- Set up webhook properly
- Review troubleshooting
- Create admin secret for each cluster
- Create
ClusterConfigfor each cluster - Configure webhook on each cluster
- Update
BreakglassEscalationto include new clusters
Email notifications are configured via MailProvider CRDs:
apiVersion: breakglass.t-caas.telekom.com/v1alpha1
kind: MailProvider
metadata:
name: production-smtp
spec:
displayName: "Production SMTP"
default: true
smtp:
host: smtp.example.com
port: 587
username: [email protected]
passwordRef:
name: smtp-credentials
namespace: breakglass-system
key: password
sender:
address: [email protected]
name: "Breakglass System"Create the credentials secret:
kubectl create secret generic smtp-credentials \
-n breakglass-system \
--from-literal=password=<secure-password>Approvers receive email notifications for new requests. See Mail Provider documentation for more configuration options.
Generate certificates and update config:
server:
tlsCertFile: /etc/breakglass/tls.crt
tlsKeyFile: /etc/breakglass/tls.keyRestrict certain users from accessing sensitive resources:
apiVersion: breakglass.t-caas.telekom.com/v1alpha1
kind: DenyPolicy
metadata:
name: protect-kube-system
spec:
rules:
- verbs: ["*"]
apiGroups: ["*"]
resources: ["*"]
namespaces:
patterns: ["kube-system"]
precedence: 10See Troubleshooting Guide for common issues and solutions.
Quick checks:
# Check all resources created
kubectl get breakglassescalation,breakglasssession,clusterconfig,denypolicy
# Check controller health
kubectl get deployment -n breakglass-system
kubectl logs -n breakglass-system deployment/breakglass-controller
# Verify webhook configuration
kubectl get clusterconfig
kubectl describe clusterconfig prod-cluster- Always use TLS for webhook communication
- Rotate authentication tokens regularly
- Use strong OIDC provider configurations
- Review escalation policies periodically
- Monitor all access attempts in logs
- Check Troubleshooting Guide
- Review API Reference
- See Webhook Setup for detailed webhook configuration