Skip to content

Commit dfd811b

Browse files
committed
udpate sample for create domain credentials
1 parent 34be4a1 commit dfd811b

File tree

2 files changed

+49
-3
lines changed

2 files changed

+49
-3
lines changed
Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,49 @@
1-
# Ceating credentials for a WebLogic domain
1+
# Creating credentials for a WebLogic domain
22

3-
**TODO** write me
3+
This sample demonstrates how to create a Kubernetes secret containing the
4+
credentials for a WebLogic domain. The operator expects this secret to be
5+
named following the pattern `domainUID-weblogic-credentials`, where `domainUID`
6+
is the unique identifier of the domain. It must be in the same namespace
7+
that the domain will run in.
8+
9+
To use the sample, run the command:
10+
11+
```
12+
$ ./create-weblogic-credentials.sh -u username -p password -d domainUID -n namespace -s secretName
13+
```
14+
15+
The parameters are as follows:
16+
17+
```
18+
-u username, must be specified.
19+
-p password, must be specified.
20+
-d domainUID, optional. The default value is domain1. If specified, the secret will be labeled with the domainUID unless the given value is an empty string.
21+
-n namespace, optional. Use the default namespace if not specified
22+
-s secretName, optional. If not specified, the secret name will be determined based on the domainUID value
23+
```
24+
25+
This creates a `generic` secret containing the username and password as literal values.
26+
27+
You can check the secret with the `kubectl get secret` command. An example is shown below,
28+
including output:
29+
30+
```
31+
$ kubectl -n domain-namespace-1 get secret domain1-weblogic-credentials -o yaml
32+
apiVersion: v1
33+
data:
34+
password: d2VsY29tZTE=
35+
username: d2VibG9naWM=
36+
kind: Secret
37+
metadata:
38+
creationTimestamp: 2018-12-12T20:25:20Z
39+
labels:
40+
weblogic.domainName: domain1
41+
weblogic.domainUID: domain1
42+
name: domain1-weblogic-credentials
43+
namespace: domain-namespace-1
44+
resourceVersion: "5680"
45+
selfLink: /api/v1/namespaces/domain-namespace-1/secrets/domain1-weblogic-credentials
46+
uid: 0c2b3510-fe4c-11e8-994d-00001700101d
47+
type: Opaque
48+
49+
```

kubernetes/samples/scripts/create-weblogic-domain-credentials/create-weblogic-credentials.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function validateKubectlAvailable {
3939
}
4040

4141
function usage {
42-
echo usage: ${script} -u username -p password [-d domainUID] [-n namespace] [-s sercretName] [-h]
42+
echo usage: ${script} -u username -p password [-d domainUID] [-n namespace] [-s secretName] [-h]
4343
echo " -u username, must be specified."
4444
echo " -p password, must be specified."
4545
echo " -d domainUID, optional. The default value is domain1. If specified, the secret will be labeled with the domainUID unless the given value is an empty string."

0 commit comments

Comments
 (0)