-
Notifications
You must be signed in to change notification settings - Fork 217
OWLS-73891 part3 - add FAQ entry for managing namespaces #1264
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
Changes from 12 commits
d873bc3
ba63179
9991f4e
aee30bf
900db63
770f8cc
7f5657c
9da3f29
94dad23
15065d1
4c3dd7c
5d51fba
3ae1e16
83f85c8
12a7d5f
f89bbf7
f96a124
6c9c820
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
--- | ||
title: "Managing Domain Namespaces" | ||
date: 2019-09-19 | ||
draft: false | ||
--- | ||
|
||
Each WebLogic operator deployment manages a number of Kubernetes namespaces (for more information about setting domain namespaces, see [Operator Helm configuration values]({{<relref "/userguide/managing-operators/using-the-operator/using-helm.md#operator-helm-configuration-values">}}). A couple of Kubernetes resources | ||
have to be present in a namespace before any WebLogic domain custom resources can be successfully | ||
deployed into it. | ||
Those Kubernetes resources are either created as part of the installation | ||
of the operator's helm chart, or created by the operator at runtime. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. helm -> Helm (always capitalized except when used in a command) |
||
|
||
This documentation describes a couple of things that you need to be aware when you manage the namespaces while the WebLogic operator is running. For example, | ||
doxiao marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* Add a namespace for the operator to manage, | ||
* Delete a namespace from the operator's domain namespace list, or | ||
* Delete and recreate a Kubernetes namespace that the WebLogic operator manages. | ||
|
||
See more in [Common Mistakes and Solutions]({{<relref "/userguide/managing-operators/using-the-operator/using-helm.md#common-mistakes-and-solutions">}}). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. General comments:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, Tom, for reviewing the doc. Those are all great comments. I'll add links from the introduction area to the individual sections, and add the section for getting the current value of domainNamespaces. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated the doc to address item #3 and #4. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am ok either way. |
||
|
||
#### Adding a Kubernetes namespace to the operator | ||
If you want a WebLogic operator deployment to manage a namespace, you need to add the namespace to the operator's `domainNamespaces` list. Note that the namespace has to be pre-created, say using the `kubectl create` command. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. pre-created, say using -> precreated, for example, using |
||
|
||
By adding a namespace to the `domainNamespaces` list, it tells the operator deployment or runtime | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By adding a namespace to the |
||
to initialize the necessary Kubernetes resources for the namespace so that the operator is ready to host WebLogic domain resources in that namespace. | ||
|
||
When the operator is running and managing the `default` namespace, the following example helm command adds namespace `ns1` to the `domainNamespaces` list, where `weblogic-operator` is the release name of the operator, and `kubernetes/charts/weblogic-operator` is the location of the operator's helm charts. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. adds namespace -> adds the namespace |
||
|
||
``` | ||
$ helm upgrade \ | ||
--reuse-values \ | ||
--set "domainNamespaces={default,ns1}" \ | ||
--wait \ | ||
--force \ | ||
weblogic-operator \ | ||
kubernetes/charts/weblogic-operator | ||
``` | ||
|
||
{{% notice note %}} | ||
Changes to the `domainNamespaces` list may not be picked up by the operator right away because the operator | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. list may not be picked up -> list might not be picked up |
||
checks the changes to the setting periodically. The operator becomes ready to host domain resources in | ||
doxiao marked this conversation as resolved.
Show resolved
Hide resolved
|
||
a namespace only after the required `configmap` (namely `weblogic-domain-cm`) is initialized in the namespace. | ||
{{% /notice %}} | ||
|
||
You can verify if the operator is ready to host domain resources in a namespace by checking the existence of the required `configmap` resource. | ||
doxiao marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
``` | ||
$ kubetctl get cm -n <namespace> | ||
``` | ||
|
||
For example, the following example shows that the domain `configmap` resource exists in namespace `ns1`. | ||
doxiao marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
``` | ||
bash-4.2$ kubectl get cm -n ns1 | ||
|
||
NAME DATA AGE | ||
|
||
weblogic-domain-cm 14 12m | ||
``` | ||
|
||
#### Deleting a Kubernetes namespace from the operator | ||
When a namespace is not supposed to be managed by an operator any more, it needs to be removed from | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is not supposed to be managed by an operator any more, -> is no longer supposed to be managed by an operator, |
||
the operator's `domainNamespaces` list so that the corresponding Kubernetes resources that are | ||
associated with the namespace can be cleaned up. | ||
|
||
While the operator is running and managing the `default` and `ns1` namespaces, the following example helm | ||
command removes namespace `ns1` from the `domainNamespaces` list, where `weblogic-operator` is the release | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. removes namespace -> removes the namespace |
||
name of the operator, and `kubernetes/charts/weblogic-operator` is the location of the helm charts of the operator. | ||
doxiao marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
``` | ||
$ helm upgrade \ | ||
--reuse-values \ | ||
--set "domainNamespaces={default}" \ | ||
--wait \ | ||
--force \ | ||
weblogic-operator \ | ||
kubernetes/charts/weblogic-operator | ||
|
||
``` | ||
|
||
#### Recreating a previously deleted Kubernetes namespace | ||
|
||
If you need to delete a namespace (and the resources in it) and then recreate it, | ||
remember to remove the namespace from the operator's `domainNamespaces` list | ||
after you deleted the namespace, and add it back to the `domainNamespaces` list after you recreated the namespace | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. after you deleted the namespace -> after you delete the namespace |
||
using the `helm upgrade` commands that have been illustrated above. | ||
doxiao marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
{{% notice note %}} | ||
Make sure that you wait a sufficient period of time between deleting and recreating the | ||
namespace because it takes time for the resources in a namespace to go way after the namespace is deleted. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. to go way -> to go away |
||
In addition, as we have mentioned above, changes to the `domainNamespaces` setting is checked by the operator | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. as we have mentioned above -> as mentioned above |
||
periodically, and the operator becomes ready to host domain resources only after the required domain | ||
`configmap` (namely `weblogic-domain-cm`) is initialized in the namespace. | ||
{{% /notice %}} | ||
|
||
If a domain custom resource is created before the namespace is ready, you may see that the introspector job pod | ||
fails to start with a warning event like the following when you check the description of the introspector pod. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fails to start with a warning event like the following when you check the description -> fails to start, with a warning event like the following, when you review the description |
||
Note that `domain1` is the name of the domain in the following example output. | ||
|
||
``` | ||
Events: | ||
Type Reason Age From Message | ||
---- ------ ---- ---- ------- | ||
Normal Scheduled 1m default-scheduler Successfully assigned domain1-introspect-domain-job-bz6rw to slc16ffk | ||
|
||
Normal SuccessfulMountVolume 1m kubelet, slc16ffk MountVolume.SetUp succeeded for volume "weblogic-credentials-volume" | ||
|
||
Normal SuccessfulMountVolume 1m kubelet, slc16ffk MountVolume.SetUp succeeded for volume "default-token-jzblm" | ||
|
||
Warning FailedMount 27s (x8 over 1m) kubelet, slc16ffk MountVolume.SetUp failed for volume "weblogic-domain-cm-volume" : configmaps "weblogic-domain-cm" not found | ||
|
||
``` | ||
|
||
If you run into situations where a new domain that is created after its namespace is deleted and recreated | ||
does not come up successfully, you can restart the operator pod as shown in the following examples, where | ||
the operator itself is running in the namespace `weblogic-operator-namespace` with a release name | ||
of `weblogic-operator`. | ||
|
||
* Killing the operator pod, and let Kubernetes restart it | ||
|
||
``` | ||
$ kubectl delete pod/weblogic-operator-65b95bc5b5-jw4hh -n weblogic-operator-namespace | ||
``` | ||
|
||
* Scaling the operator deployment to `0` and then back to `1` by changing the value of the `replicas`. | ||
|
||
``` | ||
$ kubectl scale deployment.apps/weblogic-operator -n weblogic-operator-namespace --replicas=0 | ||
``` | ||
|
||
``` | ||
$ kubectl scale deployment.apps/weblogic-operator -n weblogic-operator-namespace --replicas=1 | ||
``` | ||
|
||
{{% notice note %}} | ||
Restarting an operator pod interrupts not just the domain resources in the namespace that is to be re-initialized, | ||
but all domain resources managed by the operator deployment. Therefore, this can only be used as the last resort. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. as the last resort -> as a last resort |
||
{{% /notice %}}: |
Uh oh!
There was an error while loading. Please reload this page.