Ir a servicios de educacion https://portal.azure.com/?Microsoft_Azure_Education_correlationId=38ee253f-70d4-4036-860a-e7d12984e10e&Microsoft_Azure_Education_newA4E=true&Microsoft_Azure_Education_asoSubGuid=33293b73-c2da-4f57-81cb-0e919b5bd77b#home
Ir a servicios de kubernet https://portal.azure.com/?Microsoft_Azure_Education_correlationId=38ee253f-70d4-4036-860a-e7d12984e10e&Microsoft_Azure_Education_newA4E=true&Microsoft_Azure_Education_asoSubGuid=33293b73-c2da-4f57-81cb-0e919b5bd77b#browse/Microsoft.ContainerService%2FmanagedClusters
Selecciona crear cluster de kubernet
nano internal_lb.yaml
Ai, asi tal cual lo que esta en los corchete <apiVersion: v1
kind: Namespace
metadata:
name: wordpress-namespace
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: mariadb-deployment
namespace: wordpress-namespace
labels:
app: mariadb
spec:
replicas: 1
selector:
matchLabels:
app: mariadb
template:
metadata:
labels:
app: mariadb
spec:
containers:
- name: mariadb
image: mariadb:latest
ports:
- containerPort: 3306
env:
- name: MYSQL_ROOT_PASSWORD
value: "example"
- name: MYSQL_DATABASE
value: "wordpress"
- name: MYSQL_USER
value: "user"
- name: MYSQL_PASSWORD
value: "password"
resources:
requests:
memory: "256Mi"
cpu: "250m"
limits:
memory: "512Mi"
cpu: "500m"
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: wordpress-deployment
namespace: wordpress-namespace
labels:
app: wordpress
spec:
replicas: 3
selector:
matchLabels:
app: wordpress
template:
metadata:
labels:
app: wordpress
spec:
containers:
- name: wordpress
image: wordpress:latest
ports:
- containerPort: 80
env:
- name: WORDPRESS_DB_HOST
value: "mariadb-service:3306"
- name: WORDPRESS_DB_USER
value: "user"
- name: WORDPRESS_DB_PASSWORD
value: "password"
- name: WORDPRESS_DB_NAME
value: "wordpress"
resources:
requests:
memory: "256Mi"
cpu: "250m"
limits:
memory: "512Mi"
cpu: "500m"
---
apiVersion: v1
kind: Service
metadata:
name: mariadb-service
namespace: wordpress-namespace
labels:
app: mariadb
spec:
type: ClusterIP
selector:
app: mariadb
ports:
- protocol: TCP
port: 3306
targetPort: 3306
---
apiVersion: v1
kind: Service
metadata:
name: wordpress-loadbalancer
namespace: wordpress-namespace
labels:
app: wordpress
spec:
type: LoadBalancer
selector:
app: wordpress
ports:
- protocol: TCP
port: 80
targetPort: 80
>
CONTROL X CONTROL Y
kubectl config current-contextkubectl create namespace wordpress-namespacekubectl apply -f internal_lb.yamlkubectl get services -n wordpress-namespace
No hay comentarios.:
Publicar un comentario