Skip to content

Commit bb1a944

Browse files
committed
Merge branch 'feature/helm_operator_1_1' of https://github.com/oracle/weblogic-kubernetes-operator into feature/helm_operator_1_1
2 parents 9e2522f + c6274a9 commit bb1a944

File tree

3 files changed

+180
-9
lines changed

3 files changed

+180
-9
lines changed
Lines changed: 79 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,93 @@
11
# Copyright 2018 Oracle Corporation and/or its affiliates. All rights reserved.
22
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
33

4+
# setupKubernetesCluster specifies whether or not the installation should deploy Kubernetes components
5+
# such as elasticsearch, kibana, operator RBAC roles, etc.
46
setupKubernetesCluster: true
7+
8+
# createOperator specifies whether or not the installation should create the operator and its resources.
59
createOperator: true
10+
11+
# createOperatorNamespace specifies whether or not the installation should create the Kubernetes
12+
# namespace that the operator will be deployed in. If createOperatorNamespace is false than the
13+
# namespace must exist before the operator can be installed.
614
createOperatorNamespace: true
7-
operatorNamespace: weblogic-operator
8-
operatorServiceAccount: weblogic-operator
15+
16+
# operatorNamespace specifies the name of the Kubernetes namespace that the operator will be deployed in.
17+
# It is recommended that a namespace be created for the operator rather
18+
# than using the default namespace.
19+
# The name must be lowercase
20+
operatorNamespace: "weblogic-operator"
21+
22+
# operatorServiceAccount specifies the name of the service account that the operator will use to
23+
# make requests to the Kubernetes API server.
24+
# The name must be lowercase
25+
operatorServiceAccount: "weblogic-operator"
26+
27+
# createDomainsNamespace is a global variable that specifies whether or not the helm installation should create the Kubernetes
28+
# namespaces for the domains specified in domainsNamespaces.
929
createDomainsNamespace: true
30+
31+
# domainsNamespaces specifies a map of WebLogic Domain namespaces which the operator manages (same as targetNamespaces but in map format)
32+
# The names must be lowercase
33+
#
34+
# Example 1: In the configuration below, the helm installation will create the Domain namespace 'namespace2' but not 'namespace1'.
35+
#
36+
# createDomainsNamespace: true
37+
# domainsNamespaces:
38+
# namespace1:
39+
# createDomainsNamespace: false
40+
# namespace2: {}
41+
#
42+
#-----------------------------------
43+
#
44+
# Example 2: In the configuration below, the helm installation will create the Domain namespace 'namespace2' but not 'namespace1'.
45+
#
46+
# createDomainsNamespace: false
47+
# domainsNamespaces:
48+
# namespace1: {}
49+
# namespace2:
50+
# createDomainsNamespace: true
51+
#
1052
domainsNamespaces: {}
11-
operatorImage: weblogic-kubernetes-operator:1.0
12-
operatorImagePullPolicy: IfNotPresent
13-
#internalOperatorCert: ...
14-
#internalOperatorKey: ...
53+
54+
# operatorImage specifies the docker image containing the operator code.
55+
operatorImage: "weblogic-kubernetes-operator:1.0"
56+
57+
# operatorImagePullPolicy specifies the image pull policy for the operator docker image.
58+
operatorImagePullPolicy: "IfNotPresent"
59+
60+
# externalRestEnabled specifies whether or not the operator externally exposes a REST https interface
61+
# (i.e. outside of the Kubernetes cluster).
1562
externalRestEnabled: false
63+
64+
# externalRestHttpsPort specifies the node port that should be allocated for the external operator REST https interface.
65+
# This parameter is required if 'externalRestEnabled' is 'true'.
66+
# Otherwise, it is ignored.
1667
externalRestHttpsPort: 31001
17-
#externalOperatorCert: ...
18-
#externalOperatorKey: ...
68+
69+
# remoteDebugNodePortEnabled specifies whether or not the operator will start a Java remote debug server on the
70+
# provided port and suspend execution until a remote debugger has attached.
71+
# The 'internalDebugHttpPort' property controls the port number inside the Kubernetes
72+
# cluster and the 'externalDebugHttpPort' property controls the port number outside
73+
# the Kubernetes cluster.
1974
remoteDebugNodePortEnabled: false
75+
76+
# internalDebugHttpPort specifes the port number inside the Kubernetes cluster for the operator's Java
77+
# remote debug server.
78+
# This parameter is required if 'remoteDebugNodePortEnabled' is true.
79+
# Otherwise, it is ignored.
2080
internalDebugHttpPort: 30999
81+
82+
# externalDebugHttpPort specifies the node port that should be allocated for the Kubernetes cluster for the operator's
83+
# Java remote debug server.
84+
# This parameter is required if 'remoteDebugNodePortEnabled' is true.
85+
# Otherwise, it is ignored.
2186
externalDebugHttpPort: 30999
22-
javaLoggingLevel: INFO
87+
88+
# javaLoggingLevel specifies the level of Java logging that should be enabled in the operator.
89+
# Valid values are: "SEVERE", "WARNING", "INFO", "CONFIG", "FINE", "FINER", and "FINEST".
90+
javaLoggingLevel: "INFO"
91+
92+
# elkIntegrationEnabled specifies whether or not ELK integration is enabled.
2393
elkIntegrationEnabled: false

kubernetes/internal/set-operator-certificate.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,14 @@ trap "cleanup" EXIT
3535
cert_data=`base64 -i ${cert_file} | tr -d '\n'`
3636
key_data=`base64 -i ${key_file} | tr -d '\n'`
3737

38+
echo "# ${prefix}OperatorCert specifies the certificate to use for the ${prefix} operator REST"
39+
echo "# Value is generated by the generate-${prefix}-weblogic-operator-certificate script."
3840
echo "${prefix}OperatorCert: ${cert_data}"
41+
echo ""
42+
43+
echo "# ${prefix}OperatorKey specifies the private key to use for the ${prefix} operator REST"
44+
echo "# Value is generated by the generate-${prefix}-weblogic-operator-certificate script."
3945
echo "${prefix}OperatorKey: ${key_data}"
46+
echo ""
4047

4148
succeeded=true

notes.txt

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
-----------------------------------------------------------------------------------------
2+
scenario
3+
-----------------------------------------------------------------------------------------
4+
5+
one operator, one domains (target) namespace, one domain
6+
7+
domain home in persistent storage
8+
9+
use all operator defaults
10+
11+
use all domain defaults
12+
13+
Kubernetes cluster run on a single node
14+
15+
-----------------------------------------------------------------------------------------
16+
setup
17+
-----------------------------------------------------------------------------------------
18+
19+
doublesync src122130 and devenv.sh
20+
(since we're going to use WLST to create the domain)
21+
22+
mkdir -m 777 -p /scratch/k8s_dir/domain1
23+
(i.e. the parent directory for persistent volumes)
24+
25+
make sure to get rid your old setup:
26+
(I had problems getting stuff to run until I got rid of this stuff)
27+
operator and domain namespaces
28+
persistent volumes
29+
cluster roles & cluster role bindings
30+
maybe /scratch/k8s_dir/domain1
31+
32+
install helm & tiller
33+
See https://github.com/kubernetes/helm/blob/master/docs/install.md
34+
35+
WebLogic Operator Docker image is installed in the docker repository as weblogic-kubernetes-operator:1.0
36+
37+
-----------------------------------------------------------------------------------------
38+
WebLogic Operator's Helm Chart values
39+
-----------------------------------------------------------------------------------------
40+
41+
The default Operator input values are defined in kubernetes/charts/weblogic-operator/values.yaml
42+
(similar to the Operator input file, create-weblogic-operator-inputs.yaml, used with the
43+
create-weblogic-operator.sh script)
44+
45+
-----------------------------------------------------------------------------------------
46+
To run the WebLogic Kubernetes Operator using helm
47+
-----------------------------------------------------------------------------------------
48+
49+
# Generate the SSL certificate and private key for the Operator's internal REST https interface
50+
> kubernetes/generate-internal-weblogic-operator-certificate.sh > values.yaml
51+
52+
# Optionally, if 'externalRestEnabled' is true, then generate the SSL certificate and private key for the
53+
# Operator's external REST https interface
54+
> kubernetes/generate-external-weblogic-operator-certificate.sh "DNS:${HOSTNAME},DNS:localhost,IP:127.0.0.1" >> values.yaml
55+
56+
# create a kubernetes secret holding that domain's admin credentials
57+
> kubectl -n default create secret generic domain1-weblogic-credentials --from-literal=username=weblogic --from-literal=password=welcome1
58+
59+
# Create and install the Operator's kubernetes resources and run the Operator via helm
60+
> helm install kubernetes/charts/weblogic-operator --name weblogic-operator --values values.yaml --wait
61+
62+
NOTE: The values.yaml file, supplied to the "helm install" command, is a user override file that contains values that
63+
override (or added) the values defined in the chart.
64+
65+
# Verify the WebLogic Operator is running
66+
> kubectl get po -n weblogic-operator
67+
68+
# Modify the create-weblogic-domain-inputs.yaml file with the following:
69+
70+
# Unique id identifying a domain.
71+
# This id must be lowercase and unique across all domains in a Kubernetes cluster.
72+
domainUID: domain1
73+
74+
# Type of WebLogic Cluster
75+
# Legal values are "CONFIGURED" or "DYNAMIC"
76+
clusterType: CONFIGURED
77+
78+
# Physical path of the domain's persistent storage.
79+
# The following line must be uncomment and customized:
80+
weblogicDomainStoragePath: /scratch/k8s_dir/domain1
81+
82+
# Use the scripts to install the WebLogic Domain on the persistent store and run kubernetes
83+
# pods for admin-server and managed-server's
84+
> cd kubernetes
85+
> ./create-weblogic-domain.sh -i create-weblogic-domain-inputs.yaml -o .
86+
87+
# Verify the admin-server and managed pods are running
88+
> kubectl get po
89+
90+
# Stop the admin-server and managed-server pods
91+
> kubectl delete -f weblogic-domains/domain1/domain-custom-resource.yaml
92+
93+
# Stop and delete Operator Kubernetes resources
94+
> helm delete --purge weblogic-operator

0 commit comments

Comments
 (0)