Skip to content

Commit 67f56ec

Browse files
authoredFeb 11, 2021
Update target vz to use OAM descriptors (#837)
* JIRA WDT-522 - First pass at changing to OAM descriptors * JIRA WDT-530 - Add domainHomeSourceType to resource file for -target vz output * JIRA WDT-522 - Use OAM descriptor for Verrazzano target * JIRA WDT-522 - Add runtime encryption secret to secret creation script * JIRA WDT-522 - Remove obsolete model template * JIRA WDT-522 - Minor corrections, backport changes to target wko * JIRA WDT-522 - Add runtime encryption secret to target wko; provide additional comment * JIRA WDT-522 - Minor corrections; allow multiple additional secrets * JIRA WDT-522 - Use domain UID for namespace for target wko * JIRA WDT-522 - Adjusted comment
1 parent f39389e commit 67f56ec

File tree

13 files changed

+309
-175
lines changed

13 files changed

+309
-175
lines changed
 

‎core/src/main/python/wlsdeploy/tool/util/k8s_helper.py

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright (c) 2020, Oracle Corporation and/or its affiliates.
2+
Copyright (c) 2020, 2021, Oracle and/or its affiliates.
33
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
44
55
Methods and constants for building Kubernetes resource files,
@@ -26,7 +26,16 @@ def get_domain_uid(domain_name):
2626
:param domain_name: the domain name to be checked
2727
:return: the domain UID
2828
"""
29-
result = domain_name.lower()
29+
return get_dns_name(domain_name)
30+
31+
32+
def get_dns_name(name):
33+
"""
34+
Return a DNS-1123 compatible name, with the pattern ^[a-z0-9-.]{1,253}$
35+
:param name: the domain name to be converted
36+
:return: the DNS-1123 compatible name
37+
"""
38+
result = name.lower()
3039
# replace any disallowed character with hyphen
3140
result = re.sub('[^a-z0-9-.]', '-', result)
3241
return result

‎core/src/main/python/wlsdeploy/tool/util/targets/additional_output_helper.py

+46-13
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
"""
2-
Copyright (c) 2020, Oracle Corporation and/or its affiliates.
2+
Copyright (c) 2020, 2021, Oracle and/or its affiliates.
33
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
44
55
Methods for creating Kubernetes resource configuration files for Verrazzano.
66
"""
77
from java.io import File
88

99
from wlsdeploy.aliases.location_context import LocationContext
10+
from wlsdeploy.aliases.model_constants import APPLICATION
1011
from wlsdeploy.aliases.model_constants import CLUSTER
1112
from wlsdeploy.aliases.model_constants import DEFAULT_WLS_DOMAIN_NAME
1213
from wlsdeploy.aliases.model_constants import JDBC_DRIVER_PARAMS
@@ -27,21 +28,27 @@
2728
# substitution keys used in the templates
2829
ADDITIONAL_SECRET_NAME = 'additionalSecretName'
2930
ADDITIONAL_SECRETS = 'additionalSecrets'
31+
APPLICATIONS = 'applications'
32+
APPLICATION_NAME = 'applicationName'
33+
APPLICATION_PREFIX = 'applicationPrefix'
3034
CLUSTER_NAME = 'clusterName'
3135
CLUSTERS = 'clusters'
32-
DATABASE_CREDENTIALS = 'databaseCredentials'
33-
DATABASE_PREFIX = 'databasePrefix'
34-
DATABASES = 'databases'
36+
DATASOURCE_CREDENTIALS = 'datasourceCredentials'
37+
DATASOURCE_PREFIX = 'datasourcePrefix'
38+
DATASOURCES = 'datasources'
3539
DATASOURCE_NAME = 'datasourceName'
40+
DATASOURCE_URL = 'url'
3641
DOMAIN_NAME = 'domainName'
3742
DOMAIN_PREFIX = 'domainPrefix'
3843
DOMAIN_TYPE = 'domainType'
3944
DOMAIN_UID = 'domainUid'
40-
DS_URL = 'url'
4145
HAS_ADDITIONAL_SECRETS = 'hasAdditionalSecrets'
46+
HAS_APPLICATIONS = 'hasApplications'
4247
HAS_CLUSTERS = 'hasClusters'
43-
HAS_DATABASES = 'hasDatabases'
48+
HAS_DATASOURCES = 'hasDatasources'
49+
NAMESPACE = 'namespace'
4450
REPLICAS = 'replicas'
51+
RUNTIME_ENCRYPTION_SECRET = "runtimeEncryptionSecret"
4552
WEBLOGIC_CREDENTIALS_SECRET = 'webLogicCredentialsSecret'
4653

4754

@@ -104,13 +111,14 @@ def _build_template_hash(model, model_context, aliases, credential_injector):
104111
domain_name = dictionary_utils.get_element(model.get_model_topology(), NAME)
105112
if domain_name is None:
106113
domain_name = DEFAULT_WLS_DOMAIN_NAME
114+
template_hash[DOMAIN_NAME] = domain_name
107115

108-
# domain UID, name and prefix must follow DNS-1123
116+
# domain UID, prefix, and namespace must follow DNS-1123
109117

110118
domain_uid = k8s_helper.get_domain_uid(domain_name)
111119
template_hash[DOMAIN_UID] = domain_uid
112-
template_hash[DOMAIN_NAME] = domain_uid
113120
template_hash[DOMAIN_PREFIX] = domain_uid
121+
template_hash[NAMESPACE] = domain_uid
114122

115123
# secrets that should not be included in secrets section
116124
declared_secrets = []
@@ -121,6 +129,12 @@ def _build_template_hash(model, model_context, aliases, credential_injector):
121129
declared_secrets.append(admin_secret)
122130
template_hash[WEBLOGIC_CREDENTIALS_SECRET] = admin_secret
123131

132+
# runtime encryption secret
133+
134+
runtime_secret = domain_uid + target_configuration_helper.RUNTIME_ENCRYPTION_SECRET_SUFFIX
135+
declared_secrets.append(runtime_secret)
136+
template_hash[RUNTIME_ENCRYPTION_SECRET] = runtime_secret
137+
124138
# configuration / model
125139
template_hash[DOMAIN_TYPE] = model_context.get_domain_type()
126140

@@ -159,20 +173,39 @@ def _build_template_hash(model, model_context, aliases, credential_injector):
159173
url = dictionary_utils.get_element(driver_params, URL)
160174
if url is None:
161175
url = ''
162-
database_hash[DS_URL] = url
176+
database_hash[DATASOURCE_URL] = url
163177

164178
# should change spaces to hyphens?
165-
database_hash[DATABASE_PREFIX] = jdbc_name.lower()
179+
database_hash[DATASOURCE_PREFIX] = k8s_helper.get_dns_name(jdbc_name)
166180

167181
# get the name that matches secret
168182
location.add_name_token(name_token, jdbc_name)
169183
secret_name = target_configuration_helper.get_secret_name_for_location(location, domain_uid, aliases)
170-
database_hash[DATABASE_CREDENTIALS] = secret_name
184+
database_hash[DATASOURCE_CREDENTIALS] = secret_name
171185

172186
databases.append(database_hash)
173187

174-
template_hash[DATABASES] = databases
175-
template_hash[HAS_DATABASES] = len(databases) != 0
188+
template_hash[DATASOURCES] = databases
189+
template_hash[HAS_DATASOURCES] = len(databases) != 0
190+
191+
# applications
192+
193+
apps = []
194+
195+
applications = dictionary_utils.get_dictionary_element(model.get_model_app_deployments(), APPLICATION)
196+
for app_name in applications:
197+
app_hash = dict()
198+
prefix = '/' + app_name
199+
200+
# get the prefix from the app descriptor?
201+
202+
app_hash[APPLICATION_NAME] = app_name
203+
app_hash[APPLICATION_PREFIX] = prefix
204+
205+
apps.append(app_hash)
206+
207+
template_hash[APPLICATIONS] = apps
208+
template_hash[HAS_APPLICATIONS] = len(apps) != 0
176209

177210
# additional secrets - exclude admin
178211

‎core/src/main/python/wlsdeploy/tool/util/targets/file_template_helper.py

+60-50
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright (c) 2020, Oracle Corporation and/or its affiliates.
2+
Copyright (c) 2020, 2021 Oracle Corporation and/or its affiliates.
33
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
44
55
Methods for template substitution.
@@ -41,7 +41,7 @@ def create_file_from_resource(resource_path, template_hash, output_file, excepti
4141
__logger.throwing(ex, class_name=__class_name, method_name=_method_name)
4242
raise ex
4343

44-
_create_file_from_stream(template_stream, template_hash, output_file, exception_type)
44+
_create_file_from_stream(template_stream, template_hash, output_file)
4545

4646

4747
def create_file_from_file(file_path, template_hash, output_file, exception_type):
@@ -58,49 +58,87 @@ def create_file_from_file(file_path, template_hash, output_file, exception_type)
5858
try:
5959
template_stream = FileUtils.getFileAsStream(file_path)
6060
if template_stream is not None:
61-
_create_file_from_stream(template_stream, template_hash, output_file, exception_type)
61+
_create_file_from_stream(template_stream, template_hash, output_file)
6262
except (IOException, IllegalArgumentException), ie:
6363
ex = exception_helper.create_exception(exception_type, 'WLSDPLY-01666', file_path, ie)
6464
__logger.throwing(ex, class_name=__class_name, method_name=_method_name)
6565
raise ex
6666

6767

68-
def _create_file_from_stream(template_stream, template_hash, output_file, exception_type):
68+
def _create_file_from_stream(template_stream, template_hash, output_file):
6969
template_reader = BufferedReader(InputStreamReader(template_stream))
7070
file_writer = open(output_file.getPath(), "w")
7171

72-
current_block_key = None
72+
block_key = None
7373
block_lines = []
7474

75-
more = True
76-
while more:
75+
line = ''
76+
while line is not None:
7777
line = template_reader.readLine()
7878
if line is not None:
7979
block_start_key = _get_block_start_key(line)
80-
block_end_key = _get_block_end_key(line)
8180

82-
# if this is a nested block start, continue and add without substitution
83-
if (block_start_key is not None) and (current_block_key is None):
84-
current_block_key = block_start_key
85-
block_lines = []
81+
# if inside a block, collect lines until end key is found, then process the block.
82+
if block_key is not None:
83+
block_end_key = _get_block_end_key(line)
84+
if block_end_key == block_key:
85+
_process_block(block_key, block_lines, template_hash, file_writer)
86+
block_key = None
87+
else:
88+
block_lines.append(line)
8689

87-
# if this is a nested block end, continue and add without substitution
88-
elif (block_end_key == current_block_key) and (current_block_key is not None):
89-
_write_block(current_block_key, block_lines, template_hash, file_writer)
90-
current_block_key = None
90+
# if this is a block start, begin collecting block lines
91+
elif block_start_key is not None:
92+
block_key = block_start_key
93+
block_lines = []
9194

95+
# otherwise, substitute and write the line
9296
else:
9397
line = _substitute_line(line, template_hash)
98+
file_writer.write(line + "\n")
9499

95-
if current_block_key is not None:
96-
block_lines.append(line)
100+
file_writer.close()
101+
102+
103+
def _process_block(block_key, template_lines, template_hash, file_writer):
104+
value = dictionary_utils.get_element(template_hash, block_key)
105+
106+
if value is None:
107+
return
108+
109+
if not isinstance(value, list):
110+
value = [value]
111+
112+
for list_element in value:
113+
nested_block_key = None
114+
nested_block_lines = []
115+
116+
for line in template_lines:
117+
block_start_key = _get_block_start_key(line)
118+
119+
# if inside a block, collect lines until end key is found,
120+
# then process the block with an updated hash.
121+
if nested_block_key is not None:
122+
block_end_key = _get_block_end_key(line)
123+
if block_end_key == nested_block_key:
124+
nested_hash = dict(template_hash)
125+
if isinstance(list_element, dict):
126+
nested_hash.update(list_element)
127+
_process_block(nested_block_key, nested_block_lines, nested_hash, file_writer)
128+
nested_block_key = None
97129
else:
98-
file_writer.write(line + "\n")
130+
nested_block_lines.append(line)
99131

100-
else:
101-
more = False
132+
# if this is a block start, begin collecting block lines
133+
elif block_start_key is not None:
134+
nested_block_key = block_start_key
135+
nested_block_lines = []
102136

103-
file_writer.close()
137+
# otherwise, substitute and write the line
138+
else:
139+
if isinstance(list_element, dict):
140+
line = _substitute_line(line, list_element)
141+
file_writer.write(line + "\n")
104142

105143

106144
def _get_block_start_key(line):
@@ -142,31 +180,3 @@ def _substitute_line(line, template_hash):
142180
if replacement is not None:
143181
line = line.replace(token, replacement)
144182
return line
145-
146-
147-
def _write_block(key, lines, template_hash, file_writer):
148-
"""
149-
Write a block of lines to the file writer, making substitutions as necessary.
150-
This method does not currently handle nested blocks.
151-
:param key: the key of this block
152-
:param lines: the lines to be output
153-
:param template_hash: the parent hash
154-
:param file_writer: to write the output
155-
"""
156-
value = dictionary_utils.get_element(template_hash, key)
157-
158-
# skip block for value of False, None, or empty collection
159-
if not value:
160-
return
161-
162-
# if value is not a list, make it a list with one item
163-
if not isinstance(value, list):
164-
value = [value]
165-
166-
for list_element in value:
167-
for line in lines:
168-
# this does not account for nested blocks
169-
170-
if isinstance(list_element, dict):
171-
line = _substitute_line(line, list_element)
172-
file_writer.write(line + "\n")

‎core/src/main/python/wlsdeploy/util/target_configuration.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright (c) 2020, Oracle Corporation and/or its affiliates.
2+
Copyright (c) 2020, 2021, Oracle and/or its affiliates.
33
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
44
"""
55

@@ -84,6 +84,16 @@ def get_variable_injectors(self):
8484
"""
8585
return dictionary_utils.get_dictionary_element(self.config_dictionary, 'variable_injectors')
8686

87+
def get_additional_secrets(self):
88+
"""
89+
Return a list of secrets to be included in the create secrets script.
90+
:return: a list of secrets
91+
"""
92+
secrets = dictionary_utils.get_element(self.config_dictionary, 'additional_secrets')
93+
if secrets is not None:
94+
return secrets.split(',')
95+
return []
96+
8797
def uses_credential_secrets(self):
8898
"""
8999
Determine if this configuration uses secrets to manage credentials.

‎core/src/main/python/wlsdeploy/util/target_configuration_helper.py

+17-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2020, Oracle Corporation and/or its affiliates.
1+
# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
22
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33
#
44
# Shared methods for using target environments (-target abc).
@@ -30,6 +30,9 @@
3030
WEBLOGIC_CREDENTIALS_SECRET_NAME = 'weblogic-credentials'
3131
WEBLOGIC_CREDENTIALS_SECRET_SUFFIX = '-' + WEBLOGIC_CREDENTIALS_SECRET_NAME
3232

33+
RUNTIME_ENCRYPTION_SECRET_NAME = 'runtime-encryption-secret'
34+
RUNTIME_ENCRYPTION_SECRET_SUFFIX = '-' + RUNTIME_ENCRYPTION_SECRET_NAME
35+
3336
# keys for secrets, such as "password" in "jdbc-mydatasource:password"
3437
SECRET_USERNAME_KEY = "username"
3538
SECRET_PASSWORD_KEY = "password"
@@ -108,7 +111,7 @@ def generate_k8s_script(model_context, token_dictionary, model_dictionary, excep
108111

109112
domain_uid = k8s_helper.get_domain_uid(domain_name)
110113
comment = exception_helper.get_message("WLSDPLY-01665")
111-
script_hash = {'domainUid': domain_uid, 'topComment': comment}
114+
script_hash = {'domainUid': domain_uid, 'topComment': comment, 'namespace': domain_uid}
112115

113116
# build a map of secret names (jdbc-generic1) to keys (username, password)
114117
secret_map = {}
@@ -142,6 +145,16 @@ def generate_k8s_script(model_context, token_dictionary, model_dictionary, excep
142145
else:
143146
paired_secrets.append(_build_secret_hash(secret_name, user_name, PASSWORD_TAG))
144147

148+
# add a secret with a specific comment for runtime encryption
149+
target_config = model_context.get_target_configuration()
150+
additional_secrets = target_config.get_additional_secrets()
151+
if RUNTIME_ENCRYPTION_SECRET_NAME in additional_secrets:
152+
runtime_hash = _build_secret_hash(RUNTIME_ENCRYPTION_SECRET_NAME, None, PASSWORD_TAG)
153+
message1 = exception_helper.get_message("WLSDPLY-01671", PASSWORD_TAG)
154+
message2 = exception_helper.get_message("WLSDPLY-01672")
155+
runtime_hash['comments'] = [{'comment': message1}, {'comment': message2}]
156+
secrets.append(runtime_hash)
157+
145158
script_hash['secrets'] = secrets
146159
script_hash['pairedSecrets'] = paired_secrets
147160
script_hash['longMessage'] = exception_helper.get_message('WLSDPLY-01667', '${LONG_SECRETS_COUNT}')
@@ -272,7 +285,7 @@ def _build_secret_hash(secret_name, user, password):
272285
"""
273286
if user:
274287
message = exception_helper.get_message("WLSDPLY-01664", USER_TAG, PASSWORD_TAG, secret_name)
275-
return {'secretName': secret_name, 'user': user, 'password': password, 'comment': message}
288+
return {'secretName': secret_name, 'user': user, 'password': password, 'comments': [{'comment': message}]}
276289
else:
277290
message = exception_helper.get_message("WLSDPLY-01663", PASSWORD_TAG, secret_name)
278-
return {'secretName': secret_name, 'password': password, 'comment': message}
291+
return {'secretName': secret_name, 'password': password, 'comments': [{'comment': message}]}

‎core/src/main/resources/oracle/weblogic/deploy/k8s/create_k8s_secrets.sh

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -eu
44

55
# {{{topComment}}}
6-
NAMESPACE=default
6+
NAMESPACE={{{namespace}}}
77
DOMAIN_UID={{{domainUid}}}
88

99
LONG_SECRETS=()
@@ -31,12 +31,16 @@ function create_paired_k8s_secret {
3131
}
3232
{{#pairedSecrets}}
3333

34+
{{#comments}}
3435
# {{{comment}}}
36+
{{/comments}}
3537
create_paired_k8s_secret {{{secretName}}} {{{user}}} {{{password}}}
3638
{{/pairedSecrets}}
3739
{{#secrets}}
3840

41+
{{#comments}}
3942
# {{{comment}}}
43+
{{/comments}}
4044
create_k8s_secret {{{secretName}}} {{{password}}}
4145
{{/secrets}}
4246

‎core/src/main/resources/oracle/weblogic/deploy/messages/wlsdeploy_rb.properties

+2
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,8 @@ WLSDPLY-01667=WARNING: These {0} secret names are too long to be mounted in a Ku
307307
WLSDPLY-01668=Secret names to be mounted in a Kubernetes pod should be limited to 63 characters.
308308
WLSDPLY-01669=To correct this, shorten the DOMAIN_UID or the secret key(s) in this generated script and re-execute.
309309
WLSDPLY-01670=Update the corresponding secret references in the WDT model(s) to match these values before deployment.
310+
WLSDPLY-01671=Update {0} used to encrypt model and domain hashes
311+
WLSDPLY-01672=This secret is only required for model-in-image deployments
310312

311313
# wlsdeploy/util/enum.py
312314
WLSDPLY-01700=The value {0} is not a valid value of the Enum type {1}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
2+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
3+
4+
apiVersion: core.oam.dev/v1alpha2
5+
kind: ApplicationConfiguration
6+
metadata:
7+
name: {{{domainPrefix}}}-appconf
8+
namespace: {{{namespace}}}
9+
annotations:
10+
version: v1.0.0
11+
description: "{{{domainName}}} application configuration"
12+
spec:
13+
components:
14+
- componentName: {{{domainPrefix}}}-domain
15+
traits:
16+
- trait:
17+
apiVersion: oam.verrazzano.io/v1alpha1
18+
kind: MetricsTrait
19+
spec:
20+
scraper: verrazzano-system/vmi-system-prometheus-0
21+
- trait:
22+
apiVersion: oam.verrazzano.io/v1alpha1
23+
kind: IngressTrait
24+
spec:
25+
rules:
26+
- hosts:
27+
- "{{{domainPrefix}}}-appconf.{{{domainUid}}}.example.com"
28+
{{#hasApplications}}
29+
paths:
30+
{{/hasApplications}}
31+
{{#applications}}
32+
# application {{{applicationName}}}
33+
- path: "{{{applicationPrefix}}}"
34+
pathType: Prefix
35+
{{/applications}}
36+
- componentName: {{{domainPrefix}}}-configmap
37+
---
38+
apiVersion: core.oam.dev/v1alpha2
39+
kind: Component
40+
metadata:
41+
name: {{{domainPrefix}}}-domain
42+
namespace: {{{namespace}}}
43+
spec:
44+
workload:
45+
apiVersion: weblogic.oracle/v8
46+
kind: Domain
47+
metadata:
48+
name: {{{domainPrefix}}}-domain
49+
namespace: {{{namespace}}}
50+
spec:
51+
domainUID: {{{domainUid}}}
52+
53+
# WebLogic Image Tool provides domainHome, domainHomeSourceType, and imageName
54+
domainHome: {{{domainHome}}}
55+
domainHomeSourceType: {{{domainHomeSourceType}}}
56+
image: {{{imageName}}}
57+
58+
imagePullSecrets:
59+
- name: {{{domainPrefix}}}-registry-credentials
60+
logHomeEnabled: true
61+
includeServerOutInPodLog: true
62+
webLogicCredentialsSecret:
63+
name: {{{webLogicCredentialsSecret}}}
64+
configuration:
65+
istio:
66+
enabled: false
67+
introspectorJobActiveDeadlineSeconds: 900
68+
model:
69+
configMap: {{{domainPrefix}}}-configmap
70+
domainType: {{{domainType}}}
71+
72+
# WebLogic Image Tool provides modelHome
73+
modelHome: {{{modelHome}}}
74+
75+
# encryption for the WDT model and the SystemSerializedIni.data file.
76+
# used only for model-in-image deployment, can be removed for other types.
77+
runtimeEncryptionSecret: {{{runtimeEncryptionSecret}}}
78+
{{#hasAdditionalSecrets}}
79+
80+
secrets:
81+
{{/hasAdditionalSecrets}}
82+
{{#additionalSecrets}}
83+
- {{{additionalSecretName}}}
84+
{{/additionalSecrets}}
85+
{{#hasClusters}}
86+
87+
clusters:
88+
{{/hasClusters}}
89+
{{#clusters}}
90+
- clusterName: {{{clusterName}}}
91+
serverPod:
92+
affinity:
93+
podAntiAffinity:
94+
preferredDuringSchedulingIgnoredDuringExecution:
95+
- weight: 100
96+
podAffinityTerm:
97+
labelSelector:
98+
matchExpressions:
99+
- key: "weblogic.clusterName"
100+
operator: In
101+
values:
102+
- $(CLUSTER_NAME)
103+
topologyKey: "kubernetes.io/hostname"
104+
replicas: {{{replicas}}}
105+
{{/clusters}}
106+
107+
serverPod:
108+
env:
109+
- name: JAVA_OPTIONS
110+
value: "-Dweblogic.StdoutDebugEnabled=false"
111+
- name: USER_MEM_ARGS
112+
value: "-Djava.security.egd=file:/dev/./urandom -Xms64m -Xmx256m "
113+
---
114+
apiVersion: core.oam.dev/v1alpha2
115+
kind: Component
116+
metadata:
117+
name: {{{domainPrefix}}}-configmap
118+
namespace: {{{namespace}}}
119+
spec:
120+
workload:
121+
apiVersion: v1
122+
kind: ConfigMap
123+
metadata:
124+
name: {{{domainPrefix}}}-configmap
125+
namespace: {{{namespace}}}
126+
data:
127+
{{#hasDatasources}}
128+
wdt_jdbc.yaml: |
129+
resources:
130+
JDBCSystemResource:
131+
{{/hasDatasources}}
132+
{{#datasources}}
133+
'{{{datasourceName}}}':
134+
JdbcResource:
135+
JDBCDriverParams:
136+
# This is the URL of the database used by the WebLogic Server application
137+
URL: "{{{url}}}"
138+
{{/datasources}}

‎core/src/main/targetconfigs/vz/binding.yaml

-27
This file was deleted.

‎core/src/main/targetconfigs/vz/model.yaml

-75
This file was deleted.

‎core/src/main/targetconfigs/vz/target.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@
88
"validation_method" : "lax",
99
"credentials_method" : "secrets",
1010
"wls_credentials_name" : "__weblogic-credentials__",
11-
"additional_output" : "binding.yaml,model.yaml"
11+
"additional_secrets": "runtime-encryption-secret",
12+
"additional_output" : "application.yaml"
1213
}

‎core/src/main/targetconfigs/wko/model.yaml

+16-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
2+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
3+
14
apiVersion: "weblogic.oracle/v8"
25
kind: Domain
36
metadata:
47
name: {{{domainUid}}}
5-
namespace: default
8+
namespace: {{{namespace}}}
69
labels:
710
weblogic.domainUID: {{{domainUid}}}
811
spec:
@@ -60,6 +63,18 @@ spec:
6063
{{/clusters}}
6164

6265
configuration:
66+
istio:
67+
enabled: false
68+
introspectorJobActiveDeadlineSeconds: 900
69+
model:
70+
domainType: {{{domainType}}}
71+
72+
# WebLogic Image Tool provides modelHome
73+
modelHome: {{{modelHome}}}
74+
75+
# encryption for the WDT model and the SystemSerializedIni.data file.
76+
# used only for model-in-image deployment, can be removed for other types.
77+
runtimeEncryptionSecret: {{{runtimeEncryptionSecret}}}
6378
{{#hasAdditionalSecrets}}
6479

6580
# Secrets that are referenced by model yaml macros

‎core/src/main/targetconfigs/wko/target.json

+1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@
88
"validation_method" : "lax",
99
"credentials_method" : "secrets",
1010
"wls_credentials_name" : "__weblogic-credentials__",
11+
"additional_secrets": "runtime-encryption-secret",
1112
"additional_output" : "model.yaml"
1213
}

0 commit comments

Comments
 (0)
Please sign in to comment.