This is a folk of a GCP demo add set to run on ICP.
-
Install tools specified in the previous section (Docker, kubectl, skaffold)
-
Connect to an ICP Cluster
-
Create a namespace with correct permissions
kubectl create namespace microservice-demo -
Switch to it
kubens microservice-demo -
Apply a role bindings to the namespace to ensure pods run with non-root access
kubectl apply -f icp/cluster-role.yamlNot applying permissions will results in:
Error: container has runAsNonRoot and image will run as rootas ICP is restrictive about how containers can run by default as explained in this article.
-
Deploy the application
kubectl apply -f ./release/kubernetes-manifests.yaml -
Run
kubectl get podsto see pods are in a Ready state. -
frontend-external was set as a LoadBalancer. A LoadBalancer is not currently configured for ICP so change the type from LoadBalancer to NodePort in release/kubernetes-manifests.yaml.
-
Find the assigned your application, then visit the application using the IP address of a worker node and with that port in the browser.
kubectl get service/frontend-externalkubectl get nodes