Skip to content

Commit e0b6b0f

Browse files
committed
Update documentation
1 parent 0a3d1fa commit e0b6b0f

File tree

3 files changed

+51
-29
lines changed

3 files changed

+51
-29
lines changed

kubernetes/samples/scripts/rest/README.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,36 @@
22

33
When a user enables the operator's external REST API (by setting
44
`externalRestEnabled` to `true` when installing the operator Helm chart), the user needs
5-
to provide the certificate and private key for the API's SSL identity (by setting
6-
`externalOperatorCert` and `externalOperatorKey` to the base64 encoded PEM of the cert and
7-
key when installing the operator Helm chart).
5+
to provide the certificate and private key for api's SSL identity too (by creating a
6+
`tls secret` before the installation of the operator helm chart).
87

98
This sample script generates a self-signed certificate and private key that can be used
10-
for the operator's external REST API when experimenting with the operator. They should
9+
for the operator's external REST api when experimenting with the operator. They should
1110
not be used in a production environment.
1211

1312
The syntax of the script is:
1413
```
15-
$ kubernetes/samples/scripts/generate-external-rest-identity.sh <subject alternative names>
14+
$ kubernetes/samples/scripts/rest/generate-external-rest-identity.sh <SANs> -n <namespace> [-s <secret-name> ]
1615
```
1716

18-
Where `<subject alternative names>` lists the subject alternative names to put into the generated
19-
self-signed certificate for the external WebLogic Operator REST HTTPS interface. Each must be prefaced
17+
Where `<SANs>` lists the subject alternative names to put into the generated self-signed
18+
certificate for the external WebLogic Operator REST HTTPS interface, <namespace> should match
19+
the namespace where the operator will be installed, and optionally the secret name, which defaults
20+
to `weblogic-operator-external-rest-identity`. Each must be prefaced
2021
by `DNS:` (for a name) or `IP:` (for an address), for example:
2122
```
22-
DNS:myhost,DNS:localhost,IP:127.0.0.1
23+
DNS:myhost,DNS:localhost,IP:127.0.0.1 -n weblogic-operator
2324
```
2425

2526
You should include the addresses of all masters and load balancers in this list. The certificate
2627
cannot be conveniently changed after installation of the operator.
2728

28-
The script prints out the base64 encoded PEM of the generated certificate and private key
29-
in the same format that the operator Helm chart's `values.yaml` requires.
29+
The script creates the secret in the weblogic-operator namespace with the self-signed
30+
certificate and private key
3031

3132
Example usage:
3233
```
33-
$ generate-external-rest-identity.sh IP:127.0.0.1 > my_values.yaml
34+
$ generate-external-rest-identity.sh IP:127.0.0.1 -n weblogic-operator > my_values.yaml
3435
$ echo "externalRestEnabled: true" >> my_values.yaml
3536
...
3637
$ helm install kubernetes/charts/weblogic-operator --name my_operator --namespace my_operator-ns --values my_values.yaml --wait

kubernetes/samples/scripts/rest/generate-external-rest-identity.sh

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,19 @@
1212
# not be used in a production environment.
1313
#
1414
# The sytax of the script is:
15-
# kubernetes/samples/scripts/rest/generate-external-rest-identity.sh <SANs> <-n namespace>
1615
#
17-
# <subject alternative names> lists the subject alternative names to put into the generated
18-
# self-signed certificate for the external WebLogic Operator REST https interface.
19-
# For example:
16+
# kubernetes/samples/scripts/rest/generate-external-rest-identity.sh <SANs> -n <namespace>
17+
#
18+
# Where <SANs> lists the subject alternative names to put into the generated self-signed
19+
# certificate for the external WebLogic Operator REST https interface, for example:
20+
#
2021
# DNS:myhost,DNS:localhost,IP:127.0.0.1 -n weblogic-operator
2122
#
22-
# The script creates the secret secret in the weblogic-operator namespace with
23-
# the self-signed certificate and private key
23+
# You should include the addresses of all masters and load balancers in this list. The certificate
24+
# cannot be conveniently changed after installation of the operator.
25+
#
26+
# The script creates the secret in the weblogic-operator namespace with the self-signed
27+
# certificate and private key
2428
#
2529
# Example usage:
2630
# generate-external-rest-identity.sh IP:127.0.0.1 -n weblogic-operator > my_values.yaml
@@ -78,6 +82,8 @@ set -e
7882

7983
trap "cleanup" EXIT
8084

85+
SECRET_NAME="weblogic-operator-external-rest-identity"
86+
8187
while [ $# -gt 0 ]
8288
do
8389
key="$1"
@@ -124,11 +130,6 @@ then
124130
usage
125131
fi
126132

127-
if [ -z "$SECRET_NAME" ]
128-
then
129-
SECRET_NAME="weblogic-operator-external-rest-identity"
130-
fi
131-
132133
DAYS_VALID="3650"
133134
TEMP_PW="temp_password"
134135
OP_PREFIX="weblogic-operator"

site/install.md

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,21 +67,20 @@ The operator can expose an external REST HTTPS interface which can be accessed f
6767
To enable the external REST interface, configure these values in a custom configuration file, or on the Helm command line:
6868

6969
* Set `externalRestEnabled` to `true`.
70-
* Set `externalOperatorCert` to the certificate's Base64 encoded PEM.
71-
* Set `externalOperatorKey` to the keys Base64 encoded PEM.
70+
* Set `externalRestIdentitySecret` to the name of the Kubernetes secret that contains the certificate and private key.
7271
* Optionally, set `externalRestHttpsPort` to the external port number for the operator REST interface (defaults to `31001`).
7372

7473
More detailed information about configuration values can be found in [Operator Helm configuration values](#operator-helm-configuration-values).
7574

7675
### SSL certificate and private key for the REST interface
7776

78-
For testing purposes, the WebLogic Kubernetes Operator project provides a sample script that generates a self-signed certificate and private key for the operator REST interface and outputs them in YAML format. These values can be added to your custom YAML configuration file, for use when the operator's Helm chart is installed.
77+
For testing purposes, the WebLogic Kubernetes Operator project provides a sample script that generates a self-signed certificate and private key for the operator REST interface, store them in a Kubernetes tls secret and outputs the corresponding configuration values in YAML format. These values can be added to your custom YAML configuration file, for use when the operator's Helm chart is installed.
7978

8079
___This script should not be used in a production environment (because self-signed certificates are not typically considered safe).___
8180

82-
The script takes the subject alternative names that should be added to the certificate, for example, the list of hostnames that clients can use to access the external REST interface. In this example, the output is directly appended to your custom YAML configuration:
81+
The script takes the subject alternative names that should be added to the certificate, for example, the list of hostnames that clients can use to access the external REST interface, the optional secret name to store the certificate (defaults to weblogic-operator-external-rest-identity) and the namespace where the operator will be installed. In this example, the output is directly appended to your custom YAML configuration:
8382
```
84-
$ kubernetes/samples/scripts/rest/generate-external-rest-identity.sh "DNS:${HOSTNAME},DNS:localhost,IP:127.0.0.1" >> custom-values.yaml
83+
$ kubernetes/samples/scripts/rest/generate-external-rest-identity.sh "DNS:${HOSTNAME},DNS:localhost,IP:127.0.0.1 -n weblogic-operator " >> custom-values.yaml
8584
```
8685

8786
## Optional: Elastic Stack (Elasticsearch, Logstash, and Kibana) integration
@@ -348,7 +347,7 @@ Example:
348347
externalRestHttpsPort: 32009
349348
```
350349

351-
#### externalOperatorCert
350+
#### externalOperatorCert (Deprecated, use externalRestIdentitySecret instead)
352351

353352
Specifies the user supplied certificate to use for the external operator REST HTTPS interface. The value must be a string containing a Base64 encoded PEM certificate. This parameter is required if `externalRestEnabled` is `true`, otherwise, it is ignored.
354353

@@ -367,7 +366,7 @@ Example:
367366
externalOperatorCert: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUQwakNDQXJxZ0F3S ...
368367
```
369368

370-
#### externalOperatorKey
369+
#### externalOperatorKey (Deprecated, use externalRestIdentitySecret instead)
371370

372371
Specifies user supplied private key to use for the external operator REST HTTPS interface. The value must be a string containing a Base64 encoded PEM key. This parameter is required if `externalRestEnabled` is `true`, otherwise, it is ignored.
373372

@@ -385,6 +384,27 @@ Example:
385384
```
386385
externalOperatorKey: QmFnIEF0dHJpYnV0ZXMKICAgIGZyaWVuZGx5TmFtZTogd2VibG9naWMtb3B ...
387386
```
387+
#### externalRestIdentitySecret
388+
389+
Specifies the user supplied secret that contains the tls certificate and private key for the external operator REST HTTPS interface. The value must be the name of the Kubernetes tls secret previously created. This parameter is required if `externalRestEnabled` is `true`, otherwise, it is ignored. In order to create the Kubernetes tls secret you can use the following command:
390+
`kubectl create secret tls <secret-name> --cert=<path_to_certificate> --key=<path_to_private_key> -n <namespace>`
391+
392+
There is no default value.
393+
394+
The Helm installation will produce an error, similar to the following, if `externalRestIdentitySecret` is not specified (left blank) and `externalRestEnabled` is `true`:
395+
```
396+
Error: render error in "weblogic-operator/templates/main.yaml": template: weblogic-operator/templates/main.yaml:9:3: executing "weblogic-operator/templates/main.yaml"
397+
at <include "operator.va...>: error calling include: template: weblogic-operator/templates/_validate-inputs.tpl:42:14: executing "operator.validateInputs"
398+
at <include "utils.endVa...>: error calling include: template: weblogic-operator/templates/_utils.tpl:22:6: executing "utils.endValidation"
399+
at <fail $scope.validati...>: error calling fail:
400+
string externalRestIdentitySecret must be specified
401+
402+
```
403+
404+
Example: externalRestIdentitySecret: weblogic-operator-external-rest-identity
405+
```
406+
externalOperatorCert: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUQwakNDQXJxZ0F3S ...
407+
```
388408

389409
### Debugging options
390410

0 commit comments

Comments
 (0)