Skip to content

Commit 5c7fa39

Browse files
rosemarymaranomarkxnelson
authored andcommitted
first draft Quick Start re-write (#628)
* first draft Quick Start re-write * fix broken link * remove redundant step 4d * address all Monica's comments and Tom's suggestion * add create domain resource command from Dongbo * point to create domain script as per Dongbo * fix links * add command to remove domain Ingress * fix some cmds * fix traefik link
1 parent 9bf19f6 commit 5c7fa39

File tree

1 file changed

+119
-87
lines changed

1 file changed

+119
-87
lines changed

site/quickstart.md

Lines changed: 119 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,160 +1,192 @@
11
# Quick start guide
22

3-
Use this quick start guide to create a WebLogic deployment in a Kubernetes cluster.
3+
Use this quick start guide to create a WebLogic deployment in a Kubernetes cluster with the Oracle WebLogic Kubernetes Operator. Please note that this walk-through is for demonstration purposes only, not for use in production.
44

5-
## 1. Get the images and put them into your local registry.
5+
## Prerequisite
6+
For this exercise, you’ll need a Kubernetes cluster. If you need help setting one up, check out our [cheat sheet](k8s_setup.md).
67

7-
For the Operator image:
8+
## 1. Get these images and put them into your local registry.
9+
10+
a. Pull the operator image:
811
```
912
$ docker pull oracle/weblogic-kubernetes-operator:2.0
1013
```
11-
For the Traefik image:
14+
b. Pull the Traefik load balancer image:
1215
```
1316
$ docker pull traefik:latest
1417
```
18+
c. Pull the WebLogic 12.2.1.3 install image:
19+
```
20+
$ docker pull store/oracle/weblogic:12.2.1.3
21+
```
22+
d. Then patch the WebLogic image according to these [instructions](https://github.com/oracle/docker-images/tree/master/OracleWebLogic/samples/12213-patch-wls-for-k8s).
23+
1524
## 2. Create a Traefik (Ingress-based) load balancer.
1625

17-
Use Helm to install the [Traefik](../kubernetes/samples/charts/traefik/README.md) load balancer.
26+
Use Helm to install the [Traefik](../kubernetes/samples/charts/traefik/README.md) load balancer. Use the [values.yaml](kubernetes/samples/charts/traefik/values.yaml) in the sample but set `kubernetes.namespaces` specifically.
1827
```
19-
$ helm install --name traefik-operator --namespace traefik stable/traefik
28+
$ helm install \
29+
--name traefik-operator \
30+
--namespace traefik \
31+
--values <path>/values.yaml \
32+
--set "kubernetes.namespaces={traefik}" \
33+
stable/traefik
2034
```
21-
## 3. Configure Kibana and Elasticsearch.
22-
23-
Use the [`elasticsearch_and_kibana`](https://github.com/oracle/weblogic-kubernetes-operator/blob/develop/kubernetes/samples/scripts/elasticsearch_and_kibana.yaml) YAML file.
35+
Wait until the Traefik operator pod is running and ready.
2436
```
25-
$ kubectl apply -f kubernetes/samples/scripts/elasticsearch_and_kibana.yaml
37+
$ kubectl -n traefik get pod -w
2638
```
39+
## 3. Install the operator.
2740

28-
## 4. Install the operator.
29-
30-
* Create a namespace for the operator:
41+
a. Create a namespace for the operator:
3142
```
32-
$ kubectl create namespace weblogic-operator
43+
$ kubectl create namespace sample-weblogic-operator-ns
3344
```
34-
* Create a `serviceAccount` for the operator's namespace. If not specified, it defaults to `default` (for example, the namespace's default service account).
35-
* Invoke the script to generate the credentials for the operator and add it to the operator YAML file (you can keep all the default values).
36-
* Create the operator using `helm install`, and passing in the namespace, service account, and location of Elasticsearch.
37-
* Helm is used to deploy the operator in a Kubernetes cluster.
38-
* Use the `helm install` command to install the operator Helm chart, passing in the `values.yaml`.
39-
* Edit the `values.yaml` file to update the information such as the operator's namespace and service account.
45+
b. Create a service account for the operator in the operator's namespace:
4046
```
41-
$ helm install kubernetes/charts/weblogic-operator --name my-operator --namespace weblogic-operator-ns --values values.yaml --wait
47+
$ kubectl create serviceaccount -n sample-weblogic-operator-ns sample-weblogic-operator-sa
4248
```
49+
c. Use ` helm` to install and start the operator:
4350

44-
## 5. Prepare your environment for a domain.
51+
```
52+
$ helm install \
53+
--name sample-weblogic-operator \
54+
--namespace sample-weblogic-operator-ns \
55+
--set serviceAccount=sample-weblogic-operator-sa \
56+
--set "domainNamespaces={}" \
57+
-- wait \
58+
kubernetes/charts/weblogic-operator
59+
```
60+
d. Verify that the operator is up and running by viewing the operator pod's log:
4561

46-
* Optionally, create a domain namespace if you want to persist the domain home in a PV:
4762
```
48-
$ kubectl create namespace domain1-ns
63+
$ kubectl log -n sample-weblogic-operator-ns -c weblogic-operator deployments/weblogic-operator
4964
```
50-
* Create the Kubernetes secrets for the Administration Server boot credentials by invoking the [`create-weblogic-credentials` script](https://github.com/oracle/weblogic-kubernetes-operator/blob/develop/kubernetes/samples/scripts/create-weblogic-domain/create-weblogic-credentials.sh).
5165

52-
* Create a PV & PVC for the domain:
53-
* Find the `create_pv_pvc.sh script` and YAML files you'll need to edit to create the PV and PVC, in the https://github.com/oracle/weblogic-kubernetes-operator/tree/develop/kubernetes/samples/scripts/create-weblogic-domain-pv-pvc directory.
54-
* Edit the operator YAML file to add the domain namespace, then do a `helm upgrade`.
55-
* Create the Docker image for the domain home in the image or use the WebLogic binary image.
56-
* Run WLST to create the domain in PV (remember to apply the patch).
66+
## 4. Prepare your environment for a domain.
5767

58-
## 6. Create a domain.
68+
a. Create a namespace that can host one or more domains:
5969

60-
* Edit the domain YAML file (can the defaults be used?).
61-
* Create the domain home for the domain.
62-
* For a domain home on a PV, first pull the WebLogic 12.2.1.3 install image into a local repository:
70+
```
71+
$ kubectl create namespace sample-domains-ns1
72+
```
73+
b. Use `helm` to configure the operator to manage domains in this namespace:
6374

64-
```
65-
$ docker pull store/oracle/weblogic:12.2.1.3-dev
6675
```
67-
* For reference, see the [domain home on PV README](https://github.com/oracle/weblogic-kubernetes-operator/blob/develop/kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/README.md).
68-
* The `create-domain.sh` will:
69-
* Create a directory for the generated Kubernetes YAML files for this domain. The pathname is `/path/to/weblogic-operator-output-directory/weblogic-domains/`.
70-
* Create a Kubernetes job that will start up a utility WebLogic Server container and run offline WLST scripts, or WebLogic Deploy Tool (WDT) scripts, to create the domain on the shared storage.
71-
* Run and wait for the job to finish.
72-
* Create a Kubernetes domain resource YAML file, `domain-custom-resource.yaml`, in the directory that is created above. You can use this YAML file to create the Kubernetes resource using the `kubectl create -f` or `kubectl apply -f` command:
76+
$ helm upgrade \
77+
--reuse-values \
78+
--set "domainNamespaces={sample-domains-ns1}" \
79+
--wait \
80+
sample-weblogic-operator \
81+
kubernetes/charts/weblogic-operator
7382
7483
```
75-
./create-domain.sh
76-
-i create-domain-inputs.yaml
77-
-o /path/to/output-directory
84+
c. Configure Traefik to manage Ingresses created in this namespace:
85+
```
86+
$ helm upgrade \
87+
--reuse-values \
88+
--set "kubernetes.namespaces={traefik,sample-domains-ns1}" \
89+
traefik-operator \
90+
stable/traefik
91+
```
92+
d. Wait until the Traefik operator pod finish restart.
93+
```
94+
$ kubectl -n traefik get pod -w
7895
```
7996

80-
* For a domain home in image, use the sample in the Docker GitHub project.
81-
82-
* Optionally, create a configuration overrides template and any additional Kubernetes secrets it needs (for example, to override the domain home configuration of a database URL, username, and password).
97+
## 5. Create a domain in the domain namespace.
8398

84-
* Create a domain resource in the domain namespace.
85-
* Specify the following information: domain UID, service account, secret name, the domain home details, and optionally, the configuration overrides template name.
99+
a. Create a new image with a domain home by running the [`create-domain`](../kubernetes/samples/scripts/create-weblogic-domain/domain-home-in-image/create-domain.sh) script. Follow the directions in the [README](../kubernetes/samples/scripts/create-weblogic-domain/domain-home-in-image/README.md) file, including:
86100

87-
* Configure the operator to know about the domain.
88-
* Edit the operator `values.yaml` file to add the namespace of the domain:
101+
* Modifying the sample `inputs.yaml` file with the `domainUID` (`sample-domain1`) and domain namespace (`sample-domains-ns1`).
89102

103+
* Creating Kubernetes secrets `username` and `password` of the admin account using the [`create-weblogic-credentials`](../kubernetes/samples/scripts/create-weblogic-domain-credentials/create-weblogic-credentials.sh) script.
90104
```
91-
$ helm update kubernetes/charts/weblogic-operator --name my-operator --namespace weblogic-operator-ns --values values.yaml --wait
105+
cd ../kubernetes/samples/scripts/create-weblogic-domain-credentials
106+
./create-weblogic-credentials.sh -u <username> -p <password> -n sample-domain1-ns -d sample-domain1
92107
```
93108

94-
* Configure the Traefik load balancer to manage the domain as follows:
95-
* Create an Ingress for the domain in the domain namespace (it contains the routing rules for the domain):
109+
b. Confirm that the operator started the servers for the domain:
110+
```
111+
$ kubectl get po -n sample-domain1-ns
112+
```
113+
* Use `kubectl` to show that the domain resource was created:
114+
```
115+
$ kubectl describe domain sample-domain1 -n sample-domain1-ns
116+
```
117+
* Verify that the operator's pod is running, by listing the pods in the operator's namespace. You should see one for the operator.
118+
```
119+
kubectl get pods -n sample-weblogic-operator1-ns
120+
```
96121

122+
c. Create an Ingress for the domain, in the domain namespace, by using the [sample](../kubernetes/samples/charts/ingress-per-domain/README.md) Helm chart:
123+
* Use `helm install`, specifying the `domainUID` (`sample-domain1`) and domain namespace (`sample-domains-ns1`).
97124
```
98125
$ cd kubernetes/samples/charts
99126
$ helm install ingress-per-domain --name domain1-ingress --values values.yaml
100127
```
101128

102-
(At this point, do they have a WebLogic Kubernetes deployment in a Kubernetes cluster? If so, we have to give them something to look at, to verify their results.)
103-
104-
## 7. Remove a domain.
129+
d. Confirm that the load balancer noticed the new Ingress and is successfully routing to the domain's server pods:
130+
```
131+
$ curl http://${HOSTNAME}:30305/sample-domain1/
132+
```
105133

106-
* Remove the domain's Kubernetes resources (domain, secrets, ingress, ...).
107-
* To remove the domain and all the Kubernetes resources (labeled with the `domainUID`), invoke the [delete domain resources script](https://github.com/oracle/weblogic-kubernetes-operator/blob/develop/kubernetes/samples/scripts/delete-weblogic-domain-resources.sh).
108134

109-
* The operator will notice that the domain's domain resource has been removed and will then kill the pods.
110-
* Configure the Traefik load balancer to stop managing the domain.
111-
* If you have configured Traefik to manage the domain's namespace (instead of the default: all namespaces), then edit the Traefik YAML file to remove the domain namespace and do a `helm update`:
135+
## 6. Remove the domain.
112136

137+
a. Remove the domain's Ingress by using `helm`:
113138
```
114-
helm update --name traefik-operator --namespace traefik (default values in yaml)
115-
or
116-
helm update --name traefik-operator --namespace traefik --values values.yaml stable/traefik
139+
helm delete --purge domain1-ingress
117140
```
141+
b. Remove the domain resource by using the sample [`delete-weblogic-domain-resources`](../kubernetes/samples/scripts/delete-domain/delete-weblogic-domain-resources.sh) script.
118142

119-
* Remove the domain home if it's on a PV.
143+
c. Use `kubectl` to confirm that the server pods and domain resource are gone.
120144

121-
## 8. Remove the domain namespace.
145+
## 7. Remove the domain namespace.
146+
a. Configure the Traefik load balancer to stop managing the Ingresses in the domain namespace:
122147

123-
* Configure the Traefik load balancer to stop managing the domain namespace. Use `helm upgrade` to remove the domain namespace from the list of namespaces.
124-
* Configure the operator to stop managing the domain. Use `helm upgrade` to remove the domain namespace from the list of domain namespaces.
125-
* Remove the PV & PVC for the domain namespace.
126-
* Remove the domain namespace:
127148
```
128-
$ kubectl delete namespaces domain1-ns
149+
$ helm upgrade \
150+
--reuse-values \
151+
--set "kubernetes.namespaces={traefik}" \
152+
traefik-operator \
153+
stable/traefik
129154
```
130155

131-
## 9. Remove the operator.
132-
133-
* Remove the operator:
156+
b. Configure the operator to stop managing the domain.
134157

135158
```
136-
helm delete --purge my-operator
159+
$ helm upgrade \
160+
--reuse-values \
161+
--set "domainNamespaces={}" \
162+
--wait \
163+
sample-weblogic-operator \
164+
kubernetes/charts/weblogic-operator
137165
```
138-
* Remove the operator namespace:
166+
c. Delete the domain namespace:
139167

140168
```
141-
$ kubectl delete namespaces weblogic-operator-ns
169+
$ kubectl delete namespace sample-domains-ns1
142170
```
143171

144-
## 10. Remove other resources.
145-
146-
* Optionally, remove Kibana and Elasticsearch:
172+
## 8. Remove the operator.
147173

174+
a. Remove the operator:
148175
```
149-
$ kubectl apply -f kubernetes/samples/scripts/elasticsearch_and_kibana.yaml
176+
helm delete --purge sample-weblogic-operator
150177
```
151-
* Remove the Traefik load balancer:
178+
b. Remove the operator's namespace:
152179

153180
```
154-
helm delete --purge
181+
$ kubectl delete namespace sample-weblogic-operator-ns
182+
```
183+
## 9. Remove the load balancer.
184+
a. Remove the Traefik load balancer:
185+
```
186+
helm delete --purge traefik-operator
155187
```
156-
* Remove the Traefik namespace:
188+
b. Remove the Traefik namespace:
157189

158190
```
159-
$ kubectl delete namespaces traefik
191+
$ kubectl delete namespace traefik
160192
```

0 commit comments

Comments
 (0)