Kubernetes Sample App
This guide will walk you through deploying a "Online Boutique" sample application to a Kubernetes cluster.
Prerequisites
Ensure you have the following requirements:
- Shell environment with
git
, andkubectl
. - An OpenScaler Kubernetes Cluster with at least 8GB of RAM in total for worker nodes (see How to create an OpenScaler Kubernetes cluster)
- Make sure you have your Kubernetes cluster credentials set (see how to get access to your cluster).
Important
By default, only worker nodes run your services. If you're using a single node or two nodes with 4GB RAM each, make sure to enable task scheduling on all nodes:
Deploying the Sample Application
Clone the sample app
Clone the latest major version of the sample application
The --depth 1
argument skips downloading git history.
Deploy the sample app
From the root folder of this repository, navigate to the kustomize/
directory.
See what the default Kustomize configuration defined by kustomize/kustomization.yaml
will generate (without actually deploying them yet).
Apply the default Kustomize configuration (kustomize/kustomization.yaml
).
Access your Online Boutique application
You now have two options to access your Online Boutique application
- Option 1 : Access Application locally with port forwarding
- Option 2 : Access Application with Ingress through a Load Balancer.
Access Application locally with port forwarding
-
Forward the frontend service to your local machine
-
Done! You may now access your Online Boutique application at
http://localhost:8080
(orhttp://<your-local-ip>:8080
if you used the--address 0.0.0.0
flag)
Access Application with Ingress
Since the application already has an Ingress resource configured, all you need to do is to create a LoadBalancer :
- Head to your Kubernetes cluster page choose your cluster from the list
- Create a LoadBalancer for your cluster from the "Network" tab and install your Ingress Controller (as described in the "Network" tab)
- Find your load balancer's HTTP port (for example
9039
) (follow guide in the "Network" tab) - Done! you can now access your Online Boutique application at
http://k8s.alpha.openscaler.net:YOUR_INGRESS_PORT
(replaceYOUR_INGRESS_PORT
with the port you found in the previous step)