-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCommandsDotnet.txt
More file actions
77 lines (47 loc) · 1.91 KB
/
CommandsDotnet.txt
File metadata and controls
77 lines (47 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
1) Create a Container Registry, Enable Admin access
2) Git Clone http://bit.ly/dotnetcorews into Cloud Shell
3) Push Image to your ACR Repo
az acr build --registry ncdev --image helloworld:1.0 .
[FOr the Vote App]
az acr build --registry ncdev --image vote-app:1.0 .
5) Create ACI instance
ncdev.azurecr.io/helloworld:1.0
====================
Kubernetes
1) Create AKS cluster
2) Create Image pull secret
kubectl create secret docker-registry regcred --docker-server=ncdev.azurecr.io --docker-username=ncdev --docker-password=Lu/3aD7Uu46PAYN9Ocpb1sZ9Q4nHSit1
3) Connect to AKS Cluster
az aks get-credentials --resource-group DotnetCoreWorkshop --name dotnetcore-workshop
4) Deploy Application
kubectl create -f ./k8s-deploy-aks.yaml
============================
K8S Tasks
[Register Microsoft.Networks resource provider]
1) Create cluster role binding
kubectl create clusterrolebinding kubernetes-dashboard --clusterrole=cluster-admin --serviceaccount=kube-system:kubernetes-dashboard
2) Run
az aks browse --resource-group DotnetCoreWorkshop --name dotnetcore-workshop
3) Auto-scale deployment
kubectl autoscale deployment vote-app-deployment --cpu-percent=50 --min=3 --max=6
4) Scale nodes
az aks scale --resource-group DotnetCoreWorkshop --name dotnetcore-workshop --node-count 2
======
MISC
Cleaning up
docker rm -v $(docker ps -a -q -f status=exited)
kubectl config set-context --current --namespace=multi-tier-app
=========
1) dotnet new mvc
2) dotnet dev-certs https --trust
trust the dev certificate
3) dotnet add package Microsoft.Extensions.Caching.StackExchangeRedis --version 3.0.1
Install Redis client
Local Build
1) Tag the image
(if local)
docker image tag helloworld:dev ncdev.azurecr.io/helloworld-dotnetcore:1.0
docker build -t ncdev.azurecr.io/helloworld:1.0 .
2) Login to ACR
docker login -u ncdev -p Lu/3aD7Uu46PAYN9Ocpb1sZ9Q4nHSit1 ncdev.azurecr.io
3) docker image push ncdev.azurecr.io/helloworld:1.0