Skip to content

Commit 2a08963

Browse files
authored
Manage TLS / Certicate documentation (#390)
1 parent 8f098eb commit 2a08963

File tree

1 file changed

+57
-2
lines changed

1 file changed

+57
-2
lines changed

internal/doc/draft-user-guide-v1.adoc

100644100755
Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ Each `RuntimeComponent` CR must at least specify the `.spec.applicationImage` fi
7575
| `networkPolicy.namespaceLabels` | A set of labels that selects the namespace to allow incoming traffic from. Defaults to the same namespace that the application is deployed to.
7676
| `networkPolicy.fromLabels` | A set of labels that selects the pod(s) to allow incoming traffic from. Defaults to pod(s) belonging to the same application.
7777
| `createKnativeService` | A boolean to toggle the creation of Knative resources and usage of Knative serving.
78+
| `manageTLS` | A boolean to toggle automatic certificate generation and mounting TLS secret into the pod. The default value for this field is `true`.
7879
| `expose` | A boolean that toggles the external exposure of this deployment via a Route or a Knative Route resource.
7980
| `deployment.updateStrategy` | A field to specify the update strategy of the deployment. For more information, see link:++https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#strategy++[updateStrategy]
8081
| `deployment.updateStrategy.type` | The type of update strategy of the deployment. The type can be set to `RollingUpdate` or `Recreate`, where `RollingUpdate` is the default update strategy.
@@ -662,7 +663,7 @@ spec:
662663

663664
By setting `.spec.expose` field, the operator creates an unsecured route based on your application service. Setting this field is the same as running `oc expose service <service-name>`.
664665

665-
To create a secured HTTPS route, see the link:++#certificates++[Certificates] section.
666+
To create a secured HTTPS route, see the link:++#certificates++[Certificates / TLS] section.
666667

667668
==== Non-Knative deployment (Ingress)
668669

@@ -848,8 +849,62 @@ spec:
848849
role: frontend
849850
----
850851

851-
=== Certificates
852+
=== Certificates / TLS
852853

854+
==== Automatic certificate generation
855+
856+
When `manageTLS` is `true` (default), the operator will attempt to generate certificates and mount
857+
them to the pod at `/etc/x509/certs`. If the `expose` is set to `true` the Route will be also configured
858+
automatically to enable TLS using `reencrypt` termination. This will ensure end-to-end encryption from
859+
external source all the way to application/pod level.
860+
861+
===== Generating certificates using certificate manager
862+
863+
Before using this feature, certificate manager must be installed on the Kubernetes cluster.
864+
865+
The service certificate is generated using `cert-manager.io/v1` `Certificate` kind.
866+
867+
Operator will create a certificate authority (CA) Issuer instance to be shared
868+
by applications within a single namespace. The issuer will be used to generate
869+
a service certificate for each application that will be mounted into the pod.
870+
`tls.crt`, `tls.key` and `ca.crt` files will be mounted to the pod and location
871+
is indicated by `TLS_DIR` environment variable.
872+
873+
===== Generating certificate using Red Hat OpenShift service CA
874+
875+
When running on Red Hat OpenShift Container Platform operator can automatically generate
876+
service certificates using OpenShift Service CA.
877+
878+
This is a default and simplest way of generating certificates if the certificate manager operator
879+
is not installed on the cluster.
880+
881+
`tls.crt`, `tls.key` files will be mounted to the pod and location
882+
is indicated by `TLS_DIR` environment variable. The OpenShift CA certificate
883+
is provided inside `/var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt`
884+
file.
885+
886+
If the certificate manager is installed on the cluster it will be used to generate
887+
service certificates unless otherwise specified by the application. To force use of
888+
OpenShift service CA an annotation can be added to application's YAML:
889+
890+
[source,yaml]
891+
----
892+
apiVersion: rc.app.stacks/v1beta2
893+
kind: RuntimeComponent
894+
metadata:
895+
name: my-app
896+
namespace: test
897+
spec:
898+
applicationImage: quay.io/my-repo/my-app:1.0
899+
manageTLS: true
900+
expose: true
901+
service:
902+
annotations:
903+
service.beta.openshift.io/serving-cert-secret-name: my-app-svc-tls-ocp
904+
port: 9443
905+
----
906+
907+
==== Bring your own Certificates
853908
Specify your own certificates for the Service and Route using fields `.spec.service.certificateSecretRef` and `.spec.route.certificateSecretRef`.
854909

855910
Example of certificates specified for the Route:

0 commit comments

Comments
 (0)