- You Have to know about Multi Docker Conatiner on this project?
- run deployment in local cluster
- How to deploy k8s in GKE and Azure Cluster?
- Lets understand how to configure Travis CI pipeline for this project.
if you want to understand about docker container in this project. you have to see first Multi Docker Container. or you can continue from here Multi-Docker-Conatiner
-
kubectl apply -f ./k8s-dev
- first enable billing in your GCP Project
- create a GKE cluster
- open cloud shell
- install helm
- run the following command
gcloud config set project $PROJECT_ID
gcloud config set compute/zone $ZONE
gcloud container clusters get-credentials $CLUSTER_NAME
git clone https://github.com/hamzazahidulislam/multi-k8s-pod && cd multi-k8s-pod
kubectl apply -f ./k8s-prod
- link bank card in Azure dashboard
- create a AKS cluster
- open cloud shell
- install helm and setup ingress with helm
- run the following command
az account set --subscription $SUBSCRIPTION_ID
az aks get-credentials --resource-group $RESOURCE_GROUP_NAME --name $CLUSTER_NAME
git clone https://github.com/hamzazahidulislam/multi-k8s-pod && cd multi-k8s-pod
kubectl apply -f ./k8s-prod
This is main document: https://helm.sh/docs/intro/install/
$ curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3
$ chmod 700 get_helm.sh
$ ./get_helm.sh
This is main document: Ingress-Nginx-with-Helm
configure travis ci /cd what i do create github repository and link with travis ci. when we configure travis in github we have to remember we need to secure my cloud access json file need to me secured
- 1 Travis Login
- 2 add environment variable in Travis CI
$ docker run -it -v ${pwd}:/app ruby:2.7 sh
$ docker run -it -v $(pwd):/app ruby:2.7 sh
$ gem update --system
$ gem install travis
$ travis
$ travis login
$ travis login --pro --github-token xxx-xxx-xxx
$ travis encrypt-file service-account.json -r hamzazahidulislam/multi-k8s-pod
add docker DOCKER_USERNAME and DOCKER_PASSWORD for Travis CI build docker image and push on docker hub
$ kubectl create secret generic pgpassword --from-literal PGPASSWORD=mypgpassword123
$ kubectl create serviceaccount --namespace kube-system tiller
$ kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
$ helm init --service-account tiller -upgrade
$ kubectl get certificates
$ kubectl describe certificates
$ kubectl get secrets
$ skaffold dev
-
init container is dependence container what is mean by that. for example you have a backend application need to connect database. backend application can't run berfore database it's neeed to database run first after backend application connected
-
i want to show you practical example of how to init container work
create a postgres container and run it
docker run --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgres
and inspect the postgres container
docker inspect some-postgres | grep IPAddress
second create a alpine container and run it
docker run -it --network host --name my_alpine alpine
after i inside alpine container
nc -zvw1 $some-postgres.IPAddress 5432 && exit 0
-
Pipe, Grep and Sort Command in Linux
-
Netcat Command in Linux