Merge pull request from jakkab/extend-readme

Extend readme: command-line flags
This commit is contained in:
Tomasz Smelcerz 2019-08-30 13:56:06 +02:00 committed by GitHub
commit b25727bb42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 9 deletions

@ -12,8 +12,9 @@
# Hydra-maester
This project contains a Kubernetes controller that uses Custom Resources to manage Hydra Oauth2 clients.
ORY Hydra Maester watches for instances of `oauth2clients.oathkeeper.ory.sh/v1alpha1` and creates, updates, or deletes corresponding OAuth2 clients by communicating with ORY Hydra API.
This project contains a Kubernetes controller that uses Custom Resources (CR) to manage Hydra Oauth2 clients. ORY Hydra Maester watches for instances of `oauth2clients.oathkeeper.ory.sh/v1alpha1` CR and creates, updates, or deletes corresponding OAuth2 clients by communicating with ORY Hydra's API.
Visit Hydra-maester's [chart documentation](https://github.com/ory/k8s/blob/master/docs/helm/hydra-maester.md) and view a [sample OAuth2 client resource](./config/samples/hydra_v1alpha1_oauth2client.yaml) to learn more about the `oauth2clients.oathkeeper.ory.sh/v1alpha1` CR.
The project is based on [Kubebuilder](https://github.com/kubernetes-sigs/kubebuilder).
@ -39,4 +40,11 @@ Take a look at [Design Readme](./docs/README.md).
- `make install` to generate CRD file from go sources and install it on the cluster
- `export HYDRA_URL={HYDRA_SERVICE_URL} && make run` to run the controller
To deploy the controller, edit the value of the ```--hydra-url``` argument in the [manager.yaml](config/manager/manager.yaml) file and run ```make deploy```.
To deploy the controller, edit the value of the ```--hydra-url``` argument in the [manager.yaml](config/manager/manager.yaml) file and run ```make deploy```.
### Command-line flags
| Name | Required | Description | Default value | Example values |
|-----------------|----------|------------------------------|---------------|------------------------------------------------------|
| **hydra-url** | yes | ORY Hydra's service address | - | ` ory-hydra-admin.ory.svc.cluster.local` |
| **hydra-port** | no | ORY Hydra's service port | `4445` | `4445` |

@ -115,14 +115,16 @@ func (r *OAuth2ClientReconciler) registerOAuth2Client(ctx context.Context, clien
},
}
err = r.Create(ctx, &clientSecret)
if err != nil {
return err
}
client.Status.Secret = &clientSecret.Name
client.Status.ClientID = created.ClientID
client.Status.ObservedGeneration = client.Generation
err = r.Create(ctx, &clientSecret)
if err != nil {
r.Log.Error(err, fmt.Sprintf("error creating secret for client %s/%s ", client.Name, client.Namespace), "oauth2client", "register")
} else {
client.Status.Secret = &clientSecret.Name
}
return r.Status().Update(ctx, client)
}