Hello,
I have successfuly compleleted the task, but when I clicked on the Check button I got this >;
My defintion file;
apiVersion: v1
kind: PersistentVolume
metadata:
name: mysql-pv
spec:
capacity:
storage: 250Mi
accessModes:
- ReadWriteOnce
hostPath:
path: "/data"
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mysql-pv-claim
spec:
resources:
requests:
storage: 250Mi
accessModes:
- ReadWriteOnce
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: mysql-deployment
name: mysql-deployment
spec:
replicas: 1
selector:
matchLabels:
app: mysql-deployment
template:
metadata:
labels:
app: mysql-deployment
spec:
volumes:
- name: mysql-vol-pv
persistentVolumeClaim:
claimName: mysql-pv-claim
containers:
- image: mysql
name: mysql
volumeMounts:
- name: mysql-vol-pv
mountPath: /var/lib/mysql
env:
- name: MYSQL_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: mysql-root-pass
key: password
- name: MYSQL_DATABASE
valueFrom:
secretKeyRef:
name: mysql-db-url
key: database
- name: MYSQL_USER
valueFrom:
secretKeyRef:
name: mysql-user-pass
key: username
- name: MYSQL_PASSWORD
valueFrom:
secretKeyRef:
name: mysql-user-pass
key: password
---
apiVersion: v1
kind: Service
metadata:
name: mysql
spec:
type: NodePort
selector:
app: mysql-deployment
ports:
- port: 3306
nodePort: 30007
kubectl get secrets -oyaml
apiVersion: v1
items:
- apiVersion: v1
data:
database: a29kZWtsb3VkX2RiMgo=
kind: Secret
metadata:
creationTimestamp: "2024-01-13T13:24:59Z"
name: mysql-db-url
namespace: default
resourceVersion: "10933"
uid: 9c429bbb-94c9-45a6-a4d2-1568d8bb397c
type: Opaque
- apiVersion: v1
data:
password: WVVJaWRoYjY2Nwo=
kind: Secret
metadata:
creationTimestamp: "2024-01-13T13:05:59Z"
name: mysql-root-pass
namespace: default
resourceVersion: "9495"
uid: a7cb8c42-8d0b-4705-afeb-b6dfc18a7d79
type: Opaque
- apiVersion: v1
data:
password: QnJ1Q1N0bk1UNQo=
username: a29kZWtsb3VkX2pveQo=
kind: Secret
metadata:
creationTimestamp: "2024-01-13T13:09:05Z"
name: mysql-user-pass
namespace: default
resourceVersion: "9795"
uid: d55c4cbb-ac3a-4687-86b9-fd349e8921f0
type: Opaque
kind: List
metadata:
resourceVersion: ""
PS: I used echo -e "x" | base64
to create the secrets.