LAB SCENARIO:
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684505865394/6af21bd9-db12-4981-b9d4-2a2de799f707.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684505929872/6a89539d-66df-4565-840c-e1d19b03a7ff.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684503371536/971cdabf-bef6-4e26-b75d-e906f7274839.png)
Create the Secret:
echo -n 'administrator' | base64
echo -n 'Admin123@@@' | base64
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684498242208/7a5b0f25-b071-4fc5-88e0-3ea5b13a004b.png)
vim secret.yml
# mysecret.yml
apiVersion: v1
kind: Secret
metadata:
name: mysecret
type: Opaque
data:
username: YWRtaW5pc3RyYXRvcg==
password: QWRtaW4xMjNAQEA=
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684500755172/c50c91a3-1428-4039-b552-2b67be949844.png)
microk8s kubectl apply -f secret.yml
microk8s kubectl get secret
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684500716376/5f8ec698-d7ad-4ab9-a8e9-c80cf41818e9.png)
Download the MySQL/WordPress deployment configuration file.
curl -LO https://k8s.io/examples/application/wordpress/mysql-deployment.yaml
curl -LO https://k8s.io/examples/application/wordpress/wordpress-deployment.yaml
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684498516753/d1b89eaa-74cc-465b-87c3-e05ab48532e1.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684498593237/bb921831-3aa2-4438-a25f-65e7824a5443.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684502194307/94e1e3b6-311f-40f7-981b-7f2f4488abb8.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684501888837/3b5ecc55-9d2d-49a4-8b68-362349fd4ec2.png)
Apply Deployment Files:
microk8s kubectl apply -f mysql-deployment.yaml
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684503039308/59d39f7b-0672-4e26-9bd6-619c32e118f9.png)
microk8s kubectl apply -f wordpress-deployment.yaml
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684502959424/ca65204d-dfd3-4c22-9229-3264cd996c87.png)
microk8s kubectl get po
microk8s kubectl get po -o wide
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684502908402/94aafd8e-dfc0-4a2d-b259-3ff91bb013dd.png)
Persistent Volume Claim for both deployments:
microk8s kubectl get pvc
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684502351434/5d4f2b46-667c-4798-ac5e-ecd9644b22f7.png)
Service configured with Load Balance:
microk8s kubectl get services wordpress
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684502683025/aa9d1cf9-180b-4f1e-9df0-87256ab09ab9.png)
microk8s kubectl get deployment
microk8s kubectl get ns
microk8s kubectl get svc
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684503371536/971cdabf-bef6-4e26-b75d-e906f7274839.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684502552967/2e3fc1bf-41f3-4531-9305-70229d90fd79.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684502629929/74646675-a602-4314-9b04-0c9463e414aa.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684502761102/404e2829-a025-43b1-898c-e3a5077fc8ba.png)
No comments:
Post a Comment