Skip to content

Operator version 2.4.0 #1333

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

Merged
merged 88 commits into from
Nov 16, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
496c61e
Merge remote-tracking branch 'origin/master' into develop
rjeberhard Aug 27, 2019
3bbb081
Rebuilt charts
rjeberhard Aug 27, 2019
cd98a83
OWLS-76347 New sample scripts to manage DB service and RCU Schema (#1…
anpanigr Aug 28, 2019
218331d
eliminate duplication logger creation (#1225)
russgold Aug 28, 2019
8a59a34
merge 1241 into develop
markxnelson Sep 5, 2019
dd0a017
QUICKTEST and FULLTEST categorization (#1237)
vanajamukkara Sep 5, 2019
e9af543
OWLS-74959 - Validate FMW Infrastructure uses configured clusters in …
alai8 Sep 5, 2019
a03411c
Integration tests should take the env variable for WDT version to dow…
vanajamukkara Sep 5, 2019
2a3dede
Merge remote-tracking branch 'origin/master' into develop
rjeberhard Sep 6, 2019
a38a7f6
Prepare for operator 2.3.1
rjeberhard Sep 6, 2019
eb697c5
Revert "eliminate duplication logger creation (#1225)"
rjeberhard Sep 6, 2019
5519d38
WIP Added test to cover weblogicLoggingExporterFilters (#1211)
hzhao-github Sep 6, 2019
51df62e
Resolve CheckStyle issues
rjeberhard Sep 6, 2019
de13128
merge 1246 changes from master
markxnelson Sep 10, 2019
e97d674
Merge remote-tracking branch 'origin/master' into develop
rjeberhard Sep 10, 2019
2db3d5e
Move to Kubernetes Java Client 6.0.1 (#1249)
rjeberhard Sep 10, 2019
bc20fa6
Update domain status on Unprocessable Error (#1250)
russgold Sep 11, 2019
6924d13
OWLS-76624 (Resolves #1228) - Introspector pod not picking up the con…
alai8 Sep 11, 2019
12ee4e1
CheckStyle corrections
rjeberhard Sep 12, 2019
438d8c6
K8s service account (#1235)
alan-cao Sep 13, 2019
ef9c885
OWLS-73891 part 1: update warning messages and fix a helm upgrade iss…
doxiao Sep 13, 2019
5a5508d
Add REST resource annotion to ignore unknown properties (#1255)
TheFrogPad Sep 13, 2019
4a3710e
Simplify WaitForReadyStep (#1256)
russgold Sep 13, 2019
eca97a7
OWLS-76720 (Resolves #1198) - Fixes missing valueFrom envVar values (…
alai8 Sep 13, 2019
95cb9d8
Fix Javadoc and CheckStyle
rjeberhard Sep 13, 2019
983c7d6
Revert pod watcher refactoring
rjeberhard Sep 13, 2019
fdea108
merge 1258 into develop
markxnelson Sep 19, 2019
5d35bed
OWLS-76780 : Modify FMW (domain-in-image) sample to support Restricte…
anpanigr Sep 23, 2019
b1673f7
OWLS-76806 (Resolves #1231) - scripts such as livenessProbe.sh should…
alai8 Sep 23, 2019
dca085f
Reduced execution time, added support to execute against different ve…
marinakog Sep 23, 2019
a6b312e
WDT version 1.4.0 (#1267)
rjeberhard Sep 25, 2019
f937db3
OWLS-76949 added support for exposeAdminT3Channel in FMWDomain in dom…
anpanigr Sep 25, 2019
f30c42f
merge 1268 from master
markxnelson Sep 26, 2019
afb5c98
typo
markxnelson Sep 26, 2019
d706e37
Modify sample scripts for RCU and DB Creation (#1238)
anpanigr Sep 26, 2019
9e3d8fa
Soa 2.2.1 (#1243)
sbattagi Sep 26, 2019
744234d
enable checkstyle on test sources (#1270)
ddsharpe Sep 27, 2019
0ebdff1
Update license format (#1272)
rjeberhard Sep 27, 2019
99cdb25
fix typo in License.txt - matches https://oss.oracle.com/licenses/upl…
ddsharpe Sep 27, 2019
d7471ca
OWLS-69370: Introspect: Domain-in-Image: Add data home override suppo…
lennyphan Sep 30, 2019
8b46f0c
OWLS-73891 part2 - clean up stale states about introspector jobs and …
doxiao Sep 30, 2019
e4d20d2
Retry and wait between retries of failed downloads jenkins-ignore (#1…
hzhao-github Sep 30, 2019
d71f205
add note to advise against using console for starting and stopping s…
rosemarymarano Sep 26, 2019
5a65c71
Revert "OWLS-73891 part2 - clean up stale states about introspector j…
rjeberhard Sep 30, 2019
e8d1de9
Fix CheckStyle
rjeberhard Sep 30, 2019
1fd4891
Add instructions to configure fluentd to export domain logs to ELK (#…
mgianatagh Oct 2, 2019
8cf7f28
fix Managed coherence test (#1279)
bhavaniravichandran Oct 2, 2019
fd41dc4
run integration test in openshift (#1280)
bhavaniravichandran Oct 3, 2019
845c85f
merge 1285 from master
markxnelson Oct 3, 2019
e16f5b0
merge 1282 from master
markxnelson Oct 3, 2019
27a82a6
PR: owls-77057 fix nightly full test failure for changing image test …
maggiehe00 Oct 3, 2019
84a06b3
Added container name when copying archive files jenkins-ignore (#1288)
hzhao-github Oct 4, 2019
2b3b19e
merge 1291 from master
markxnelson Oct 7, 2019
3d0698a
OWLS-76832 (Resolves #1232) - Error using variable in pod template if…
alai8 Oct 8, 2019
b5cb5f4
fix merge conflicts
markxnelson Oct 8, 2019
35905b5
merge 1292 from master
markxnelson Oct 8, 2019
927fccc
OWLS-73891 part3 - add FAQ entry for managing namespaces (#1264)
doxiao Oct 8, 2019
7ebb63a
Simplify WaitForReady step (#1277)
russgold Oct 8, 2019
5337c25
Modified rcu script to support both SOA and FMWInfra Domain (#1290)
anpanigr Oct 8, 2019
a369051
Add SOA user doc (#1229)
rosemarymarano Oct 9, 2019
6eb68ea
Add SOA sample doc (#1234)
rosemarymarano Oct 9, 2019
78cba2f
add soa preview warnings
markxnelson Oct 9, 2019
c19cc45
updates to soa doc based on end to end review/test
markxnelson Oct 9, 2019
9130e60
merge 1295 from master
markxnelson Oct 9, 2019
40ba6e5
Owls 73891 retry (#1283)
russgold Oct 10, 2019
43cc236
merge 1296 from master
markxnelson Oct 14, 2019
a3d8479
merge 1299 from master
markxnelson Oct 21, 2019
72abaaf
PR: Create JRF domain using create-rcu-schema sample (#1274)
maggiehe00 Oct 22, 2019
20b9c4e
OWLS-77432 : add new rcuType Parameter (#1298)
anpanigr Oct 22, 2019
2669d89
Switched from latest grafana to 3.12.0 version of helm chart due synt…
marinakog Oct 24, 2019
cd31c49
PR: Fix Jrf quicktest suite issue (#1314)
maggiehe00 Oct 30, 2019
ab8f5e2
PR: Owls76920 change JRF domain class name starting with It (#1320)
maggiehe00 Nov 1, 2019
4802e3e
fix typo in create-domain script
markxnelson Oct 22, 2019
8bcd9a3
Add a note to the quickstart about variations between k8s versions
markxnelson Oct 30, 2019
f2df6e4
OWLS-76689 - SOA:ADMINSERVER TAKING TIME TO RESTART USING SERVERSTART…
alai8 Nov 1, 2019
50c9af2
OWLS-77556: replace complete env dump in pods/job with curated listin…
Nov 7, 2019
3092020
Javadoc for 2.3.1
rjeberhard Nov 15, 2019
034b510
Domain version v6
rjeberhard Nov 15, 2019
8af61eb
Deploy tooling 1.6.0
rjeberhard Nov 15, 2019
3ccf110
Merge remote-tracking branch 'origin/master' into develop
rjeberhard Nov 15, 2019
5887a5e
Helm chart updates
rjeberhard Nov 15, 2019
0997fb1
ensure that domain directory exists (#1324)
ddsharpe Nov 15, 2019
04c880e
Merge remote-tracking branch 'origin/domain-v6' into develop
rjeberhard Nov 15, 2019
6008acd
Merge remote-tracking branch 'origin/wdt-1.6.0' into develop
rjeberhard Nov 15, 2019
4196b8a
SOA related changes for operator 2.3.0 (#1305)
sbattagi Nov 15, 2019
0300aa1
Move to 2.4.0
rjeberhard Nov 15, 2019
d9f9cbe
Prepare file permissions on persistent volume using an init container…
rjeberhard Nov 15, 2019
a3ca5cb
Revert changes to archives
rjeberhard Nov 16, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
OWLS-76832 (Resolves #1232) - Error using variable in pod template if…
… value has underscore (#1286)

* convert substituted variables to DNS1123 if used as names

* only convert variables for selected, customizable list of fields

* checkstyle fixes

* add dns1123Fields to helm chart to override default list of field names that requires dns-1123 values

* document dns1123fields

* dns1123Names values no longer case sensitive

* minor cleanup

* doc update base on feedback
  • Loading branch information
alai8 authored and markxnelson committed Oct 8, 2019
commit 3d0698a21cd05fc16abdaf9b543c3ccc57ca30ff
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,27 @@ These examples show two valid YAML syntax options for arrays.
You must include the `default` namespace in the list if you want the operator to monitor both the `default` namespace and some other namespaces.
{{% /notice %}}

##### `dns1123Fields`

When the operator processes variable references in the domain resource, such as `$(SERVER_NAME)`,
it will convert them into DNS-1123 legal values if the variables are referenced
in fields that require their values to be conforming to DNS-1123. A default list of such field
names can be found inside the class `Legalnames`
in the `oracle.kubernetes.operator.helpers package`.
For example, a value `$(SERVER_NAME)-volume` is specified in a field in a domain resource that
requires DNS-1123. Suppose the name of the server is `managed_server1` which contains an illegal
underscore character. Upon variable substitution, the operator will replace it with a hyphen, and
the resulting value will become `managed-server1-volume`.

A comma separated list of field names can be supplied in `dns1123Fields` to customize the list of
field names, or it can be left commented out to use the default list of field names.

This property is optional.

Example:
```
dns1123Fields: "name, claimName, volumeName"
```
#### Elastic Stack integration

##### `elkIntegrationEnabled`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ data:
{{- end }}
serviceaccount: {{ .serviceAccount | quote }}
targetNamespaces: {{ .domainNamespaces | uniq | sortAlpha | join "," | quote }}
{{- if .dns1123Fields }}
dns1123Fields: {{ .dns1123Fields | quote }}
{{- end }}
kind: "ConfigMap"
metadata:
labels:
Expand Down
11 changes: 10 additions & 1 deletion kubernetes/charts/weblogic-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,15 @@ elasticSearchHost: "elasticsearch.default.svc.cluster.local"
# This parameter is ignored if 'elkIntegrationEnabled' is false.
elasticSearchPort: 9200

# dns1123Fields overrides the default list of field names that the operator
# converts to DNS-1123 legal values when replacing variable references in the
# domain resource. The default list can be found inside the class Legalnames
# in the oracle.kubernetes.operator.helpers package.
# Supply a comma seperated list of field names to customize the list of fields
# such as "name, claimName, volumeName", or leave it commented out to use
# the default list of field names.
# dns1123Fields: ""

# Istio service mesh support is experimental.
# istioEnabled specifies whether or not the domain is deployed under an Istio service mesh.
istioEnabled: false
istioEnabled: false
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@

package oracle.kubernetes.operator.helpers;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Optional;
import java.util.StringTokenizer;

import oracle.kubernetes.operator.TuningParameters;

/** A class to create DNS-1123 legal names for Kubernetes objects. */
public class LegalNames {

Expand All @@ -11,6 +18,34 @@ public class LegalNames {
private static final String DOMAIN_INTROSPECTOR_JOB_PATTERN = "%s-introspect-domain-job";
private static final String EXTERNAL_SERVICE_PATTERN = "%s-%s-external";

public static final String DNS_1123_FIELDS_PARAM = "dns1123Fields";

// Fields that requires values to be DNS1123 legal
private static final String[] DEFAULT_DNS1123_FIELDS = {
"ClaimName", // V1PersistentVolumeClaimVolumeSource
"ClusterName", // V1ObjectMetaData
"ContainerName", // V1ResourceFieldSelector
"ExternalName", // V1ServiceSpec
"GenerateName", // V1ObjectMetaData
"MetricName", // V2beta1PodsMetricSource, etc
"Name",
"NodeName", // V1PodSpec, etc
// "NominatedNodeName", // V1PodStatus - excluded since it is not used within V1PodSpec
"PersistentVolumeName",// V1VolumeAttachmentSource, etc
"PriorityClassName", // V1PodSpec
"RuntimeClassName", // V1PodSpec
"SchedulerName", // V1PodSpec
"ScopeName", // V1ScopedResourceSelectorRequirement
"SecretName", // V1SecretVolumeSource, etc
"ServiceAccountName", // V1PodSpec
"ServiceName", // NetworkingV1beta1IngressBackend, etc
"SingularName", // V1APIResource
"StorageClassName", // V1PersistentVolumeSpec, V1PersistentVolumeClaimSpec
"VolumeName" // V1PersistentVolumeClaimSpec, etc
};

static String[] dns1123Fields;

public static String toServerServiceName(String domainUid, String serverName) {
return toServerName(domainUid, serverName);
}
Expand Down Expand Up @@ -48,4 +83,57 @@ public static String toExternalServiceName(String domainUid, String serverName)
public static String toDns1123LegalName(String value) {
return value.toLowerCase().replace('_', '-');
}

/**
* Returns a list of field names of fields that needs to be in DNS-1123 format from the
* "dns1123Fields" tuning parameter, if it is configured with a comma delimited values
* containing field names.
*
* @return String array containing a list of fields that are required to be * in DNS-1123 format,
* or null if "dns1123Fields" tuning parameter is not configured.
*/
private static String[] getConfiguredDns1123Fields() {
String configuredValue = TuningParameters.getInstance().get(DNS_1123_FIELDS_PARAM);

if (configuredValue == null) {
return null;
}

Collection<String> fields = new ArrayList<>();

if (configuredValue != null) {
StringTokenizer st = new StringTokenizer(configuredValue, ",");
while (st.hasMoreTokens()) {
fields.add(st.nextToken().trim());
}
}
String[] fieldsArray = new String[fields.size()];
return fields.toArray(fieldsArray);
}


private static String[] getDns1123Fields() {
if (dns1123Fields == null) {
dns1123Fields = Optional.ofNullable(getConfiguredDns1123Fields()).orElse(DEFAULT_DNS1123_FIELDS);
}
return dns1123Fields;
}

/**
* Returns true if the value in the field is required to be DNS-1123 legal.
*
* @param fieldName Name of the field to be checked
* @return true if the value needs to be DNS1123 legal, false otherwise
*/
public static boolean isDNS1123Required(String fieldName) {
if (fieldName != null) {
for (String dns1123Field: getDns1123Fields()) {
if (dns1123Field.equalsIgnoreCase(fieldName)) {
return true;
}
}
}
return false;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,9 @@ static List<V1EnvVar> createCopy(List<V1EnvVar> envVars) {
ArrayList<V1EnvVar> copy = new ArrayList<>();
if (envVars != null) {
for (V1EnvVar envVar : envVars) {
// note that a deep copy of valueFrom is not needed here as, unlike with value, we are
// not doing any modifications or macro substitutions on the valueFrom fields
// note that a deep copy of valueFrom is not needed here as, unlike with value, the
// new V1EnvVarFrom objects would be created by the doDeepSubstitutions() method in
// StepContextBase class.
copy.add(new V1EnvVar()
.name(envVar.getName())
.value(envVar.getValue())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,7 @@ final List<V1EnvVar> getEnvironmentVariables(TuningParameters tuningParameters)
vars, "USER_MEM_ARGS", "-XX:+UseContainerSupport -Djava.security.egd=file:/dev/./urandom");

hideAdminUserCredentials(vars);
doSubstitution(varsToSubVariables(vars), vars);

return vars;
return doDeepSubstitution(varsToSubVariables(vars), vars);
}

protected Map<String, String> varsToSubVariables(List<V1EnvVar> vars) {
Expand All @@ -110,15 +108,13 @@ protected Map<String, String> varsToSubVariables(List<V1EnvVar> vars) {
return substitutionVariables;
}

protected void doSubstitution(final Map<String, String> substitutionVariables, List<V1EnvVar> vars) {
for (V1EnvVar var : vars) {
var.setValue(translate(substitutionVariables, var.getValue()));
}
protected <T> T doDeepSubstitution(final Map<String, String> substitutionVariables, T obj) {
return doDeepSubstitution(substitutionVariables, obj, false);
}

protected <T> T doDeepSubstitution(final Map<String, String> substitutionVariables, T obj) {
protected <T> T doDeepSubstitution(final Map<String, String> substitutionVariables, T obj, boolean requiresDNS1123) {
if (obj instanceof String) {
return (T) translate(substitutionVariables, (String) obj);
return (T) translate(substitutionVariables, (String) obj, requiresDNS1123);
} else if (obj instanceof List) {
List<Object> result = new ArrayList<>();
for (Object o : (List) obj) {
Expand All @@ -144,7 +140,11 @@ protected <T> T doDeepSubstitution(final Map<String, String> substitutionVariabl
for (Pair<Method, Method> item : typeBeans) {
item.getRight()
.invoke(
subObj, doDeepSubstitution(substitutionVariables, item.getLeft().invoke(obj)));
subObj,
doDeepSubstitution(
substitutionVariables,
item.getLeft().invoke(obj),
isDNS1123Required(item.getLeft())));
}
return subObj;
} catch (NoSuchMethodException
Expand All @@ -158,6 +158,12 @@ protected <T> T doDeepSubstitution(final Map<String, String> substitutionVariabl
return obj;
}

boolean isDNS1123Required(Method method) {
// value requires to be in DNS1123 if the value is for a name, which is assumed to be
// name for a kubernetes object
return LegalNames.isDNS1123Required(method.getName().substring(3));
}

private static final String MODELS_PACKAGE = V1Pod.class.getPackageName();
private static final String DOMAIN_MODEL_PACKAGE = Domain.class.getPackageName();

Expand Down Expand Up @@ -193,10 +199,15 @@ private List<Pair<Method, Method>> typeBeans(Class cls) {
}

private String translate(final Map<String, String> substitutionVariables, String rawValue) {
return translate(substitutionVariables, rawValue, false);
}

private String translate(final Map<String, String> substitutionVariables, String rawValue, boolean requiresDNS1123) {
String result = rawValue;
for (Map.Entry<String, String> entry : substitutionVariables.entrySet()) {
if (result != null && entry.getValue() != null) {
result = result.replace(String.format("$(%s)", entry.getKey()), entry.getValue());
result = result.replace(String.format("$(%s)", entry.getKey()),
requiresDNS1123 ? LegalNames.toDns1123LegalName(entry.getValue()) : entry.getValue());
}
}
return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@ protected DomainSpec getDomainSpec() {

public abstract DomainConfigurator withAdditionalVolume(String name, String path);

public abstract DomainConfigurator withAdditionalPVClaimVolume(String name, String claimName);

public abstract DomainConfigurator withAdditionalVolumeMount(String name, String path);

public abstract DomainConfigurator withInitContainer(V1Container initContainer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,10 @@ void addAdditionalVolume(String name, String path) {
serverPod.addAdditionalVolume(name, path);
}

void addAdditionalPVClaimVolume(String name, String claimName) {
serverPod.addAdditionalPVClaimVolume(name, claimName);
}

public List<V1VolumeMount> getAdditionalVolumeMounts() {
return serverPod.getAdditionalVolumeMounts();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ public DomainConfigurator withAdditionalVolume(String name, String path) {
return this;
}

@Override
public DomainConfigurator withAdditionalPVClaimVolume(String name, String claimName) {
getDomainSpec().addAdditionalPVClaimVolume(name, claimName);
return this;
}

@Override
public DomainConfigurator withAdditionalVolumeMount(String name, String path) {
getDomainSpec().addAdditionalVolumeMount(name, path);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import io.kubernetes.client.models.V1HostPathVolumeSource;
import io.kubernetes.client.models.V1NodeAffinity;
import io.kubernetes.client.models.V1NodeSelector;
import io.kubernetes.client.models.V1PersistentVolumeClaimVolumeSource;
import io.kubernetes.client.models.V1PodAffinity;
import io.kubernetes.client.models.V1PodAntiAffinity;
import io.kubernetes.client.models.V1PodReadinessGate;
Expand Down Expand Up @@ -608,6 +609,13 @@ private void addAdditionalVolume(V1Volume var) {
volumes.add(var);
}

void addAdditionalPVClaimVolume(String name, String claimName) {
addAdditionalVolume(
new V1Volume().name(name).persistentVolumeClaim(
new V1PersistentVolumeClaimVolumeSource().claimName(claimName))
);
}

void addAdditionalVolumeMount(String name, String path) {
addAdditionalVolumeMount(new V1VolumeMount().name(name).mountPath(path));
}
Expand Down
Loading