The past is relevant only as data
15 MINUTE PRACTICE
Using Argo CD, GitOps continuous delivery tool for Kubernetes, you will be able to reproduce easily the environment of the Mysterious Apps.
Sync/Deploy The GitOps Application
From the Application menu,click on your 'staging-project%USER_ID%' application
The application status is initially in yellow OutOfSync state since the application has yet to be deployed into staging-project%USER_ID% OpenShift project, and no Kubernetes resources have been created.
Now let’s deploy the Coolstore Application into staging-project%USER_ID%.
Click on 'Sync > Synchronize'.
This task retrieves the manifests from the GitOps Repository and performs kubectl apply command of the manifests. Your application is now running. You can now view its resource components, logs, events, and assessed health status.
You should see everything in green.
Controlling Ingress Traffic
The Application deployed is using Istio (covered in the next lab). To be able to access the application from outside of the cluster we have to expose a specific service reachable externally, this service is called Istio Gateway. A Gateway allows Istio features such as monitoring and route rules to be applied to traffic entering the cluster.
To open a '>_ workshop_tools' terminal window in CodeReady Workspaces, click on 'Terminal' → 'Open Terminal in specific container' → 'workshop-tools'
|
In your Workspace, create the Istio Gateway and its VirtualService by executing the following commands in the '>_ workshop_tools' terminal window
cat <<EOF | oc apply --namespace=staging-project%USER_ID% -f -
---
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: istio-gateway%USER_ID%
spec:
selector:
istio: ingressgateway # use Istio default gateway implementation
servers:
- port:
number: 80
name: http
protocol: HTTP
hosts:
- "gateway-staging-project%USER_ID%.%APPS_HOSTNAME_SUFFIX%"
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: gateway
spec:
hosts:
- "gateway-staging-project%USER_ID%.%APPS_HOSTNAME_SUFFIX%"
gateways:
- istio-gateway%USER_ID%
http:
- route:
- destination:
port:
number: 8080
host: gateway
EOF
Then use the new OpenShift Route in the Web Service by executing the following commands in the '>_ workshop_tools' terminal window
oc set env deployment/web COOLSTORE_GW_ENDPOINT=http://gateway-staging-project%USER_ID%.%APPS_HOSTNAME_SUFFIX% -n staging-project%USER_ID%
Testing the application
In the OpenShift Web Console, from the Developer view,
select the staging-project%USER_ID% to be taken to the project overview page.
You can see that all resources of your application have been created by Argo CD.
Then, click on the 'Open URL' icon of the Web Service.
Your browser will be redirect to your Web Service running on OpenShift. You should be able to see the CoolStore application with all products and their inventory status.
Now, you are now ready to tackle all the problemS!
