README.md 1.39 KB
Newer Older
Hugo's avatar
Hugo committed
1
2
3
4
5
6
7
8
9
10
11
12
13
# Keycloak on k8s

## Usage

### Quick start

```bash
$ kubectl apply -k https://git.indie.host/indiehost/tech/infrastructure/keycloak-kustomize.git
```

### Kustomization

```yaml
Hugo's avatar
Hugo committed
14
# kustomization.yaml
Hugo's avatar
Hugo committed
15
16
17
18
19
20
21
22
23
24
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
commonLabels:
  app.kubernetes.io/instance: id-liiib-re
images:
  - name: libresh/keycloak
    newTag: v15
resources:
  - https://git.indie.host/indiehost/tech/infrastructure/keycloak-kustomize.git
```
Hugo's avatar
Hugo committed
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49

### Kustomization with cconfig

```conf
# keycloak.config
KEYCLOAK_USER=admin
KEYCLOAK_PASSWORD=xxx
```

```yaml
# kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
commonLabels:
  app.kubernetes.io/instance: id-liiib-re
images:
  - name: libresh/keycloak
    newTag: v15
resources:
  - https://git.indie.host/indiehost/tech/infrastructure/keycloak-kustomize.git
secretGenerator:
  - name: keycloak-config
    envs:
      - keycloak.config
```
Hugo's avatar
Hugo committed
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75

### Ingress

```yaml
# ingress.yaml
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: keycloak
  annotations:
    kubernetes.io/tls-acme: "true"
    nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
spec:
  rules:
    - host: id.liiib.re
      http:
        paths:
          - backend:
              serviceName: keycloak
              servicePort: https
            path: /
  tls:
    - hosts:
        - id.liiib.re
      secretName: id-liiib-re-tls
```