Skip to content

Commit fc12431

Browse files
author
Wachter, Julian
committed
docs
1 parent 1bcc354 commit fc12431

File tree

2 files changed

+30
-17
lines changed

2 files changed

+30
-17
lines changed

README.md

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Provider keycloak
22
`provider-keycloak` is an open-source [Crossplane](https://crossplane.io/) provider declaratively configuring [Keycloak](https://github.com/keycloak/keycloak).
3-
This provider is generated by using [Upjet](https://github.com/crossplane/upjet) building on the existing [Keycloak Terraform Provider](https://github.com/keycloak/terraform-provider-keycloak).
3+
This provider is generated by using [Upjet](https://github.com/crossplane/upjet) building on the existing [Keycloak Terraform Provider](https://github.com/keycloak/terraform-provider-keycloak).
44
It is installed into a Crossplane control plane and adds the following new functionality:
55

66
* Custom Resource Definitions (CRDs) that model Keycloak configurations (e.g. realms, clients, roles, protocol mappers, etc.). You can see the full list of managed resources at the [marketplace](https://marketplace.upbound.io/providers/crossplane-contrib/provider-keycloak).
7-
* Controller to provision these resources in Keycloak based on the users desired state captured in CRDs they create. Reconciling them when the actual state and the desired states are drifting apart.
7+
* Controller to provision these resources in Keycloak based on the users desired state captured in CRDs they create. Reconciling them when the actual state and the desired states are drifting apart.
88

99
Check out the examples in the `examples` directory for more information on how to use this provider.
1010

11-
## Usage
11+
## Usage
1212

1313
### Installation
1414

@@ -23,7 +23,7 @@ metadata:
2323
namespace: crossplane-system
2424
spec:
2525
package: xpkg.upbound.io/crossplane-contrib/provider-keycloak:<latest>
26-
```
26+
```
2727
2828
This will install the provider in the `crossplane-system` namespace and install CRDs and controllers for the provider.
2929
Check https://marketplace.upbound.io/providers/crossplane-contrib/provider-keycloak for the lastet version
@@ -33,7 +33,7 @@ Check https://marketplace.upbound.io/providers/crossplane-contrib/provider-keycl
3333
We also support DeploymentRuntimeConfig to enable additional features in the provider.
3434

3535
```yaml
36-
---
36+
---
3737
apiVersion: pkg.crossplane.io/v1beta1
3838
kind: DeploymentRuntimeConfig
3939
metadata:
@@ -70,7 +70,7 @@ spec:
7070

7171

7272

73-
### Configuration
73+
### Configuration
7474

7575
- For each keycloak instance you need one or more `ProviderConfig` resources.
7676
- The `ProviderConfig` resource is used to store the keycloak API server URL, credentials, and other configuration details that are required to connect to the keycloak API server.
@@ -95,7 +95,7 @@ kind: Secret
9595
metadata:
9696
name: keycloak-credentials
9797
namespace: crossplane-system
98-
labels:
98+
labels:
9999
type: provider-credentials
100100
type: Opaque
101101
stringData:
@@ -112,6 +112,15 @@ stringData:
112112

113113
The secret `keycloak-credentials` contains the keycloak API server URL, credentials, and other configuration details that are required to connect to the keycloak API server. **It supports the same fields as the [terraform provider configuration](https://registry.terraform.io/providers/mrparkers/keycloak/latest/docs#argument-reference)**
114114

115+
`url`, optional `admin_url`, and optional `base_path` are validated and normalized by this provider before configuring the Terraform provider:
116+
117+
- `url` and `admin_url` must be absolute URLs with scheme and host (for example `https://keycloak.example.com`).
118+
- `url` and `admin_url` should not include query parameters or fragments.
119+
- Trailing `/` in `url` and `admin_url` is removed automatically.
120+
- `base_path` must be empty or start with `/` (for example `/auth`).
121+
- `base_path: "/"` is normalized to empty string to avoid double-slash request paths.
122+
- Trailing `/` in non-root `base_path` is removed automatically.
123+
115124
As an alternative to using the embedded JSON format shown above, you can also place settings in a plain Kubernetes secret like this:
116125

117126
```yaml
@@ -135,14 +144,14 @@ stringData:
135144

136145
### Custom Resource Definitions
137146

138-
You can explore the available custom resources:
147+
You can explore the available custom resources:
139148
- [Upbound marketplace site](https://marketplace.upbound.io/providers/crossplane-contrib/provider-keycloak/)
140149
- `kubectl get crd | grep keycloak.crossplane.io` to list all the CRDs provided by the provider
141150
- `kubectl explain <CRD_NAME>` for docs on the CLI
142151
- You can also see the CRDs in the `package/crds` directory
143152

144153

145-
### Functions and Compositions:
154+
### Functions and Compositions:
146155

147156
- [function-keycloak-builtin-objects](https://gitlab.com/corewire/images/crossplane/function-keycloak-builtin-objects) - The function is used to import the builtin objects of a keycloak, e.g. clients and roles. Since v3.0 it also offers the possibility to adapt some default config. Everything you need to know is in the README of the repository.
148157

@@ -196,8 +205,8 @@ TERRAFORM_PROVIDER_REPO=https://github.com/<owner>/terraform-provider-keycloak \
196205
TERRAFORM_PROVIDER_VERSION=1.0.0 \
197206
make generate
198207
```
199-
**Hint:** `TERRAFORM_PROVIDER_VERSION` must be a Release. Releases can be found here: `https://github.com/<owner>/terraform-provider-keycloak/releases`.
200-
Every ReleaseName should have the prefix "v" (i.e 'v1.0.0'). But if you specify the `TERRAFORM_PROVIDER_VERSION` you need to
208+
**Hint:** `TERRAFORM_PROVIDER_VERSION` must be a Release. Releases can be found here: `https://github.com/<owner>/terraform-provider-keycloak/releases`.
209+
Every ReleaseName should have the prefix "v" (i.e 'v1.0.0'). But if you specify the `TERRAFORM_PROVIDER_VERSION` you need to
201210
skip that prefix (i.e. '1.0.0')
202211

203212
2. Use forked repo as go dependency:
@@ -241,7 +250,7 @@ XPKG_REG_ORGS_NO_PROMOTE=xpkg.upbound.io/<owner> \
241250
make publish
242251
```
243252

244-
### Local Environment
253+
### Local Environment
245254
Execute setup script which creates a KIND Cluster
246255
and installs crossplane, keycloak and the official crossplane provider
247256
via ArgoCD (for more options run script with `--help`)
@@ -361,7 +370,7 @@ This is used for marking an MR as test for automated tests. [Upjet based control
361370

362371
2 - restart provider (scale down, scale up)
363372

364-
3 - Clear `status.conditions` of all resources under test with
373+
3 - Clear `status.conditions` of all resources under test with
365374

366375
4 - Set `uptest-old-id` annotation of all resources under test to `.status.atProvider.id`
367376

@@ -373,7 +382,7 @@ This is used for marking an MR as test for automated tests. [Upjet based control
373382

374383
#### Delete Step
375384

376-
1 - Delete all resources under test and wait for deletion
385+
1 - Delete all resources under test and wait for deletion
377386

378387

379388
### Add Tests
@@ -391,7 +400,7 @@ See more details [here](https://github.com/crossplane/uptest?tab=readme-ov-file#
391400

392401
Define the available Versions of the resource and implement the [Conversion strategies](https://github.com/crossplane/upjet/blob/main/docs/managing-crd-versions.md#conversion-strategies).
393402

394-
Here an example of a property renaming
403+
Here an example of a property renaming
395404
```go
396405
p.AddResourceConfigurator("xyz", func(r *config.Resource) {
397406
r.Version = "v1alpha2"

examples/credentials.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,9 @@ stringData:
1212
"url": "https://keycloak.example.com",
1313
"base_path": "/auth",
1414
"realm": "master",
15-
"root_ca_certificate" : ""
16-
}
15+
"root_ca_certificate" : ""
16+
}
17+
18+
# Notes:
19+
# - Do not set base_path to "/". Use empty string instead when Keycloak is mounted at root.
20+
# - url/admin_url should be absolute URLs without query/fragment.

0 commit comments

Comments
 (0)