To get started with docker-compose:
docker compose up -d
To get started with Kubernetes cluster using Minikube Note: the image repository is in my account in dockerhub
// Start minikube
minikube start
// Apply services and deployments
kubectl apply -f deployment.yaml
kubectl apply -f service.yaml
// To see it locally, you have to forward port 80 to your desired port on your local machine
kubectl port-forward service/my-service 3000:80
// When you finished, you can cleanup by deleting the service and deployments
kubectl delete service --all
kubectl delete deployment --all
UI way - https://argo-cd.readthedocs.io/en/stable/getting_started/#creating-apps-via-ui
CLI way -
kubectl config set-context --current --namespace=argocd
argocd app create pro690-app \
--repo https://github.com/zrakhimov/pro690-final.git \
--path k8s \
--dest-server https://kubernetes.default.svc \
--dest-namespace default
kubectl config set-context --current --namespace=default
// When you finished, you can cleanup by deleting the service and deployments
kubectl delete service --all
kubectl delete deployment --all
kubectl delete rollout --all
kubectl delete application --all
kubectl create namespace argo-rollouts
kubectl apply -n argo-rollouts -f https://github.com/argoproj/argo-rollouts/releases/latest/download/install.yaml
kubectl argo rollouts get rollout my-rollout --watch
kubectl argo rollouts set image my-rollout \
my-rollout=zrakhimov/pro690-image:v2
Once the weight reaches 20% it pauses and needs to be continued manually. It's set in the rollout.yaml file
kubectl argo rollouts promote my-rollout
I called it my-cluster
in azure.
az login
You'd need to have Azure CLI and kubectl installed.
az aks get-credentials --name my-cluster --resource-group pro690-resource-group
/// Merged "my-cluster" as current context in /Users/zokir/.kube/config
Basically at this point i have 2 contexts. First one is in my local machine called "minikube" Second is called "my-cluster" which is AKS To get the list of contexts run:
kubectl config get-contexts
To switch contexts:
kubectl config use-context my-cluster
Needed to pull the image when yaml is applied.
docker login -u zrakhimkov
Pre-req: Make sure to create argo cd (step 1) and argo rollout (step 1) namespaces and installations
You need to login to argo cd
argocd login localhost:8080
Create the app
argocd app create pro690-app \
--repo https://github.com/zrakhimov/pro690-final.git \
--path k8s \
--dest-server https://kubernetes.default.svc \
--dest-namespace default
application 'pro690-app' created
See it in the UI (localhost:8080 )
kubectl port-forward svc/argocd-server -n argocd 8080:443
You can try to open up a port 3000 on your local machine with one of the pod's name
kubectl port-forward my-rollout-fcd5db656-hrc6g 3000:8080
Head to localhost:3000, you should be able to see it
- Change the image to v2 in rollout.yaml
- Push it to git
- Sync argo cd
- It'll pause at 20%
- THen promote the rest
kubectl argo rollouts promote my-rollout