Skip to content

Commit 75f0962

Browse files
committed
Creadas las carpetas para las demos de AKS
1 parent 227cff5 commit 75f0962

File tree

5 files changed

+119
-0
lines changed

5 files changed

+119
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# https://www.returngis.net/2019/04/azure-kubernetes-service-tu-cluster-manejado-en-la-nube/
2+
#Create an azure-cli container
3+
docker run -it --rm microsoft/azure-cli sh
4+
5+
#Login
6+
az login
7+
8+
#Select your subscription account
9+
az account set -s "Microsoft Azure Internal Consumption"
10+
11+
#Create a resource group
12+
RESOURCE_GROUP="AKS-Demo"
13+
LOCATION="northeurope"
14+
15+
az group create -n ${RESOURCE_GROUP} -l ${LOCATION}
16+
17+
#Create a cluster
18+
AKS_NAME="gisaks"
19+
20+
az aks create -g ${RESOURCE_GROUP} -n ${AKS_NAME} \
21+
--node-count 1 --generate-ssh-keys
22+
23+
#Install kubectl if you don't have it
24+
az aks install-cli
25+
26+
#configure kubectl to comunicate with out AKS cluster
27+
az aks get-credentials -g ${RESOURCE_GROUP} -n ${AKS_NAME}
28+
29+
#Check kubectl version
30+
kubectl version --short
31+
32+
kubectl get nodes
33+
34+
kubectl get services --all-namespaces
35+
36+
#Access Kubernetes Dashboard
37+
az aks browse -g ${RESOURCE_GROUP} -n ${AKS_NAME}
38+
39+
#Giving permissions
40+
kubectl create clusterrolebinding kubernetes-dashboard -n kube-system --clusterrole=cluster-admin --serviceaccount=kube-system:kubernetes-dashboard
41+
42+
#Scale cluster
43+
az aks scale -g ${RESOURCE_GROUP} -n ${AKS_NAME} --node-count 3
44+
45+
#delete the resource group and the cluster
46+
az group delete -n ${RESOURCE_GROUP}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#Variables
2+
RESOURCE_GROUP="AKS-Demo"
3+
AKS_NAME="gisaks"
4+
5+
#Enable Azure Dev Spaces
6+
az aks use-dev-spaces -g ${RESOURCE_GROUP} -n ${AKS_NAME}
7+
8+
# https://www.returngis.net/2020/05/depurar-aplicaciones-en-kubernetes-con-azure-dev-spaces-y-visual-studio-code/
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# https://www.returngis.net/2020/06/escalado-rapido-y-puntual-de-tus-pods-con-virtual-kubelet/
2+
3+
4+
#Crear clúster de prueba
5+
# Variables
6+
RESOURCE_GROUP="Kubelet-Demo"
7+
AKS_NAME="returngis"
8+
LOCATION="northeurope"
9+
10+
# Create an AKs cluster
11+
az group create -n $RESOURCE_GROUP -l $LOCATION
12+
az aks create --resource-group $RESOURCE_GROUP --name $AKS_NAME --node-count 1 --generate-ssh-keys
13+
14+
# Get AKS context
15+
az aks get-credentials -n $AKS_NAME -g $RESOURCE_GROUP
16+
17+
kubectl get pods -o wide
18+
19+
#Desplegar Virtual Kubelet con el conector para Azure Container Instances
20+
#Install Helm 2
21+
brew install helm@2
22+
brew link --force --overwrite helm@2
23+
24+
kubectl create serviceaccount tiller --namespace kube-system
25+
kubectl create clusterrolebinding tiller-role-binding --clusterrole cluster-admin --serviceaccount=kube-system:tiller
26+
helm init --service-account tiller --upgrade
27+
28+
#Install ACI Connector for Kubelet
29+
az aks install-connector --resource-group $RESOURCE_GROUP --name $AKS_NAME --connector-name aciconnector
30+
31+
kubectl get nodes
32+
33+
kubectl describe node virtual-kubelet-aciconnector-linux-northeurope
34+
35+
kubectl get pods -o wide
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: nginx-deployment
5+
labels:
6+
app: nginx
7+
spec:
8+
replicas: 3
9+
selector:
10+
matchLabels:
11+
app: nginx
12+
template:
13+
metadata:
14+
labels:
15+
app: nginx
16+
spec:
17+
containers:
18+
- name: nginx
19+
image: nginx
20+
ports:
21+
- containerPort: 80
22+
resources:
23+
requests:
24+
memory: 1.5G
25+
cpu: 1
26+
tolerations:
27+
- key: virtual-kubelet.io/provider
28+
value: azure
29+
effect: NoSchedule

04-cloud/00-aks/03-keda/03-keda.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# https://www.returngis.net/2020/06/autoescalar-tus-aplicaciones-en-kubernetes-con-keda/

0 commit comments

Comments
 (0)