Boa noite, eu fiz o último passo a passo do capítulo 4, mas ao rodar a aplicação os erros no banco permaneceram, não sei se eu errei algo nos arquivos.
Warning: mysqli_connect(): Server sent charset (255) unknown to the client. Please, report to the developers in /var/www/html/conecta.php on line 4
Warning: mysqli_connect(): (HY000/2054): Server sent charset unknown to the client. Please, report to the developers in /var/www/html/conecta.php on line 4
Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in /var/www/html/banco-categoria.php on line 7
Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, null given in /var/www/html/banco-categoria.php on line 8
pod-banco.yaml:
apiVersion: v1
kind: Pod
metadata:
name: mysql
spec:
containers:
- name: container-mysql
image: mysql
ports:
- containerPort: 3306
env:
- name: MYSQL_DATABASE
value: "loja"
- name: MYSQL_USER
value: "root"
- name: MYSQL_ALLOW_EMPTY_PASSWORD
value: "1"
statefulset.yaml:
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
name: statefulset-mysql
spec:
serviceName: db
template:
metadata:
labels:
name: mysql
spec:
containers:
- name: container-mysql
image: mysql
ports:
- containerPort: 3306
env:
- name: MYSQL_DATABASE
value: "loja"
- name: MYSQL_USER
value: "root"
- name: MYSQL_ALLOW_EMPTY_PASSWORD
value: "1"
volumeMounts:
- name: volume-mysql
mountPath: /var/lib/mysql
volumes:
- name: volume-mysql
persistentVolumeClaim:
claimName: configuracao-mysql
servico-banco.yaml:
apiVersion: v1
kind: Service
metadata:
name: db
spec:
type: ClusterIP
ports:
- port: 3306
selector:
name: mysql
permissoes.yaml:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: configuracao-mysql
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 3Gi
Obrigado.