-
Notifications
You must be signed in to change notification settings - Fork 218
OWLS-92894: Implement Istio support based on Istio version #2582
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
Conversation
documentation/domains/Domain.json
Outdated
@@ -569,10 +569,18 @@ | |||
"Istio": { | |||
"type": "object", | |||
"properties": { | |||
"replicationChannelPort": { | |||
"description": "The operator will create a WebLogic network access point with this port that will then be exposed from the container running the WebLogic Server instance. The WebLogic Replication Service will use this network access point for all replication traffic. Defaults to 4564.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code use 4358 as default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to default to port 4564 and searched to verify it's consistent everywhere in the implementation change.
@@ -149,7 +159,7 @@ static boolean isReserved(String name) { | |||
private static final List<String> RESERVED_NAMES = Arrays.asList( | |||
NAMESPACE, INTROSPECT_HOME, CREDENTIALS_SECRET_NAME, OPSS_KEY_SECRET_NAME, OPSS_WALLETFILE_SECRET_NAME, | |||
RUNTIME_ENCRYPTION_SECRET_NAME, WDT_DOMAIN_TYPE, DOMAIN_SOURCE_TYPE, ISTIO_ENABLED, ISTIO_READINESS_PORT, | |||
ISTIO_POD_NAMESPACE, WDT_MODEL_HOME, MII_USE_ONLINE_UPDATE, | |||
ISTIO_REPLICATION_PORT, ISTIO_VERSION, ISTIO_POD_NAMESPACE, WDT_MODEL_HOME, MII_USE_ONLINE_UPDATE, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will cause unexpected introspection job runs when upgrading the operator. The introspect job checks for environment variable hashed value, if they are different then it will run the introspect job, which eventually will triggers a domain roll because we added a replication channel now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed as not to cause unnecessary introspection runs unless explicitly changed from the default in the Istio configuration of the custom domain resource.
@@ -1317,16 +1197,17 @@ def customizeServerTemplate(self, template): | |||
self.writeListenAddress(template.getListenAddress(),listen_address) | |||
self.customizeNetworkAccessPoints(template,listen_address) | |||
self.customizeManagedIstioNetworkAccessPoint(listen_address, template) | |||
if (self.getCoherenceClusterSystemResourceOrNone(template) is not None): | |||
self.customizeIstioReplicationChannel(template, listen_address, | |||
self.env.getEnvOrDef("ISTIO_REPLICATION_PORT", 4564), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check for the consistency of the default replication channel port value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed so that we consistently use port 4564 as the default.
it is the port used in the network access point by the WebLogic Replication Service | ||
for all replication traffic. The `version` is optional and represents the Istio version | ||
run by the operator and WebLogic domains managed by the operator. If not provided, the | ||
operator will assume it's supporting Istio version 1.9 or earlier. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have multiple questions:
What is the WebLogic Replication Service? Why is it the only kind of traffic that needs special treatment?
Can you add a reference to the replication discussion below?
Why "If [replicationChannelPort] not provided, the operator will assume it's supporting Istio version 1.9 or earlier."? So what if it's "not provided" AND version 1.10 is supplied?
Why is the version important? How do you get the Istio version from Istio? What happens if 'version:' doesn't match the actual version?
What happens if using 1.10 and version is configured to 1.9?
What happens if using 1.9 and version is configured to 1.10?
(Maybe we don't need a version, just a boolean?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The limitations section at beginning mentions testing up to 1.7 only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should "prerequisites.md" mention Istio?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 'port forwarding' documentation mentions that the Istio option enables localhost. If that no longer occurs, then the port forwarding doc should be amended...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be clear, I think we know the answers to most of these questions - I'm asking them as prompts for updating the documentation in case a customer has the same questions...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switched to localhostBindingsEnabled
attribute (instead of specifying version) to simplify configuration and updated documentation. 'port-forwarding' documentation has been updated with information about using domain.spec.adminServer.adminChannelPortForwardingEnabled
domain resource attribute for both Istio v1.10 and later and if not istio enabled, the use cases are the same (we need to generate localhost bindings for port-forwarding)
documentation/domains/Domain.md
Outdated
@@ -224,6 +224,8 @@ The current status of the operation of the WebLogic domain. Updated automaticall | |||
| --- | --- | --- | | |||
| `enabled` | Boolean | True, if this domain is deployed under an Istio service mesh. Defaults to true when the `istio` field is specified. | | |||
| `readinessPort` | number | The operator will create a WebLogic network access point with this port that will then be exposed from the container running the WebLogic Server instance. The readiness probe will use this network access point to verify that the server instance is ready for application traffic. Defaults to 8888. | | |||
| `replicationChannelPort` | number | The operator will create a WebLogic network access point with this port that will then be exposed from the container running the WebLogic Server instance. The WebLogic Replication Service will use this network access point for all replication traffic. Defaults to 4564. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if the replication port has already been defined by the user in the WL configuration itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tom and Lenny had updated the documentation about ignoring the replication channel configuration if already defined by the user.
documentation/domains/Domain.md
Outdated
@@ -224,6 +224,8 @@ The current status of the operation of the WebLogic domain. Updated automaticall | |||
| --- | --- | --- | | |||
| `enabled` | Boolean | True, if this domain is deployed under an Istio service mesh. Defaults to true when the `istio` field is specified. | | |||
| `readinessPort` | number | The operator will create a WebLogic network access point with this port that will then be exposed from the container running the WebLogic Server instance. The readiness probe will use this network access point to verify that the server instance is ready for application traffic. Defaults to 8888. | | |||
| `replicationChannelPort` | number | The operator will create a WebLogic network access point with this port that will then be exposed from the container running the WebLogic Server instance. The WebLogic Replication Service will use this network access point for all replication traffic. Defaults to 4564. | | |||
| `version` | string | Starting with Istio 1.10, the networking behavior was changed in that the proxy no longer redirects the traffic to the localhost interface, but instead forwards (or passes it through) it to the network interface associated with the pod's IP. True, if Istio v1.10 or higher is installed. Defaults to false | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The istio.md states this expects a numeric version. Here it says 'true' 'false'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switched to 'localhostBindingsEnabled' true/false attribute and updated the documentation
``` | ||
<cluster> | ||
<name>cluster-1</name> | ||
<replication-channe>istiorepl</replication-channel> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
channe --> channel
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
return | ||
|
||
# verify if a replication channel is defined for the cluster | ||
if 'ReplicationChannel' not in cluster: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this depends on the ReplicatonChannel already injected in the cluster before, assuming user didn't define any ReplicationChannel in cluster of their model?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we should have already configured the cluster with a replication channel named 'istiorepl'. If a replication channel is already defined that is not named 'istiorepl' or there is no replication channel configured at all then we shouldn't generate the NAP named 'istiorepl'. The only time we should generated the 'istiorepl' NAP is if the cluster has been configured with replication channel named 'istiorepl'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've found some issues with the logic in introspectionDomain.py for injecting replication channel that isn't the same as in MII so I have to fix it.
…ore generating NAPs for each server for MII
…ute of Istio configuration of domain custom resource
@@ -64,7 +64,7 @@ This behavior depends on your version and domain resource configuration: | |||
run the `kubectl explain domain.spec.adminServer.adminChannelPortForwardingEnabled` command | |||
or see the domain resource [schema](https://github.com/oracle/weblogic-kubernetes-operator/blob/main/documentation/domains/Domain.md). | |||
|
|||
* For Istio-enabled domains, the operator already adds a | |||
* For Istio-enabled domains running Istio version 1.9 and earlier, the operator already adds a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
running Istio versions prior to 1.10
I have doc feedback -- let's meet to discuss. |
pull latest from main
merge latest from OWLS-92894
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that the best way for me to review this doc would be to take it over after you've added all your input (and it is technically reviewed and approved). Does that work for you?
multicluster installations of Istio. | ||
* The operator supports Istio versions 1.7 and higher, | ||
and has been tested with single and multicluster | ||
Istio installations from 1.7.3 up to 1.11.x |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from 1.7.3 up to 1.11.x. (period at the end of the sentence)
|
||
**NOTE**: The WebLogic Kubernetes Operator creates Kubernetes headless Services for the domain; Istio 1.6.x does not work with headless Services. See [Headless service broken in 1.6.0](https://github.com/istio/istio/issues/24082). Instead, use Istio version 1.7 and higher. | ||
* You cannot setup a NodePort using `domain.spec.adminServer.adminService.channels` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setup -> set up
Istio support requires labeling the operator namespace and | ||
your domain namespaces to enable Istio automatic | ||
sidecar injection, plus modifying your domain resource | ||
configuration. In this section we discuss |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this section -> In this section, (comma)
we discuss -> we describe
sidecar injection, plus modifying your domain resource | ||
configuration. In this section we discuss | ||
the steps for the operator namespace; we will discuss | ||
the steps for domain in later sections. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we will discuss -> we will describe
the steps for domain -> the steps for the domain
`weblogic-server` container in the managed server pods will fail to reach `ready` state due to failure | ||
of the readiness probe. For example, if the `localhostBindingsEnabled` is set `true` when running | ||
Istio versions 1.10 and later, you will see output like this: | ||
Let's discuss each `spec.configuration.istio` attribute: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's discuss each -> See the following description of each
and set `enabled: true` as shown. | ||
* `readinessPort`: This attribute is optional | ||
and defaults to `8888` if not provided; it is used for a readiness health check. | ||
* `replicationChannelPort`: This attribute is optional and defaults to `4564` if not provided; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
provided; -> provided. (period) If you want to use a semi-colon, then "The operator" -> "the operator"
and defaults to `8888` if not provided; it is used for a readiness health check. | ||
* `replicationChannelPort`: This attribute is optional and defaults to `4564` if not provided; | ||
The operator will create a `T3` protocol WebLogic network access point on each WebLogic | ||
server that is part of a cluster with this port to handle EJB and servlet session state |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
server -> Server
This setting is ignored for clusters | ||
where the WebLogic cluster configuration already defines a `replication-channel` attribute. | ||
* `localhostBindingsEnabled`: | ||
This setting was added in operator version 3.3.3, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest using sub-bullets to separate each of these version-related sub-items.
|----|----|---|---| | ||
|Pre-1.10|3.x|`true`|Supported. Note that `true` is the default in 3.x.| | ||
|Pre-1.10|3.x|`false`|Not supported.| | ||
|Pre-1.10|4.x|N/A|Not supported. 4.x only supports Istio 1.10 and later.| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only supports -> supports only
@rosemarymarano Yes, let me make the current set of changes you've suggested and then you can review after it's technically reviewed. |
Merge Tom's latest doc edits
…ce over helm value
@@ -427,4 +428,14 @@ private void createDomainOnPVUsingWlst(Path wlstScriptFile, Path domainPropertie | |||
|
|||
} | |||
|
|||
private AdminServer createAdminServer() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move this method to common IstioUtils class so that it can be manged in one calss instead of repeating in each Istio It class.
@@ -0,0 +1,134 @@ | |||
// Copyright (c) 2020, 2021, Oracle and/or its affiliates. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modify the copyright statement to -> Copyright (c) 2021, Oracle and/or its affiliates.
"type": "number" | ||
}, | ||
"localhostBindingsEnabled": { | ||
"description": "This setting was added in operator version 3.3.3, defaults to the `istioLocalhostBindingsEnabled` [Operator Helm value]({{\u003c relref \"/userguide/managing-operators/using-helm.md\" \u003e}}) which in turn defaults to `true`, and is ignored in version 4.0 and later. In version 3.x, when `true`, the operator creates a WebLogic network access point with a `localhost` binding for each existing channel and protocol. In version 3.x, use `true` for Istio versions prior to 1.10 and set to `false` for version 1.10 and later. Version 4.0 and later requires Istio 1.10 and later, will not create localhost bindings, and ignores this attribute.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can only use relref in the main documentation markdown. Here we have to use a fully-qualified URL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rosemarymarano, we will need your help wording this. :)
We are adding a field that lets the customer configure whether the operator should behave in a certain way with the implication that one choice is appropriate for Istio versions 1.10 and greater and the other choice for Istio versions prior to 1.10. For the 3.x versions of the operator we will support Istio 1.7.3 through 1.10. For the (future) 4.0 release of the operator we will only support Istio 1.10 and greater. We need to release an operator 3.3.3 with these changes as soon as possible, but the operator 4.0 release is still a future release. Therefore, this wording is a little off since it fails to capture that 4.0 isn't available yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way I see it, you have two choices: one is remove the references to 4.0 and just describe the current situation with operator 3.x and the second is to keep it as written but add the caveat that version 4.0 is not yet available. With either choice, you will have to go back and edit the information when 4.0 becomes available. From a technical writing "best practices " POV, you should remove references to 4.0. We are instructed to almost never refer to releases/versions that exist only in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of removing references to 4.0 or adding a qualifier sentence, maybe we tag all mentions of 4.0 with the word unreleased - e.g. something change "4.0" to something like "4.0 (unreleased)" or "4.beta"?
4.0 is technically available in that the full source is public in "main".
This is going to keep happening, and it's hard to juggle fine distinctions between source and documentation, and even harder to maintain multiple versions of the same doc.
|Pre-1.10|4.x|N/A|Not supported. 4.x supports only Istio 1.10 and later.| | ||
|1.10 and later|3.x|`true`|Not supported.| | ||
|1.10 and later|3.x|`false`|Supported.| | ||
|1.10 and later|4.x|N/A|Supported. Operator will not create localhost bindings because Istio 1.10 does not need them.| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly, we need to work with @rosemarymarano to figure out how to properly reference 4.0 as a future release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll wait until you have a final version for me to review.
@ApiModelProperty( | ||
"This setting was added in operator version 3.3.3, " | ||
+ "defaults to the `istioLocalhostBindingsEnabled` " | ||
+ "[Operator Helm value]({{< relref \"/userguide/managing-operators/using-helm.md\" >}}) " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Must use fully-qualifed URL here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or simply change [Operator Helm value]({{< relref \"/userguide/managing-operators/using-helm.md\" >}})
to Operator Helm value
?
@Description( | ||
"This setting was added in operator version 3.3.3, " | ||
+ "defaults to the `istioLocalhostBindingsEnabled` " | ||
+ "[Operator Helm value]({{< relref \"/userguide/managing-operators/using-helm.md\" >}}) " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same... Fix here as well when we work with Rosemary to wordsmith.
Per our team conversation, I'm going to merge this PR as is. We will then update the documentation first as part of a backport to |
Due to networking changes starting in Istio v1.10, as described in https://istio.io/latest/blog/2021/upcoming-networking-changes/, the operator needs to generate the appropriate WebLogic NAP's based on a version attribute in the Istio configuration of the domain custom resource:
e.g.
Istio
configuration:
istio:
enabled: true
readinessPort: 8888
replicationChannelPort: 4564
localhostBindingsEnabled: false
This PR implements the following for all domain types:
version
attribute tolocalhostBindingsEnabled
boolean attribute.istioLocalhostBindingsEnabled
.