-
Notifications
You must be signed in to change notification settings - Fork 1.8k
PR for SRVCOM-3999: Add a new “Integrating Service Mesh 3.x with OpenShift Serverless" section in the serverless docs #101668
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
Open
kaldesai
wants to merge
7
commits into
openshift:serverless-docs-main
Choose a base branch
from
kaldesai:SRVCOM-3999-Integrating-OSSM-3.x
base: serverless-docs-main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
fa64dbe
SRVCOM-3999-Integrating-OSSM-3.x: Added and updated a new integrating…
ba79c03
SRVCOM-3999-Integrating-OSSM-3.x: Fixed a syntax issue
cff1055
SRVCOM-3999-Integrating-OSSM-3.x: Fixed a context
924db53
SRVCOM-3999-Integrating-OSSM-3.x: fixed some build issues
9dd69e0
SRVCOM-3999-Integrating-OSSM-3.x: fixed some build issues part 1
979a97c
SRVCOM-3999-Integrating-OSSM-3.x: Incorporated SME and QE review feed…
1cb9c23
SRVCOM-3999-Integrating-OSSM-3.x: Incorporated SME and QE review feed…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
.../serverless-integrating-service-mesh/serverless-integrating-ossm-3-x-setup.adoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| :_mod-docs-content-type: ASSEMBLY | ||
| [id="serverless-integrating-ossm-3-x-setup"] | ||
| = Integrating Service Mesh 3.x with OpenShift Serverless | ||
| include::_attributes/common-attributes.adoc[] | ||
| :context: serverless-integrating-ossm-3-x-setup | ||
|
|
||
| toc::[] | ||
|
|
||
| [role="_abstract"] | ||
| The {ServerlessOperatorName} provides Kourier as the default ingress for Knative. However, you can use {SMProductShortName} with {ServerlessProductName} whether Kourier is enabled or not. Integrating with Kourier disabled allows you to configure additional networking and routing options that the Kourier ingress does not support, such as mTLS functionality. | ||
|
|
||
| Note the following assumptions and limitations: | ||
|
|
||
| * All Knative internal components, as well as Knative Services, are part of the {SMProductShortName} and have sidecars injection enabled. This means that strict mTLS is enforced within the whole mesh. All requests to Knative Services require an mTLS connection, with the client having to send its certificate, except calls coming from OpenShift Routing. | ||
|
|
||
| * {ServerlessProductName} with {SMProductShortName} integration can only target *one* service mesh. Multiple meshes can be present in the cluster, but {ServerlessProductName} is only available on one of them. | ||
|
|
||
| [id="prerequisites_serverless-integrating-ossm-3-x-setup"] | ||
| == Prerequisites | ||
|
|
||
| * You have access to an {product-title} account with cluster administrator access. | ||
|
|
||
| * You have installed the OpenShift CLI (`oc`). | ||
|
|
||
| * You have installed the {ServerlessProductShortName} Operator. | ||
|
|
||
| * You have installed the {SMProductName} 3.x Operator. | ||
|
|
||
| * The examples in the following procedures use the domain `example.com`. The example certificate for this domain is used as a certificate authority (CA) that signs the subdomain certificate. | ||
| + | ||
| To complete and verify these procedures in your deployment, you need either a certificate signed by a widely trusted public CA or a CA provided by your organization. Example commands must be adjusted according to your domain, subdomain, and CA. | ||
|
|
||
| * You must configure the wildcard certificate to match the domain of your {ocp-product-title} cluster. For example, if your {ocp-product-title} console address is `https://console-openshift-console.apps.openshift.example.com`, you must configure the wildcard certificate so that the domain is `*.apps.openshift.example.com`. For more information about configuring wildcard certificates, see the following topic about _Creating a certificate to encrypt incoming external traffic_. | ||
|
|
||
| * If you want to use any domain name, including those which are not subdomains of the default {ocp-product-title} cluster domain, you must set up domain mapping for those domains. For more information, see the {ServerlessProductName} documentation about xref:../../knative-serving/config-custom-domains/create-domain-mapping.adoc#serverless-create-domain-mapping_create-domain-mapping[Creating a custom domain mapping]. | ||
|
|
||
| include::modules/serverless-ossm-external-certs.adoc[leveloffset=+1] | ||
|
|
||
| [id="configuring-verifying-ossm-3-x-integration-with-serverless"] | ||
| == Configuring and verifying {SMProductShortName} 3.x integration with {ServerlessProductName} | ||
|
|
||
| You can integrate {SMProductShortName} 3.x with {ServerlessProductName} to enable advanced traffic management, security, and observability for your serverless applications. This section provides the steps to verify prerequisites, install and configure both components, and confirm that the integration is functioning as expected. | ||
|
|
||
| include::modules/serverless-ossm-verifying-installation-prerequisites.adoc[leveloffset=+2] | ||
|
|
||
| include::modules/serverless-ossm-installing-and-configuring-openshift-service-mesh-3-x.adoc[leveloffset=+2] | ||
|
|
||
| include::modules/serverless-ossm-installing-and-configuring-openshift-serverless.adoc[leveloffset=+2] | ||
|
|
||
| include::modules/serverless-ossm-verifying-the-ossm-3-x-integration.adoc[leveloffset=+2] | ||
|
|
||
| include::modules/serverless-ossm-disabling-network-policies.adoc[leveloffset=+1] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
236 changes: 236 additions & 0 deletions
236
modules/serverless-ossm-installing-and-configuring-openshift-service-mesh-3-x.adoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,236 @@ | ||
| :_mod-docs-content-type: PROCEDURE | ||
| [id="serverless-ossm-installing-and-configuring-openshift-service-mesh-3-x_{context}"] | ||
| = Installing and configuring {SMProductShortName} 3.x | ||
|
|
||
| [role="_abstract"] | ||
| You can integrate {SMProductShortName} 3.x with {ServerlessProductShortName} by installing and configuring the required Istio components, gateways, and Knative Serving resources. Once these resources are configured, you can deploy the Knative Serving instance with Istio enabled to ensure that your serverless workloads run within the {SMProductShortName} environment. | ||
|
|
||
| .Procedure | ||
|
|
||
| . Create an `Istio` resource in the `istio-system` namespace with the following configuration: | ||
| + | ||
| [source,yaml] | ||
| ---- | ||
| apiVersion: sailoperator.io/v1 | ||
| kind: Istio | ||
| metadata: | ||
| name: default | ||
| spec: | ||
| values: | ||
| meshConfig: | ||
| defaultConfig: | ||
| terminationDrainDuration: 35s | ||
| updateStrategy: | ||
| inactiveRevisionDeletionGracePeriodSeconds: 30 | ||
| type: InPlace | ||
| namespace: istio-system | ||
| version: v1.26-latest | ||
| ---- | ||
|
|
||
| . Apply the resource by running the following commands: | ||
| + | ||
| [source,terminal] | ||
| ---- | ||
| $ oc new-project istio-system | ||
| ---- | ||
| + | ||
| [source,terminal] | ||
| ---- | ||
| $ oc apply -f istio.yaml | ||
| ---- | ||
|
|
||
| . Create an `IstioCNI` resource in the `istio-cni` namespace with the following configuration: | ||
| + | ||
| [source,yaml] | ||
| ---- | ||
| apiVersion: sailoperator.io/v1 | ||
| kind: IstioCNI | ||
| metadata: | ||
| name: default | ||
| spec: | ||
| namespace: istio-cni | ||
| version: v1.26-latest | ||
| ---- | ||
|
|
||
| . Apply the resource by running the following commands: | ||
| + | ||
| [source,terminal] | ||
| ---- | ||
| $ oc new-project istio-cni | ||
| ---- | ||
| + | ||
| [source,terminal] | ||
| ---- | ||
| $ oc apply -f istio-cni.yaml | ||
| ---- | ||
|
|
||
| . Create a file named `gateway-deploy.yaml` with the following configuration: | ||
| + | ||
| [source,yaml] | ||
| ---- | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: knative-istio-ingressgateway | ||
| namespace: knative-serving-ingress | ||
| spec: | ||
| selector: | ||
| matchLabels: | ||
| knative: ingressgateway | ||
| template: | ||
| metadata: | ||
| annotations: | ||
| inject.istio.io/templates: gateway <1> | ||
| labels: | ||
| knative: ingressgateway <2> | ||
| sidecar.istio.io/inject: "true" <3> | ||
| spec: | ||
| containers: | ||
| - name: istio-proxy | ||
| image: auto <4> | ||
|
|
||
| --- | ||
| # Set up roles to allow reading credentials for TLS | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: Role | ||
| metadata: | ||
| name: istio-ingressgateway-sds | ||
| namespace: knative-serving-ingress | ||
| rules: | ||
| - apiGroups: [""] | ||
| resources: ["secrets"] | ||
| verbs: ["get", "watch", "list"] | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: RoleBinding | ||
| metadata: | ||
| name: istio-ingressgateway-sds | ||
| namespace: knative-serving-ingress | ||
| roleRef: | ||
| apiGroup: rbac.authorization.k8s.io | ||
| kind: Role | ||
| name: istio-ingressgateway-sds | ||
| subjects: | ||
| - kind: ServiceAccount | ||
| name: default | ||
| ---- | ||
| + | ||
| <1> Select the gateway injection template rather than the default sidecar template. | ||
| <2> Set a unique label for the gateway. This is required to ensure Gateways can select this workload. | ||
| <3> Enable gateway injection. | ||
| <4> The image will automatically update each time the pod starts. | ||
|
|
||
| . Apply the resource by running the following commands: | ||
| + | ||
| [source,terminal] | ||
| ---- | ||
| $ oc apply -f gateway-deploy.yaml | ||
| ---- | ||
|
|
||
| . Create gateway resources for the Knative Serving component by creating a file named `serving-gateways.yaml` with the following configuration: | ||
| + | ||
| [source,yaml] | ||
| ---- | ||
| ########################################################### | ||
| # cluster external | ||
| ########################################################### | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| name: knative-istio-ingressgateway | ||
| namespace: knative-serving-ingress | ||
| spec: | ||
| type: ClusterIP | ||
| selector: | ||
| knative: ingressgateway | ||
| ports: | ||
| - name: http2 | ||
| port: 80 | ||
| targetPort: 8080 | ||
| - name: https | ||
| port: 443 | ||
| targetPort: 8443 | ||
| --- | ||
| apiVersion: networking.istio.io/v1beta1 | ||
| kind: Gateway | ||
| metadata: | ||
| name: knative-ingress-gateway | ||
| namespace: knative-serving | ||
| spec: | ||
| selector: | ||
| knative: ingressgateway | ||
| servers: | ||
| - hosts: | ||
| - '*' | ||
| port: | ||
| name: https | ||
| number: 443 | ||
| protocol: HTTPS | ||
| tls: | ||
| credentialName: wildcard-certs | ||
| mode: SIMPLE | ||
| --- | ||
| ########################################################### | ||
| # cluster local | ||
| ########################################################### | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| labels: | ||
| experimental.istio.io/disable-gateway-port-translation: "true" | ||
| name: knative-local-gateway | ||
| namespace: knative-serving-ingress | ||
| spec: | ||
| ports: | ||
| - name: http2 | ||
| port: 80 | ||
| protocol: TCP | ||
| targetPort: 8081 | ||
| selector: | ||
| knative: ingressgateway | ||
| type: ClusterIP | ||
| --- | ||
| apiVersion: networking.istio.io/v1beta1 | ||
| kind: Gateway | ||
| metadata: | ||
| name: knative-local-gateway | ||
| namespace: knative-serving | ||
| spec: | ||
| selector: | ||
| knative: ingressgateway | ||
| servers: | ||
| - hosts: | ||
| - '*' | ||
| port: | ||
| name: http | ||
| number: 8081 | ||
| protocol: HTTP | ||
| ---- | ||
|
|
||
| . Apply the resource by running the following commands: | ||
| + | ||
| [source,terminal] | ||
| ---- | ||
| $ oc apply -f serving-gateways.yaml | ||
| ---- | ||
|
|
||
| . Create a `PeerAuthentication` resource in the `istio-system` namespace to enforce mTLS across the mesh with the following configuration: | ||
| + | ||
| [source,yaml] | ||
| ---- | ||
| apiVersion: security.istio.io/v1 | ||
| kind: PeerAuthentication | ||
| metadata: | ||
| name: mesh-mtls | ||
| namespace: istio-system | ||
| spec: | ||
| mtls: | ||
| mode: STRICT | ||
| ---- | ||
|
|
||
| . Apply the resource by running the following commands: | ||
| + | ||
| [source,terminal] | ||
| ---- | ||
| $ oc apply -f peerauth.yaml | ||
| ---- |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back 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.
This module expect istio-system ns to exist in the step 4 but it is not in the prerequisities.
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.
Also I believe the wildcart certs should be created in knative-serving-ingress namespace, WDYT @dsimansk ?
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 checked and the secret needs to be in the knative-serving-ingress namespace for SM3
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, thanks for pointing it out and checking.