You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* First pass
* Cleanup mounting scalingAction.sh into the admin server pod
* Fix typo
* More updates, remove config map example
* Complete non-WLDF, non-Prometheus updates
* Fix typo, remove TODO
* Fix typo
* Fix typo
* Fix typo
* Fix more typos
* Fix even more typos
* fix paths to point to right branch
Copy file name to clipboardExpand all lines: site/helm-charts.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -103,7 +103,7 @@ The `helm delete` command is used to remove an operator release and its associat
103
103
helm delete --purge weblogic-operator
104
104
```
105
105
106
-
Note: if the operator's namespace did not exist before the Helm chart was installed, then Helm will create it, however, `helm delete` will not remove it.
106
+
**NOTE**: if the operator's namespace did not exist before the Helm chart was installed, then Helm will create it, however, `helm delete` will not remove it.
107
107
108
108
## Useful Helm operations
109
109
@@ -232,9 +232,9 @@ Example 2: In the configuration below, the Helm installation will manage `namesp
232
232
domainNamespaces: [ "namespace1", "namespace2" ]
233
233
```
234
234
235
-
NOTE: one must include the `default` namespace in the list if you want the operator to monitor both the `default` namespace and some other namespaces.
235
+
**NOTE**: one must include the `default` namespace in the list if you want the operator to monitor both the `default` namespace and some other namespaces.
236
236
237
-
NOTE: these examples show two valid YAML syntax options for arrays.
237
+
**NOTE**: these examples show two valid YAML syntax options for arrays.
-note: this deletes the role binding in the domain namespace that was created by the first operator release to give the operator access to the domain namespace
420
+
-**NOTE**: this deletes the role binding in the domain namespace that was created by the first operator release to give the operator access to the domain namespace
421
421
-`helm upgrade <old op release> kubernetes/charts/weblogic-operator --values <old op custom-values.yaml>`
422
422
- this recreates the role binding
423
423
- there might be intermittent failures in the operator for the period of time when the role binding was deleted
Here we are editing a domain resource named 'domain1'. The `kubectl edit` command will open the domain resource definition in an editor and allow you to modify the `replicas` value directly. Once committed, the operator will be notified of the change and will immediately attempt to scale the corresponding dynamic cluster by reconciling the number of running pods/Managed Server instances with the `replicas` value specification.
22
22
```
23
23
spec:
24
-
adminSecret:
25
-
name: domain1-weblogic-credentials
26
-
asName: admin-server
27
-
asPort: 7001
28
-
clusterStartup:
29
-
- clusterName: cluster-1
30
-
desiredState: RUNNING
31
-
env:
32
-
- name: JAVA_OPTIONS
33
-
value: -Dweblogic.StdoutDebugEnabled=false
34
-
- name: USER_MEM_ARGS
35
-
value: '-Xms64m -Xmx256m '
36
-
replicas: 1
37
-
...
24
+
...
25
+
clusters:
26
+
- clusterName: cluster-1
27
+
replicas: 1
28
+
...
29
+
```
30
+
31
+
Alternatively, you can specify a default `replicas` value for all the clusters. If you do this, then you don't need to list the cluster in the domain resource (unless you want to customize another property of the cluster).
32
+
```
33
+
spec:
34
+
...
35
+
replicas: 1
36
+
...
38
37
```
39
38
40
39
## Calling the operator's REST scale API
@@ -88,55 +87,8 @@ The WebLogic Kubernetes Operator can expose both an internal and external REST H
88
87
The internal REST endpoint is only accessible from within the Kubernetes cluster. The external REST endpoint
89
88
is accessible from outside the Kubernetes cluster.
90
89
The internal REST endpoint is enabled by default and thus always available, whereas the external REST endpoint
91
-
is disabled by default and only exposed if explicitly configured. The following values, defined in the `create-weblogic-operator-inputs.yaml`,
92
-
are used to enable and configure the external REST endpoint:
93
-
94
-
```
95
-
# Options for externally exposing the operator REST HTTPS interface
96
-
# (i.e. outside of the Kubernetes cluster). Valid values are:
97
-
#
98
-
# "NONE"
99
-
# The REST interface is not exposed outside the Kubernetes cluster.
100
-
#
101
-
# "SELF_SIGNED_CERT"
102
-
# The REST interface is exposed outside of the Kubernetes cluster on the
103
-
# port specified by the 'externalRestHttpsPort' property.
104
-
# A self-signed certificate and private key are generated for the REST interface.
105
-
# The certificate's subject alternative names are specified by the 'externalSans'
106
-
# property.
107
-
#
108
-
# "CUSTOM_CERT"
109
-
# The REST interface is exposed outside of the Kubernetes cluster on the
110
-
# port specified by the 'externalRestHttpsPort' property.
111
-
# The customer supplied certificate and private key are used for the REST
112
-
# interface. They are specified by the 'externalOperatorCert' and
113
-
# 'eternalOperatorKey' properties.
114
-
externalRestOption: NONE
115
-
116
-
# The node port that should be allocated for the external operator REST https interface.
117
-
# This parameter is required if 'externalRestOption' is not 'NONE'.
118
-
# Otherwise, it is ignored.
119
-
externalRestHttpsPort: 31001
120
-
121
-
# The subject alternative names to put into the generated self-signed certificate
122
-
# for the external WebLogic Operator REST https interface, for example:
123
-
# DNS:myhost,DNS:localhost,IP:127.0.0.1
124
-
# This parameter is required if 'externalRestOption' is 'SELF_SIGNED_CERT'.
125
-
# Otherwise, it is ignored.
126
-
externalSans:
127
-
128
-
# The customer supplied certificate to use for the external operator REST
129
-
# https interface. The value must be a string containing a base64 encoded PEM certificate.
130
-
# This parameter is required if 'externalRestOption' is 'CUSTOM_CERT'.
131
-
# Otherwise, it is ignored.
132
-
externalOperatorCert:
133
-
134
-
# The customer supplied private key to use for the external operator REST
135
-
# https interface. The value must be a string containing a base64 encoded PEM key.
136
-
# This parameter is required if 'externalRestOption' is 'CUSTOM_CERT'.
137
-
# Otherwise, it is ignored.
138
-
externalOperatorKey:
139
-
```
90
+
is disabled by default and only exposed if explicitly configured.
91
+
Detailed instructions for configuring the external REST endpoint are available [here](helm-charts.md).
140
92
141
93
**NOTE**: Regardless of which endpoint is being invoked, the URL format for scaling is the same.
142
94
@@ -149,21 +101,21 @@ When the operator receives a scaling request, it will:
149
101
* Validate that the WebLogic cluster, identified by `clusterName`, exists.
150
102
* Verify that the specified WebLogic cluster has a sufficient number of configured servers to satisfy the scaling request.
151
103
* Initiate scaling by setting the `replicas` property within the corresponding domain resource, which can be done in either:
152
-
* A `clusterStartup` entry, if defined within its cluster list.
153
-
* At the domain level, if not defined in a `clusterStartup` entry and the `startupControl` property is set to `AUTO`.
104
+
* A `cluster` entry, if defined within its cluster list.
105
+
* At the domain level, if not defined in a `cluster` entry.
154
106
155
107
In response to a change to either `replicas` property, in the domain resource, the operator will increase or decrease the number of pods (Managed Servers) to match the desired replica count.
156
108
157
109
## Using a WLDF policy rule and script action to call the operator's REST scale API
158
110
The WebLogic Diagnostics Framework (WLDF) is a suite of services and APIs that collect and surface metrics that provide visibility into server and application performance.
159
111
To support automatic scaling of WebLogic clusters in Kubernetes, WLDF provides the Policies and Actions component, which lets you write policy expressions for automatically executing scaling
160
112
operations on a cluster. These policies monitor one or more types of WebLogic Server metrics, such as memory, idle threads, and CPU load. When the configured threshold
161
-
in a policy is met, the policy is triggered, and the corresponding scaling action is executed. The WebLogic Kubernetes Operator project provides a shell script, [`scalingAction.sh`](https://github.com/oracle/weblogic-kubernetes-operator/blob/master/src/scripts/scaling/scalingAction.sh),
113
+
in a policy is met, the policy is triggered, and the corresponding scaling action is executed. The WebLogic Kubernetes Operator project provides a shell script, [`scalingAction.sh`](/src/scripts/scaling/scalingAction.sh),
162
114
for use as a Script Action, which illustrates how to issue a request to the operator’s REST endpoint.
163
115
164
116
### Configure automatic scaling of WebLogic clusters in Kubernetes with WLDF
165
117
The following steps are provided as a guideline on how to configure a WLDF Policy and Script Action component for issuing scaling requests to the operator's REST endpoint:
166
-
1. Copy the [`scalingAction.sh`](https://github.com/oracle/weblogic-kubernetes-operator/blob/master/src/scripts/scaling/scalingAction.sh) script to a directory (such as `$DOMAIN_HOME/bin/scripts`) so that it's accessible within the Administration Server pod.
118
+
1. Copy the [`scalingAction.sh`](/src/scripts/scaling/scalingAction.sh) script to a directory (such as `$DOMAIN_HOME/bin/scripts`) so that it's accessible within the Administration Server pod.
167
119
2. Configure a WLDF policy and action as part of a diagnostic module targeted to the Administration Server. For information about configuring the WLDF Policies and Actions component,
168
120
see [Configuring Policies and Actions](https://docs.oracle.com/middleware/1221/wls/WLDFC/config_watch_notif.htm#WLDFC188) in _Configuring and Using the Diagnostics Framework for Oracle WebLogic Server_.
169
121
@@ -173,22 +125,19 @@ see [Configuring Policies and Actions](https://docs.oracle.com/middleware/1221/w
173
125
174
126
Important notes about the configuration properties for the Script Action:
175
127
176
-
`Working Directory` and `Path to Script` configuration entries specify the volume mount path (`/shared`) to access the WebLogic domain home.
177
128
The `scalingAction.sh` script requires access to the SSL certificate of the operator’s endpoint and this is provided through the environment variable `INTERNAL_OPERATOR_CERT`.
178
129
The operator’s SSL certificate can be found in the `internalOperatorCert` entry of the operator’s ConfigMap `weblogic-operator-cm`:
* `kubernetes_master` - Kubernetes master URL, default=https://kubernetes. **NOTE**: Set this to https://kubernetes.default.svc when invoking `scalingAction.sh` from the Administration Server pod.
203
152
204
153
* `access_token` - Service Account Bearer token for authentication and authorization for access to REST Resources
205
154
@@ -285,19 +234,23 @@ you can use a third party monitoring application like Prometheus. Please read t
285
234
details about [Using Prometheus to Automatically Scale WebLogic Clusters on Kubernetes](https://blogs.oracle.com/weblogicserver/using-prometheus-to-automatically-scale-weblogic-clusters-on-kubernetes-v5).
286
235
287
236
## Helpful Tips
288
-
### Debugging scriptAction.sh
289
-
The [`scalingAction.sh`](https://github.com/oracle/weblogic-kubernetes-operator/blob/master/src/scripts/scaling/scalingAction.sh) script was designed to be executed within the
290
-
Administration Server pod because the associated diagnostic module is targed to the Administration Server. The easiest way to verify and debug the `scriptAction.sh` script is
291
-
to open a shell on the running Administration Server pod and execute the script on the command line. The following example illustrates how to open a bash shell on a running
292
-
Administration Server pod named `domain1-admin-server` and execute the `scriptAction.sh` script:
237
+
### Debugging scalingAction.sh
238
+
The [`scalingAction.sh`](/src/scripts/scaling/scalingAction.sh) script was designed to be executed within the
239
+
Administration Server pod because the associated diagnostic module is targed to the Administration Server.
240
+
241
+
The easiest way to verify and debug the `scalingAction.sh` script is to open a shell on the running Administration Server pod and execute the script on the command line.
242
+
243
+
The following example illustrates how to open a bash shell on a running Administration Server pod named `domain1-admin-server` and execute the `scriptAction.sh` script. It assumes that:
244
+
* the domain home is in `/u01/oracle/user-projects/domains/domain1` (i.e. the domain home is inside a docker image).
245
+
* the Dockerfile copied [`scalingAction.sh`](/src/scripts/scaling/scalingAction.sh) to `/u01/oracle/user-projects/domains/domain1/bin/scripts/scalingAction.sh`.
293
246
294
247
```
295
248
> kubectl exec -it domain1-admin-server /bin/bash
296
-
# bash> cd /shared/domain/base_domain/bin/scripts
297
-
# bash> ./scriptAction.sh
249
+
# bash> cd /u01/oracle/user-projects/domains/domain1/bin/scripts
250
+
# bash> ./scalingAction.sh
298
251
```
299
252
300
-
A log, `scriptAction.log`, will be generated in the same directory as the script was executed in and can be examined for errors.
253
+
A log, `scalingAction.log`, will be generated in the same directory as the script was executed in and can be examined for errors.
301
254
302
255
### Example on accessing the external REST endpoint
303
256
The easiest way to test scaling using the external REST endpoint is to use a command-line tool like `curl`. Using `curl` to issue
@@ -309,7 +262,7 @@ an HTTPS scale request requires these mandatory header properties:
309
262
The following shell script is an example of how to issue a scaling request, with the necessary HTTP request header values, using `curl`.
310
263
This example assumes the operator and domain resource are configured with the following properties in Kubernetes:
311
264
* Operator properties:
312
-
*externalRestOption: `SELF_SIGNED_CERT`
265
+
*externalRestEnabled: `true`
313
266
* externalRestHttpsPort: `31001`
314
267
* operator's namespace: `weblogic-operator`
315
268
* operator's hostname is the same as the host shell script is executed on.
@@ -323,14 +276,14 @@ This example assumes the operator and domain resource are configured with the fo
323
276
# Setup properties
324
277
ophost=`uname -n`
325
278
opport=31001 #externalRestHttpsPort
326
-
cluster=DockerCluster
279
+
cluster=cluster-1
327
280
size=3 #New cluster size
328
-
domdir=${PWD}
329
281
ns=weblogic-operator # Operator NameSpace
282
+
sa=weblogic-operator # Operator ServiceAccount
330
283
domainuid=domain1
331
284
332
285
# Retrieve service account name for given namespace
333
-
sec=`kubectl get serviceaccount ${ns} -n ${ns} -o jsonpath='{.secrets[0].name}'`
286
+
sec=`kubectl get serviceaccount ${sa} -n ${ns} -o jsonpath='{.secrets[0].name}'`
334
287
#echo "Secret [${sec}]"
335
288
336
289
# Retrieve base64 encoded secret for the given service account
0 commit comments