Difference between revisions of "WebRTC/Current/WebRTCPEGuide/Deploy"
(Published) |
(Published) |
||
Line 123: | Line 123: | ||
|Status=No | |Status=No | ||
}}{{Section | }}{{Section | ||
− | |sectionHeading=Deploy | + | |sectionHeading=Deploy |
|alignment=Vertical | |alignment=Vertical | ||
|structuredtext=You need to use PersistentVolume and PersistentVolumeClaim instead of HostPath logs of Gateway pods and CoTurn Pods. | |structuredtext=You need to use PersistentVolume and PersistentVolumeClaim instead of HostPath logs of Gateway pods and CoTurn Pods. | ||
|Status=No | |Status=No | ||
}}{{Section | }}{{Section | ||
− | |sectionHeading=Validate the deployment | + | |sectionHeading=Validate the deployment |
|alignment=Vertical | |alignment=Vertical | ||
|structuredtext=Follow the steps given below to validate the deployment in OpenShift | |structuredtext=Follow the steps given below to validate the deployment in OpenShift | ||
#'''Verify PVCs are created and bound''' | #'''Verify PVCs are created and bound''' | ||
− | #:<source lang="LANGUAGE"> | + | #:<source lang="LANGUAGE">kubectl get pvc</source> |
#:Sample output: | #:Sample output: | ||
#:<source lang="LANGUAGE">NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE | #:<source lang="LANGUAGE">NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE | ||
Line 139: | Line 139: | ||
webrtc-gateway-log-pvc Bound webrtc-gateway-log-volume 5Gi RWX genesys-webrtc 110s</source> | webrtc-gateway-log-pvc Bound webrtc-gateway-log-volume 5Gi RWX genesys-webrtc 110s</source> | ||
#'''Validate CoTurn and Gateway services''' | #'''Validate CoTurn and Gateway services''' | ||
− | #:<source lang="LANGUAGE"> | + | #:<source lang="LANGUAGE">kubectl get svc</source> |
#:Sample output: | #:Sample output: | ||
#:<source lang="LANGUAGE">NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE | #:<source lang="LANGUAGE">NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE | ||
Line 145: | Line 145: | ||
webrtc-gateway-service-blue ClusterIP 10.202.47.170 <none> 80/TCP,8080/TCP 67m</source> | webrtc-gateway-service-blue ClusterIP 10.202.47.170 <none> 80/TCP,8080/TCP 67m</source> | ||
#'''Query pods in the WebRTC namespace to confirm that pod is created, and in running status''' | #'''Query pods in the WebRTC namespace to confirm that pod is created, and in running status''' | ||
− | #:<source lang="LANGUAGE"> | + | #:<source lang="LANGUAGE">kubectl get pods</source> |
#:Sample output: | #:Sample output: | ||
#:<source lang="LANGUAGE">NAME READY STATUS RESTARTS AGE | #:<source lang="LANGUAGE">NAME READY STATUS RESTARTS AGE | ||
Line 151: | Line 151: | ||
webrtc-gateway-blue-d7ff45677-vbdg9 1/1 Running 0 86s</source> | webrtc-gateway-blue-d7ff45677-vbdg9 1/1 Running 0 86s</source> | ||
#'''Validate Ingress configuration''' | #'''Validate Ingress configuration''' | ||
− | #:<source lang="LANGUAGE"> | + | #:<source lang="LANGUAGE">kubectl get ingress</source> |
#:Sample output: | #:Sample output: | ||
#:<source lang="LANGUAGE">NAME CLASS HOSTS ADDRESS PORTS AGE | #:<source lang="LANGUAGE">NAME CLASS HOSTS ADDRESS PORTS AGE | ||
webrtc-ingress-int <none> webrtc.apps.vce-c0.eps.genesys.com,webrtc-test.apps.vce-c0.eps.genesys.com 80 68s</source> | webrtc-ingress-int <none> webrtc.apps.vce-c0.eps.genesys.com,webrtc-test.apps.vce-c0.eps.genesys.com 80 68s</source> | ||
#Validate Ingress Edge route configuration | #Validate Ingress Edge route configuration | ||
− | #:<source lang="LANGUAGE"> | + | #:<source lang="LANGUAGE">kubectl get route</source> |
#:Sample output: | #:Sample output: | ||
#:<source lang="LANGUAGE">NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD | #:<source lang="LANGUAGE">NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD | ||
Line 164: | Line 164: | ||
webrtc-ingress-int-wf6x9 webrtc-test.apps.qrtph6qa.westus2.aroapp.io /blue webrtc-gateway-service-blue web None</source> | webrtc-ingress-int-wf6x9 webrtc-test.apps.qrtph6qa.westus2.aroapp.io /blue webrtc-gateway-service-blue web None</source> | ||
#'''Query Ingress for exposed WebRTC Web API''' | #'''Query Ingress for exposed WebRTC Web API''' | ||
− | #:<source lang="LANGUAGE"> | + | #:<source lang="LANGUAGE">kubectl get ingress</source> |
#:Copy the WebRTC API from the Ingress output: | #:Copy the WebRTC API from the Ingress output: | ||
#:Sample output: | #:Sample output: |
Revision as of 17:31, December 22, 2021
Contents
Learn how to deploy WebRTC.
- Both components - WebRTC Gateway and CoTurn Server - are deployed for each color and switched together
- Blue WebRTC Gateway is always configured to work with Blue CoTurn and green WebRTC Gateway is always configured to work with green CoTurn
- WebRTC have two FQDNs to reach active and inactive deployments:
- webrtc.domain.com - active deployment. For example: webrtc.genesyshtcc.com
- webrtc-test.domain.com - inactive deployment for tests. For example: webrtc-test.genesyshtcc.com
You can deploy WebRTC using:
- Internal CoTurn Load Balancer or
- External CoTurn Load Balancer
Deploying WebRTC using internal CoTurn Load Balancer
Initial deployment and Upgrade use the same sequence:
- Deploy/upgrade inactive color of deployment
- Make the cutover
You need to deploy the Color Infra package with CoTurn Load Balancer to get the IP address assigned automatically for the CoTurn Load Balancer by the infrastructure. Then, the infrastructure team should assign the IP to the CoTurn Load Balancer, create the FQDN for the IP and ensure that the IP is set in the firewall and is available from outside the cluster.
The following image shows the steps involved in deploying WebRTC using the internal CoTurn Load Balancer:
Follow the below steps to deploy WebRTC using internal CoTurn Load Balancer:
- Create common infrastructure elements such as dashboards and alarms: This step deploys dashboards, alarms, and other common infrastructure elements.
- ImportantYou should perform this step even if you do not require the dashboard and alarms.
- Run the following command to create the common infrastructure elements:
helm upgrade --install -f {Webrtc Values files} --set-string deployment.type=infra --set-string deployment.color="" webrtc-infra {HelmRepoPath}/webrtc-service --version={WebRTC Charts Version}
- Example:
helm upgrade --install -f ./k8s/values.yaml --set-string deployment.type=infra --set-string deployment.color="" webrtc-infra wrtchelmrepodevwestus2/webrtc-service --version=0.1.93 -n webrtc
- Create infrastructure elements for the deployment color: This step deploys the infrastructure objects such as Turn Load Balancer, Gateway Service Object, Gateway Network Policies, and Turn Network Policies for the given color of deployment.
- You should also specify the INACTIVE color of deployment in this step.
- ImportantYou should configure the deployment.coturnDeployment option with the value internal in your values.yaml file.
- Run the following command to deploy the infrastructure objects:
helm upgrade --install -f {Webrtc Values files} --set-string deployment.type=infra --set-string deployment.color={INACTIVE_COLOR} webrtc-infra-{INACTIVE_COLOR} {HelmRepoPath }/webrtc-service --version={WebRTC Charts Version}
- Example:
helm upgrade --install -f ./k8s/values.yaml --set-string deployment.type=infra --set-string deployment.color=blue webrtc-infra-blue wrtchelmrepodevwestus2/webrtc-service --version=0.1.93 -n webrtc
- Get the IPs from the CoTurn Load Balancers, create DNS records and firewall rules: This step gets the IP address from the Colurn Load Balancer created in Step 2. The name of LoadBalancer will be similar to: webrtc-coturn-service-{COLOR}.
- Create appropriate FQDN for this IP address in your DNS. This FQDN will be used by the WebRTC agents from outside the cluster to establish the RTP stream. Though you can use the IP address as it is, it is not the best practice to do so.
- Create CoTurn elements for the deployment color: This step is to Upgrade/Deploy CoTurn for INACTIVE color.
- Run the following command to upgrade/deploy the INACTIVE color of deployment:
helm upgrade --install -f {Webrtc Values files} --set-string deployment.type=coturn --set-string deployment.color={INACTIVE_COLOR} webrtc-coturn-{INACTIVE_COLOR} {HelmRepoPath }/webrtc-service --version={WebRTC Charts Version}
- Example:
helm upgrade --install -f ./k8s/values.yaml --set-string deployment.type=coturn --set-string deployment.color=blue webrtc-coturn-blue wrtchelmrepodevwestus2/webrtc-service --version=0.1.93 -n webrtc
- Create Gateway elements for deployment color using the information from Step 3: This step is to Upgrade/Deploy Gateway for INACTIVE color. You shoud also specify the extenal FQDN of the CoTurn LoadBalancer in this step using the gateway.turnExternalUriBlue or gateway.turnExternalUriGreen options.
- Run the following command:
helm upgrade --install -f {Webrtc Values files} --set-string deployment.type=gateway --set-string deployment.color={INACTIVE_COLOR} --set-string gateway.turnExternalUri{INACTIVE_COLOR}={COTURN FQDN INACTIVE_COLOR} webrtc-gateway-{INACTIVE_COLOR} {HelmRepoPath }/webrtc-service --version={WebRTC Charts Version}
- Example for Blue deployment:
helm upgrade --install -f ./k8s/values.yaml--set-string deployment.type=gateway --set-string deployment.color=blue --set-string gateway.turnExternalUriBlue=turn-blue.ext.mydoamin.com webrtc-gateway-blue wrtchelmrepodevwestus2/webrtc-service --version=0.1.93 -n webrtc
- Or, you can specify the IP of the Blue CoTurn Load Balancer
helm upgrade --install -f ./k8s/values.yaml--set-string deployment.type=gateway --set-string deployment.color=blue --set-string gateway.turnExternalUriBlue=12.106.34.55 webrtc-gateway-blue wrtchelmrepodevwestus2/webrtc-service --version=0.1.93 -n webrtc
- Create/update Ingress controller rules for Active/Inactive routing for Gateway deployments: This step is to Install/upgrade ingress without changing the active color. The same step is used for the Cutover.
- ImportantIf you are deploying/upgrading green, specify the current ACTIVE color of deployment in the deployment.color option. Then specify blue and vice versa. If you deploying/upgrading green and specify green for the cutover step, the current active deployment will be switched to the just deployed/upgraded green.
- You must perform this step even if you are not planning to make the cutover right now. This step is to upgrade the ingress and environment.
- Run the following command to create/upgrade Ingress controller rules:
helm upgrade --install -f {Webrtc Values files} --set-string deployment.type=cutover --set-string deployment.color={ACTIVE_COLOR} webrtc-ingress {HelmRepoPath }/webrtc-service --version={WebRTC Charts Version}
- Example:
helm upgrade --install -f ./k8s/values.yaml --set-string deployment.type=cutover --set-string deployment.color=green webrtc-ingress wrtchelmrepodevwestus2/webrtc-service --version=0.1.93 -n webrtc
Deployment with external CoTurn Load Balancer
Initial deployment and Upgrade use the same sequence:
- Deploy/upgrade inactive color of deployment
- Make the cutover
The following image shows the steps involved in deploying WebRTC using the external CoTurn Load Balancer:
Follow the below steps to deploy WebRTC with external CoTurn Load Balancer
- Create static IPs for CoTurn: This step is to specify the pre-created public IP for CoTurn Green in the coturn.lbIpGreen option and public IP for CoTurn Blue in the coturn.lbIpBlue option.
- Create DNS records for the created IPs: This step is to specify the public FQDNs for CoTurn. Specify the pre-created public FQDN for CoTurn Green in the gateway.turnExternalUriGreen option and public FQDN for CoTurn Blue in the gateway.turnExternalUriBlue option.
- Create common infrastructure elements: This step will deploy Persistent Volumes, Persistent Volume Claims, dashboards, alarms, and other common infrastructure elements.
- ImportantYou need to run this step even if you are not using the dashboard and alarms.
- Run the following command to create the infrastructure elements:
helm upgrade --install -f {Webrtc Values files} --set-string deployment.type=infra --set-string deployment.color="" webrtc-infra {HelmRepoPath}/webrtc-service --version={WebRTC Charts Version}
- Example:
helm upgrade --install -f ./k8s/values.yaml --set-string deployment.type=infra --set-string deployment.color="" webrtc-infra wrtchelmrepodevwestus2/webrtc-service --version=0.1.93 -n webrtc
- Create infrastructure elements for deployment color: This step is to deploy the infrastructure objects such as Turn Load Balancer, Gateway Service Object, Gateway Network Policies, and Turn Network Policies for the given color of deployment.
- You must specify INACTIVE color of deployment for this step.
- ImportantConfigure the deployment.coturnDeployment option with the value external in your values.yaml file.
- Run the following command to create the infrastructure elements:
helm upgrade --install -f {Webrtc Values files} --set-string deployment.type=infra --set-string deployment.color={INACTIVE_COLOR} webrtc-infra-{INACTIVE_COLOR} {HelmRepoPath }/webrtc-service --version={WebRTC Charts Version}
- Example:
helm upgrade --install -f ./k8s/values.yaml --set-string deployment.type=infra --set-string deployment.color=blue webrtc-infra-blue wrtchelmrepodevwestus2/webrtc-service --version=0.1.93 -n webrtc
- Create CoTurn elements for deployment color: This step is to upgrade/deploy CoTurn for inactive color.
- Run the following command to specify the INACTIVE color of deployment:
helm upgrade --install -f {Webrtc Values files} --set-string deployment.type=coturn --set-string deployment.color={INACTIVE_COLOR} webrtc-coturn-{INACTIVE_COLOR} {HelmRepoPath }/webrtc-service --version={WebRTC Charts Version}
- Example:
helm upgrade --install -f ./k8s/values.yaml --set-string deployment.type=coturn --set-string deployment.color=blue webrtc-coturn-blue wrtchelmrepodevwestus2/webrtc-service --version=0.1.93 -n webrtc
- Create Gateway elements for deployment color: This step is to upgrade/deploy the Gateway for inactive color.
- ImportantCoTurn DNS name is used for Gateway deployment as a parameter in the corresponding values.yaml file.
- Run the following command to specify the INACTIVE color of deployment:
helm upgrade --install -f {Webrtc Values files} --set-string deployment.type=gateway --set-string deployment.color={INACTIVE_COLOR} webrtc-gateway-{INACTIVE_COLOR} {HelmRepoPath }/webrtc-service --version={WebRTC Charts Version}
- Example:
helm upgrade --install -f ./k8s/values.yaml--set-string deployment.type=gateway --set-string deployment.color=blue webrtc-gateway-blue wrtchelmrepodevwestus2/webrtc-service --version=0.1.93 -n webrtc
- Create/update Ingress controller rules for Active/Inactive routing for the Gateway deployments: This step is to install/upgrade ingress without changing the active color. The sampe step is also used for the Cutover.
- ImportantIf you are deploying/upgrading green, specify the current ACTIVE color of deployment in the deployment.color option which is blue and vice versa. If you deploying/upgrading green and specify green for the cutover step, the current active deployment will be switched to the just deployed/upgraded green.
- ImportantYou must perform this step even if you do not plan to make cutover right now. This step is to upgrade the ingress and environment.
- Run the following command to create/upgrade Ingress controller rules:
helm upgrade --install -f {Webrtc Values files} --set-string deployment.type=cutover --set-string deployment.color={ACTIVE_COLOR} webrtc-ingress {HelmRepoPath }/webrtc-service --version={WebRTC Charts Version}
- Example:
helm upgrade --install -f ./k8s/values.yaml --set-string deployment.type=cutover --set-string deployment.color=green webrtc-ingress wrtchelmrepodevwestus2/webrtc-service --version=0.1.93 -n webrtc
Cutover
During cutover, it switches active color of deployment. This step should be performed only after you confirm that the newly installed/upgraded deployment is alive and functional. You must specify the current INACTIVE color of deployment in the deployment.color option - deployment that was just deployed/upgraded and tested. Run the following command to specify the cutover:
helm upgrade --install -f {Webrtc Values files} --set-string deployment.type=cutover --set-string deployment.color={INACTIVE_COLOR} webrtc-ingress {HelmRepoPath }/webrtc-service --version={WebRTC Charts Version}
Example:
helm upgrade --install -f ./k8s/values.yaml --set-string deployment.type=cutover --set-string deployment.color=blue webrtc-ingress wrtchelmrepodevwestus2/webrtc-service --version=0.1.93 -n webrtc
Deploy
You need to use PersistentVolume and PersistentVolumeClaim instead of HostPath logs of Gateway pods and CoTurn Pods.
Validate the deployment
Follow the steps given below to validate the deployment in OpenShift
- Verify PVCs are created and bound
kubectl get pvc
- Sample output:
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE webrtc-coturn-log-pvc Bound webrtc-coturn-log-volume 5Gi RWX genesys-webrtc 110s webrtc-gateway-log-pvc Bound webrtc-gateway-log-volume 5Gi RWX genesys-webrtc 110s
- Validate CoTurn and Gateway services
kubectl get svc
- Sample output:
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE webrtc-coturn-service-blue LoadBalancer 10.202.51.156 192.168.30.208 443:31457/TCP 67m webrtc-gateway-service-blue ClusterIP 10.202.47.170 <none> 80/TCP,8080/TCP 67m
- Query pods in the WebRTC namespace to confirm that pod is created, and in running status
kubectl get pods
- Sample output:
NAME READY STATUS RESTARTS AGE webrtc-coturn-blue-b5db74c96-mh9jv 1/1 Running 0 4m20s webrtc-gateway-blue-d7ff45677-vbdg9 1/1 Running 0 86s
- Validate Ingress configuration
kubectl get ingress
- Sample output:
NAME CLASS HOSTS ADDRESS PORTS AGE webrtc-ingress-int <none> webrtc.apps.vce-c0.eps.genesys.com,webrtc-test.apps.vce-c0.eps.genesys.com 80 68s
- Validate Ingress Edge route configuration
kubectl get route
- Sample output:
NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD webrtc-gateway-service-blue webrtc.apps.qrtph6qa.westus2.aroapp.io webrtc-gateway-service-blue web edge None webrtc-ingress-int-cvdtt webrtc.apps.qrtph6qa.westus2.aroapp.io / webrtc-gateway-service-blue web None webrtc-ingress-int-trcvh webrtc.apps.qrtph6qa.westus2.aroapp.io /blue webrtc-gateway-service-blue web None webrtc-ingress-int-wf6x9 webrtc-test.apps.qrtph6qa.westus2.aroapp.io /blue webrtc-gateway-service-blue web None
- Query Ingress for exposed WebRTC Web API
kubectl get ingress
- Copy the WebRTC API from the Ingress output:
- Sample output:
NAME CLASS HOSTS ADDRESS PORTS AGE webrtc-ingress-int <none> webrtc.apps.vce-c0.eps.genesys.com,webrtc-test.apps.vce-c0.eps.genesys.com 80 3h26m
- Curl WebRTC "ping" API:
curl -s webrtc.apps.vce-c0.eps.genesys.com/ping {"state":"up","version":"9.0.000.89","path":"blue"}