Skip to content

Commit 6093790

Browse files
committed
OWLS-67335 Rework the 2.0 operator helm chart external REST config to look more like GA, OWLS-67336 Rework some of the 2.0 operator values.yaml create properties
1 parent 5b78ada commit 6093790

File tree

11 files changed

+248
-157
lines changed

11 files changed

+248
-157
lines changed

kubernetes/charts/weblogic-operator/templates/_inputs-utils.tpl

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ Verify that an input value of a specific kind has been specified.
2222
{{- define "operator.verifyInputKind" -}}
2323
{{- $requiredKind := index . 0 -}}
2424
{{- $scope := index . 1 -}}
25-
{{- $name := index . 2 -}}
26-
{{- if hasKey $scope $name -}}
27-
{{- $value := index $scope $name -}}
25+
{{- $parent := index . 2 -}}
26+
{{- $name := index . 3 -}}
27+
{{- if hasKey $parent $name -}}
28+
{{- $value := index $parent $name -}}
2829
{{- $actualKind := kindOf $value -}}
2930
{{- if eq $requiredKind $actualKind -}}
3031
true
@@ -72,10 +73,11 @@ Verify that an enum string input value has been specified
7273
*/}}
7374
{{- define "operator.verifyEnumInput" -}}
7475
{{- $scope := index . 0 -}}
75-
{{- $name := index . 1 -}}
76-
{{- $legalValues := index . 2 -}}
77-
{{- if include "operator.verifyStringInput" (list $scope $name) -}}
78-
{{- $value := index $scope $name -}}
76+
{{- $parent := index . 1 -}}
77+
{{- $name := index . 2 -}}
78+
{{- $legalValues := index . 3 -}}
79+
{{- if include "operator.verifyStringInput" (list $scope $parent $name) -}}
80+
{{- $value := index $parent $name -}}
7981
{{- if has $value $legalValues -}}
8082
true
8183
{{- else -}}

kubernetes/charts/weblogic-operator/templates/_operator-cm.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
apiVersion: "v1"
77
data:
88
internalOperatorCert: {{ .internalOperatorCert | quote }}
9-
{{- if .externalRestEnabled }}
9+
{{- if not (eq .externalRestOption "NONE") }}
1010
externalOperatorCert: {{ .externalOperatorCert | quote }}
1111
{{- end }}
1212
serviceaccount: {{ .operatorServiceAccount | quote }}
@@ -15,7 +15,7 @@ data:
1515
{{- if eq $len 0 -}}
1616
{{- $ignore := set $domainsNamespaces "default" (dict) -}}
1717
{{- end }}
18-
targetNamespaces: {{ keys $domainsNamespaces | join "," }}
18+
targetNamespaces: {{ keys $domainsNamespaces | sortAlpha | join "," }}
1919
kind: "ConfigMap"
2020
metadata:
2121
labels:

kubernetes/charts/weblogic-operator/templates/_operator-external-svc.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
33

44
{{- define "operator.operatorExternalService" }}
5-
{{- if (or .externalRestEnabled .remoteDebugNodePortEnabled) }}
5+
{{- if or (not (eq .externalRestOption "NONE")) .remoteDebugNodePortEnabled }}
66
---
77
apiVersion: "v1"
88
kind: "Service"
@@ -17,7 +17,7 @@ spec:
1717
selector:
1818
app: "weblogic-operator"
1919
ports:
20-
{{- if .externalRestEnabled }}
20+
{{- if not (eq .externalRestOption "NONE") }}
2121
- name: "rest"
2222
port: 8081
2323
nodePort: {{ .externalRestHttpsPort }}

kubernetes/charts/weblogic-operator/templates/_operator-ns.tpl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
33

44
{{- define "operator.operatorNamespace" }}
5-
{{- if (and (.createOperatorNamespace) (not (eq .operatorNamespace "default"))) }}
65
---
76
apiVersion: "v1"
87
kind: "Namespace"
@@ -12,4 +11,3 @@ metadata:
1211
weblogic.resourceVersion: "operator-v1"
1312
name: {{ .operatorNamespace | quote }}
1413
{{- end }}
15-
{{- end }}

kubernetes/charts/weblogic-operator/templates/_operator-secrets.yaml.tpl renamed to kubernetes/charts/weblogic-operator/templates/_operator-secret.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ apiVersion: "v1"
77
kind: "Secret"
88
data:
99
internalOperatorKey: {{ .internalOperatorKey | quote }}
10-
{{- if .externalRestEnabled }}
10+
{{- if not (eq .externalRestOption "NONE") }}
1111
externalOperatorKey: {{ .externalOperatorKey | quote }}
1212
{{- end }}
1313
metadata:

kubernetes/charts/weblogic-operator/templates/_validate-inputs.tpl

Lines changed: 40 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,58 @@
33

44
{{- define "operator.validateInputs" -}}
55
{{- $scope := . -}}
6-
{{- if include "operator.verifyBooleanInput" (list $scope "setupKubernetesCluster") -}}
6+
{{- if include "operator.verifyBooleanInput" (list $scope $scope "setupKubernetesCluster") -}}
77
{{- if $scope.setupKubernetesCluster }}
8-
{{- $ignore := include "operator.verifyBooleanInput" (list $scope "elkIntegrationEnabled") -}}
8+
{{- $ignore := include "operator.verifyBooleanInput" (list $scope $scope "elkIntegrationEnabled") -}}
99
{{- end }}
1010
{{- end }}
11-
{{- if include "operator.verifyBooleanInput" (list $scope "createOperator") -}}
11+
{{- if include "operator.verifyBooleanInput" (list $scope $scope "createOperator") -}}
1212
{{- if .createOperator }}
13-
{{- $ignore := include "operator.verifyBooleanInput" (list $scope "elkIntegrationEnabled") -}}
14-
{{- $ignore := include "operator.verifyBooleanInput" (list $scope "createOperatorNamespace") -}}
15-
{{- $ignore := include "operator.verifyStringInput" (list $scope "operatorNamespace") -}}
16-
{{- $ignore := include "operator.verifyStringInput" (list $scope "operatorServiceAccount") -}}
17-
{{- $ignore := include "operator.verifyStringInput" (list $scope "operatorImage") -}}
18-
{{- $ignore := include "operator.verifyEnumInput" (list $scope "operatorImagePullPolicy" (list "Always" "IfNotPresent" "Never")) -}}
19-
{{- $ignore := include "operator.verifyEnumInput" (list $scope "javaLoggingLevel" (list "SEVERE" "WARNING" "INFO" "CONFIG" "FINE" "FINER" "FINEST")) -}}
20-
{{- $ignore := include "operator.verifyStringInput" (list $scope "internalOperatorCert") -}}
21-
{{- $ignore := include "operator.verifyStringInput" (list $scope "internalOperatorKey") -}}
22-
{{- if include "operator.verifyBooleanInput" (list $scope "externalRestEnabled") -}}
23-
{{- if $scope.externalRestEnabled -}}
24-
{{- $ignore := include "operator.verifyIntegerInput" (list $scope "externalRestHttpsPort") -}}
25-
{{- $ignore := include "operator.verifyStringInput" (list $scope "externalOperatorCert") -}}
26-
{{- $ignore := include "operator.verifyStringInput" (list $scope "externalOperatorKey") -}}
13+
{{- $ignore := include "operator.verifyBooleanInput" (list $scope $scope "elkIntegrationEnabled") -}}
14+
{{- $ignore := include "operator.verifyStringInput" (list $scope $scope "operatorNamespace") -}}
15+
{{- $ignore := include "operator.verifyStringInput" (list $scope $scope "operatorServiceAccount") -}}
16+
{{- $ignore := include "operator.verifyStringInput" (list $scope $scope "operatorImage") -}}
17+
{{- $ignore := include "operator.verifyEnumInput" (list $scope $scope "operatorImagePullPolicy" (list "Always" "IfNotPresent" "Never")) -}}
18+
{{- $ignore := include "operator.verifyEnumInput" (list $scope $scope "javaLoggingLevel" (list "SEVERE" "WARNING" "INFO" "CONFIG" "FINE" "FINER" "FINEST")) -}}
19+
{{- $ignore := include "operator.verifyStringInput" (list $scope $scope "internalOperatorCert") -}}
20+
{{- $ignore := include "operator.verifyStringInput" (list $scope $scope "internalOperatorKey") -}}
21+
{{- if include "operator.verifyEnumInput" (list $scope $scope "externalRestOption" (list "NONE" "SELF_SIGNED_CERT" "CUSTOM_CERT")) -}}
22+
{{- if eq $scope.externalRestOption "SELF_SIGNED_CERT" -}}
23+
{{- $ignore := include "operator.verifyIntegerInput" (list $scope $scope "externalRestHttpsPort") -}}
24+
{{- $ignore := include "operator.verifyStringInput" (list $scope $scope "externalOperatorCertSans") -}}
25+
{{/* TBD - temporarily require the cert and key too until the operator runtime is updated to generate them */}}
26+
{{- $ignore := include "operator.verifyStringInput" (list $scope $scope "externalOperatorCert") -}}
27+
{{- $ignore := include "operator.verifyStringInput" (list $scope $scope "externalOperatorKey") -}}
28+
{{- end -}}
29+
{{- if eq $scope.externalRestOption "CUSTOM_CERT" -}}
30+
{{- $ignore := include "operator.verifyIntegerInput" (list $scope $scope "externalRestHttpsPort") -}}
31+
{{- $ignore := include "operator.verifyStringInput" (list $scope $scope "externalOperatorCert") -}}
32+
{{- $ignore := include "operator.verifyStringInput" (list $scope $scope "externalOperatorKey") -}}
33+
{{- end -}}
34+
{{- end -}}
35+
{{- if include "operator.verifyEnumInput" (list $scope $scope "internalRestOption" (list "SELF_SIGNED_CERT" "CUSTOM_CERT")) -}}
36+
{{- if eq $scope.internalRestOption "SELF_SIGNED_CERT" -}}
37+
{{/* TBD - temporarily require the cert and key too until the operator runtime is updated to generate them */}}
38+
{{- $ignore := include "operator.verifyStringInput" (list $scope $scope "internalOperatorCert") -}}
39+
{{- $ignore := include "operator.verifyStringInput" (list $scope $scope "internalOperatorKey") -}}
40+
{{- end -}}
41+
{{- if eq $scope.internalRestOption "CUSTOM_CERT" -}}
42+
{{- $ignore := include "operator.verifyStringInput" (list $scope $scope "internalOperatorCert") -}}
43+
{{- $ignore := include "operator.verifyStringInput" (list $scope $scope "internalOperatorKey") -}}
2744
{{- end -}}
2845
{{- end -}}
29-
{{- if include "operator.verifyBooleanInput" (list $scope "remoteDebugNodePortEnabled") -}}
46+
{{- if include "operator.verifyBooleanInput" (list $scope $scope "remoteDebugNodePortEnabled") -}}
3047
{{- if $scope.remoteDebugNodePortEnabled -}}
31-
{{- $ignore := include "operator.verifyIntegerInput" (list $scope "internalDebugHttpPort") -}}
32-
{{- $ignore := include "operator.verifyIntegerInput" (list $scope "externalDebugHttpPort") -}}
48+
{{- $ignore := include "operator.verifyIntegerInput" (list $scope $scope "internalDebugHttpPort") -}}
49+
{{- $ignore := include "operator.verifyIntegerInput" (list $scope $scope "externalDebugHttpPort") -}}
3350
{{- end -}}
3451
{{- end -}}
35-
{{- if include "operator.verifyObjectInput" (list $scope "domainsNamespaces") -}}
52+
{{- if include "operator.verifyObjectInput" (list $scope $scope "domainsNamespaces") -}}
3653
{{- $domainsNamespaces := $scope.domainsNamespaces -}}
3754
{{- range $key, $element := $domainsNamespaces -}}
38-
{{- if include "operator.verifyObjectInput" (list $domainsNamespaces $key) -}}
55+
{{- if include "operator.verifyObjectInput" (list $scope $domainsNamespaces $key) -}}
3956
{{- $s := merge (dict) $element $scope -}}
40-
{{- if include "operator.verifyBooleanInput" (list $s "createDomainsNamespace") -}}
57+
{{- if include "operator.verifyBooleanInput" (list $scope $s "createDomainsNamespace") -}}
4158
{{- if eq $key "default" -}}
4259
{{- if $s.createDomainsNamespace -}}
4360
{{- $errorMsg := cat "The effective createDomainsNamespace value for the 'default' domainsNamespace must be set to false." -}}

kubernetes/charts/weblogic-operator/values.yaml

Lines changed: 71 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@ setupKubernetesCluster: true
88
# createOperator specifies whether or not the installation should create the operator and its resources.
99
createOperator: true
1010

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.
14-
createOperatorNamespace: true
15-
1611
# operatorNamespace specifies the name of the Kubernetes namespace that the operator will be deployed in.
1712
# It is recommended that a namespace be created for the operator rather
1813
# than using the default namespace.
@@ -57,15 +52,83 @@ operatorImage: "weblogic-kubernetes-operator:1.0"
5752
# operatorImagePullPolicy specifies the image pull policy for the operator docker image.
5853
operatorImagePullPolicy: "IfNotPresent"
5954

60-
# externalRestEnabled specifies whether or not the operator externally exposes a REST https interface
61-
# (i.e. outside of the Kubernetes cluster).
62-
externalRestEnabled: false
55+
# Options for externally exposing the operator REST https interface
56+
# (i.e. outside of the Kubernetes cluster). Valid values are:
57+
#
58+
# "NONE"
59+
# The REST interface is not exposed outside the Kubernetes cluster.
60+
#
61+
# "SELF_SIGNED_CERT"
62+
# The REST interface is exposed outside of the Kubernetes cluster on the
63+
# port specified by the 'externalRestHttpsPort' property.
64+
# A self-signed certificate and private key are generated for the REST interface.
65+
# The certificate's subject alternative names are specified by the 'externalSans'
66+
# property.
67+
#
68+
# "CUSTOM_CERT"
69+
# The REST interface is exposed outside of the Kubernetes cluster on the
70+
# port specified by the 'externalRestHttpsPort' property.
71+
# The customer supplied certificate and private key are used for the REST
72+
# interface. They are specified by the 'externalOperatorCert' and
73+
# 'externalOperatorKey' properties.
74+
externalRestOption: NONE
6375

6476
# externalRestHttpsPort specifies the node port that should be allocated for the external operator REST https interface.
6577
# This parameter is required if 'externalRestEnabled' is 'true'.
6678
# Otherwise, it is ignored.
6779
externalRestHttpsPort: 31001
6880

81+
# The subject alternative names to put into the generated self-signed certificate
82+
# for the external WebLogic Operator REST https interface, for example:
83+
# DNS:myhost,DNS:localhost,IP:127.0.0.1
84+
# This parameter is required if 'externalRestOption' is 'SELF_SIGNED_CERT'.
85+
# Otherwise, it is ignored.
86+
#externalOperatorCertSans:
87+
88+
# The customer supplied certificate to use for the external operator REST
89+
# https interface. The value must be a string containing a base64 encoded PEM certificate.
90+
# This parameter is required if 'externalRestOption' is 'CUSTOM_CERT'.
91+
# Otherwise, it is ignored.
92+
#externalOperatorCert:
93+
94+
# The customer supplied private key to use for the external operator REST
95+
# https interface. The value must be a string containing a base64 encoded PEM key.
96+
# This parameter is required if 'externalRestOption' is 'CUSTOM_CERT'.
97+
# Otherwise, it is ignored.
98+
#externalOperatorKey:
99+
100+
# Options for the operator REST https interface inside the Kubernetes cluster.
101+
# Valid values are:
102+
#
103+
# "SELF_SIGNED_CERT"
104+
# A self-signed certificate and private key are generated for the internal REST interface.
105+
#
106+
# "CUSTOM_CERT"
107+
# The customer supplied certificate and private key are used for the REST
108+
# interface. They are specified by the 'internalOperatorCert' and
109+
# 'internalOperatorKey' properties.
110+
#
111+
internalRestOption: SELF_SIGNED_CERT
112+
113+
# The customer supplied certificate to use for the internal operator REST
114+
# https interface. The value must be a string containing a base64 encoded PEM certificate.
115+
# This parameter is required if 'internalRestOption' is 'CUSTOM_CERT'.
116+
# Otherwise, it is ignored.
117+
# Note: the customer must ensure that the certificate contains the following
118+
# subject alternative names:
119+
# DNS:internal-weblogic-operator-service
120+
# DNS:internal-weblogic-operator-service.OPERATOR_NAMESPACE
121+
# DNS:internal-weblogic-operator-service.OPERATOR_NAMESPACE.svc
122+
# DNS:internal-weblogic-operator-service.OPERATOR_NAMESPACE.svc.cluster.local"
123+
# where OPERTOR_NAMESPACE is the name of the operator's namespace.
124+
#internalOperatorCert:
125+
126+
# The customer supplied private key to use for the internal operator REST
127+
# https interface. The value must be a string containing a base64 encoded PEM key.
128+
# This parameter is required if 'internalRestOption' is 'CUSTOM_CERT'.
129+
# Otherwise, it is ignored.
130+
#internalOperatorKey:
131+
69132
# remoteDebugNodePortEnabled specifies whether or not the operator will start a Java remote debug server on the
70133
# provided port and suspend execution until a remote debugger has attached.
71134
# The 'internalDebugHttpPort' property controls the port number inside the Kubernetes

0 commit comments

Comments
 (0)