Deployment
Site Application Deployment in Kubernetes Cluster
Prerequisites
-
To install the Site Application in Kubernetes, the system must have the kubectl command-line utility installed. It can be downloaded from the following official link
-
This kubectl command-line utility will be helpful in communicating with the cluster and setting up and managing the deployment of various resources.
Deployment
- Export the path of the downloaded configuration file of the cluster so that we can eliminate calling the configuration file multiple times:
bash
export KUBECONFIG=/path/to/config.yaml
- We need to enable the default namespace with istio as it will run the sidecar pods that will get the telementry information of our pods deployed in the default namespace.
kubectl label ns default istio-injection=enabled
- Now download the servercp.sh script from the productline site and change the permissions to make the script executable:
chmod +x servercp.sh
-
Run the script and it will prompt for inputs related to the domain name and it's SSL certificates(use full chained certificate). Make sure you have the SSL certificate and key stored locally to enter the path.
-
It also prompts for the storage size that will be allocated to the main storage for the application pod to be up and running. Enter only in multiples of 10s.
-
For demo scenarios and non-production environments, you can use the MySQL pod as the backend database, so it will prompt for the password as well. Please remember the password as it is important to enter during the application configuration.
-
Once you enter all the details, a folder gets created at the same path named "manifests" where all the manifest files are deployed.
-
Now we need to install all the manifests into the cluster. To do so, run the following command:
kubectl apply -f manifests/
-
With the above command, all the pods, services, and necessary Kubernetes objects are created.
-
Until now, we have configured the Domain and Networking for the cluster. Use the following command and copy the output:
kubectl get svc istio-ingressgateway -n istio-system -o wide \| awk
\'{print \$4}\' \| grep -v EXTERNAL-IP
- Now copy the IP address or CNAME from the output of the above command and map the same with your domain name manager (e.g., Cloudflare). Now we can access the domain name from the internet.