Deploy a new version of the application in AKS (Less than 5 min)
Imperative approach...
Introduction
In my previous blog, we described the pod deployment and exposing the app to the internet. Now, let me walk through the steps to release a new version of the application. We have two application versions in the Docker repository and they are listed below
Steps (High Level)
- Build an HTML static web application – Content is of your choice
- Dockerize the application
- Tag and publish to the Docker hub
- Deploy the containerized application in the AKS
- Release a newer version of the application in the AKS
HTML Code & Dockerfile Content
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AKS</title>
<link rel="stylesheet" href="https://cdn.metroui.org.ua/v4.3.2/css/metro-all.min.css">
<link href='https://fonts.googleapis.com/css?family=Montserrat' rel='stylesheet'>
<style>
body {
font-family: 'Montserrat';
font-size: 22px;
}
</style>
</head>
<body>
<hr>
<h3 style="text-align: center;">AKS | NGINX | VERSION </h3>
<hr>
<!-- <p style="text-align: center;">Application Version 1.0.0 | Docker tag 1.0.0</p>
<div data-role="cube" data-cells="10" data-margin="2"></div> -->
<p style="text-align: center;">Application Version 2.0.0 | Docker tag 2.0.0</p>
<div data-role="cube" data-color="bg-cyan bd-darkCyan" data-flash-color="#aa00ff"></div>
<script src="https://cdn.metroui.org.ua/v4/js/metro.min.js"></script>
</body>
</html>
FROM nginx
COPY home.html /usr/share/nginx/html
Build & Tag (Version 1.0)
PS C:\Projects\Collabrains.Cloud> docker build -t chenv/collabrains-cloud:1.0.0 .
Push to Docker Hub - V1
PS C:\Projects\Collabrains.Cloud> docker push chenv/collabrains-cloud:1.0.0
Build & Tag (Version 2.0)
PS C:\Projects\Collabrains.Cloud> docker build -t chenv/collabrains-cloud:2.0.0 .
Push to Docker Hub - V2
PS C:\Projects\Collabrains.Cloud> docker push chenv/collabrains-cloud:2.0.0
Create Deployment
PS C:\Projects\Collabrains.Cloud> kubectl create deployment collabrains-cloud --image=chenv/collabrains-cloud:1.0.0
Expose
PS C:\Projects\Collabrains.Cloud> kubectl expose deployment collabrains-cloud --type=LoadBalancer --port=80 --target-port=80 --name=collabrains-cloud-service
New Version (2.0.0)
PS C:\Projects\Collabrains.Cloud> kubectl set image deployment/collabrains-cloud collabrains-cloud=chenv/collabrains-cloud:2.0.0 --record=true
Summary
Awesome, now that we know the basics of Pods, updating deployments. There are lot more coming up in future, please feel free to subscribe to my YouTube channel - iAutomate and follow me on twitter ChendrayanV
Comments
Nothing yet.