Skip to content

Owls83995 - Sample scripts to shutdown and start a specific managed server/cluster/domain #2002

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 36 commits into from
Nov 5, 2020
Merged
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
4d6de23
owls-83995 - Scripts to start/stop a managed server/cluster/domain
ankedia Oct 20, 2020
e20b630
fix method comments
ankedia Oct 20, 2020
7a2b1e3
Minor changes
ankedia Oct 20, 2020
cf096af
Address review comments and fix script comments/usages.
ankedia Oct 21, 2020
302a597
Added integration tests, made few doc changes based on review comment…
ankedia Oct 22, 2020
a134689
Clarify script usage, updated README file and minor changes.
ankedia Oct 22, 2020
97b7fcd
Changes to add script usage details
ankedia Oct 22, 2020
fde5cb8
Address PR review comments
ankedia Oct 22, 2020
2927762
Review comment and cleanup.
ankedia Oct 22, 2020
01e6307
Documentation changes based on PR review comments.
ankedia Oct 23, 2020
4eba072
Fully qualified replica value as per review comments
ankedia Oct 23, 2020
eadad48
edit docs
rosemarymarano Oct 23, 2020
5845883
edit README
rosemarymarano Oct 23, 2020
1fda64a
Address PR review comments
ankedia Oct 23, 2020
71922eb
Changes to address PR review comments and removed ItLifecycleSampleSc…
ankedia Oct 23, 2020
d66c1a8
fix indentation
ankedia Oct 23, 2020
05c5a3f
fix comment and typo
ankedia Oct 23, 2020
0ba9537
Added validation as per review comment.
ankedia Oct 24, 2020
0ab8bd0
changes to address review comment and minor cleanup
ankedia Oct 25, 2020
3950815
PR review comment - changes to assume default policy is IF_NEEDED if …
ankedia Oct 26, 2020
2859f08
changes for new algorithm as documented on http://aseng-wiki.us.oracl…
ankedia Oct 30, 2020
81e0486
More changes for new algorithm.
ankedia Oct 31, 2020
c6c287b
code refactoring and minor doc update.
ankedia Nov 1, 2020
3456c68
Minor change for dynamic server name validation
ankedia Nov 2, 2020
df3c33f
Changes to address review comments.
ankedia Nov 2, 2020
3e028fb
More review comment changes and cleanup.
ankedia Nov 3, 2020
10feb99
Unset policy to start independent (stadalone) maanged server instead …
ankedia Nov 3, 2020
15c725a
Latest review comment changes.
ankedia Nov 3, 2020
e5b1044
More changes based on review comments.
ankedia Nov 4, 2020
b17410a
Chnages for latest review comments.
ankedia Nov 4, 2020
38d442d
Remove unused action variable and assignments.
ankedia Nov 4, 2020
e4bf493
Fix the logic to display error when config map not found and return p…
ankedia Nov 4, 2020
b775210
Changes for latest review comments.
ankedia Nov 4, 2020
c1f109d
Changes for latest round of review comments.
ankedia Nov 4, 2020
2c5ae36
use printError instead of echo
ankedia Nov 4, 2020
899073a
Changes to remove integration tests and doc review comments.
ankedia Nov 5, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fully qualified replica value as per review comments
  • Loading branch information
ankedia committed Oct 23, 2020
commit 4eba0729462b6caff0e89559a453d4bceee2e94a
8 changes: 4 additions & 4 deletions kubernetes/samples/scripts/domain-lifecycle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
The WebLogic Server Kubernetes Operator project provides a set of sample scripts to shut-down or start-up a specific managed-server or cluster in a deployed Domain or the entire deployed Domain. Please note that Domain must have been created and deployed before these scripts can start or stop managed servers, clusters or the Domain. These can be helpful when scripting the lifecycle of a WebLogic Server Domain. Please see [Domain Life Cycle](https://oracle.github.io/weblogic-kubernetes-operator/userguide/managing-domains/domain-lifecycle) to learn how to start, stop, restart, and scale the WebLogic Server instances in your Domain.

#### Scripts to start and stop a managed server
The `startServer.sh` script starts a managed server by patching 'spec.managedServers.<server-name>.serverStartPolicy' attribute of the domain resource to `ALWAYS`. It also increases the replica count value for the managed server's cluster by `1`. The script provides an option to keep the replica count value constant. Please see script `usage` information using `-h` option.
The `startServer.sh` script starts a managed server by patching 'spec.managedServers.<server-name>.serverStartPolicy' attribute of the domain resource to `ALWAYS`. For clustered servers, it also increases the 'spec.clusters.<cluster-name>.replicas' value for the managed server's cluster by `1`. The script provides an option to keep the 'spec.clusters.<cluster-name>.replicas' value constant for clustered servers. Please see script `usage` information using `-h` option.
```
$ startServer.sh -d domain1 -n weblogic-domain-1 -s managed-server1
[INFO] Patching start policy of server 'managed-server1' from 'NEVER' to 'ALWAYS' and incrementing replica count for cluster 'cluster-1'.
Expand All @@ -12,7 +12,7 @@ domain.weblogic.oracle/domain1 patched
The replica count for cluster 'cluster-1' updated to 1.
```

The `stopServer.sh` script shuts down a running managed server by patching 'spec.managedServers.<server-name>.serverStartPolicy' attribute of the domain resource to `NEVER`. It also decreases the replica count for the managed server's cluster by `1`. The script provides an option to keep the replica count value constant. Please see script `usage` information using `-h` option.
The `stopServer.sh` script shuts down a running managed server by patching 'spec.managedServers.<server-name>.serverStartPolicy' attribute of the domain resource to `NEVER`. For clustered servers, it also decreases the 'spec.clusters.<cluster-name>.replicas' for the managed server's cluster by `1`. The script provides an option to keep the 'spec.clusters.<cluster-name>.replicas' value constant for clustered servers. Please see script `usage` information using `-h` option.
```
$ stopServer.sh -d domain1 -n weblogic-domain-1 -s managed-server1
[INFO] Patching start policy of server 'managed-server1' from 'ALWAYS' to 'NEVER' and decrementing replica count for cluster 'cluster-1'.
Expand All @@ -23,8 +23,8 @@ domain.weblogic.oracle/domain1 patched
```

#### Script behavior when starting or stopping a clustered managed server
Below table shows the new values of 'serverStartPolicy' attribute and replica count as updated by the server start and stop scripts.
| Script Name | Keep Replica Count Constant? | Previous Clustered Server State | New serverStartPolicy value | New Clustered Server State | Cluster's Replica Count Value |
Below table shows the new values of 'spec.managedServers.<server-name>.serverStartPolicy' and 'spec.clusters.<cluster-name>.replicas' as updated by the server start and stop scripts.
| Script Name | Keep replicas constant? | Previous Clustered Server State | New serverStartPolicy value | New Clustered Server State | Cluster's replicas value |
| --- | --- | --- | --- | --- | --- |
| `startServer.sh`| No (default) | Stopped | `ALWAYS` | Started | `Incremented by 1` |
| `startServer.sh`| Yes | Stopped | `ALWAYS` | Started | Unchanged |
Expand Down