The Kubernetes command-line tool, kubectl, allows you to run commands against Kubernetes clusters. You can use kubectl to deploy applications, inspect and manage cluster resources, and view logs. For more information including a complete list of kubectl operations, see the kubectl
reference documentation.
kubectl is installable on a variety of Linux platforms, macOS and Windows. Find your preferred operating system below.
clone source code from this repo to provision the infrastructure on Alibaba Cloud using terraform configuration:
git clone https://github.com/knpubscripts/alicloud-terraform.git
Or visit the repo link to see the details: https://github.com/knpubscripts/alicloud-terraform
Wait about 10-15 minutes to ACK cluster created, go to: Cluster Information > Connection Information > Public Access (tab) > Copy the content to $HOME/.kube/config on your local computer.
Then you can use the kubectl to interact and control ACK cluster from your computer.
kubectl apply -f mongo-secret.yaml
kubectl apply -f mongo.yaml
kubectl apply -f mongo-configmap.yaml
kubectl apply -f mongo-express.yaml
kubectl apply -f nginx-ingress.yaml
Get the external IP of nginx-ingress, go to your dns management system, point record A of your domain or sub-domain to this IP.
kubectl get pod
kubectl get pod --watch
kubectl get pod -o wide
kubectl get service
kubectl get secret
kubectl get all | grep mongodb
kubectl describe pod mongodb-deployment-xxxxxx
kubectl describe service mongodb-service
kubectl logs mongo-express-xxxxxx
Install helm
Install Helmify tool to help automatically convert manifest yamls files to helm chart file
go to source code folder and run command:
awk 'FNR==1 && NR!=1 {print "---"}{print}' ./*.yaml | helmify ackdemo
Now we have our helm chart, just run helm install
command to deploy the application.
helm install ackdemo ./ackdemo