Refer the
previous two blogs for details of the Kubernetes and the commands mentioned
here
1. az group create
--name=myKubernetesWindowsResourceGroup --location="Southeast Asia"
2. az acs create
--orchestrator-type=kubernetes --resource-group
myKubernetesWindowsResourceGroup --name=myKubernetesClusterName
--dns-prefix=mydnsPrefix --agent-count=2 --generate-ssh-keys --windows
--admin-username girish --admin-password basava123#
3. az acs kubernetes install-cli
4. PS C:\Program Files (x86)> az acs
kubernetes get-credentials --resource-group=myKubernetesWindowsResourceGroup
--name=myKubernetesWindowsCluster
5. PS C:\Program Files (x86)>
.\kubectl.exe get pods
6. PS C:\Program Files (x86)>
.\kubectl.exe create secret
docker-registry myregistrykey --docker-server=https://acrgirish.
azurecr.io
--docker-username=ACRgirish --docker-password=K7/n0/8r9zt9AIg+JCftoC6Dyzrg=4rf
--docker-email=ANY_EMAIL_ADDRESS
7.
PS C:\Program Files
(x86)> .\kubectl.exe create -f C:\Users\aditi\Desktop\K8\Deployment.json
8.
PS C:\Program Files
(x86)> .\kubectl.exe create -f C:\Users\aditi\Desktop\K8\Service.json
Service.json
file
{
"apiVersion": "v1",
"kind": "Service",
"metadata": {
"name": "musicstoreapp"
},
"spec": {
"selector": {
"app": "musicstoreapp"
},
"type": "LoadBalancer",
"ports": [{
"port": 80
}]
}
}
Deployment.json
file
{
"apiVersion": "extensions/v1beta1",
"kind": "Deployment",
"metadata": {
"name": "musicstoreapp"
},
"spec": {
"replicas": 2,
"template": {
"metadata": {
"labels": {
"app": "musicstoreapp"
}
},
"spec": {
"containers": [{
"name": "musicstore",
"image": "acrgirish.azurecr.io/mvcmusicstore",
"ports": [{
"containerPort": 80
}]
}],
"imagePullSecrets": [{
"name": "myregistrykey"
}]
}
}
}
}
No comments:
Post a Comment