Olá pessoal, tudo bem?
Após criar os arquivos de deployment estou tomando este erro:
PDOException Object ( [message:protected] => SQLSTATE[HY000] [2002] No such file or directory [string:Exception:private] => [code:protected] => 2002 [file:protected] => /var/www/html/funcoes.php [line:protected] => 7 [trace:Exception:private] => Array ( [0] => Array ( [file] => /var/www/html/funcoes.php [line] => 7 [function] => __construct [class] => PDO [type] => -> [args] => Array ( [0] => mysql:host=;dbname= [1] => [2] => ) ) [1] => Array ( [file] => /var/www/html/index.php [line] => 6 [args] => Array ( [0] => /var/www/html/funcoes.php ) [function] => include ) ) [previous:Exception:private] => [errorInfo] => )
Já recriei e revisei os módulos de sistema-noticia e db-noticias mas eles estão iguais ao do instrutor.
Eu uso mac e estou utilizando o minikube para usar a estrutura do kubernets.
Segue os arquivos de deployment:
apiVersion: apps/v1
kind: Deployment
metadata:
name: sistema-noticias-deployment
spec:
replicas: 1
template:
metadata:
name: sistema-noticias
labels:
app: sistema-noticias
spec:
containers:
- name: sistema-noticias-container
image: aluracursos/sistema-noticias:1
ports:
- containerPort: 80
envFrom:
- configMapRef:
name: sistema-configmap
selector:
matchLabels:
app: sistema-noticias
apiVersion: apps/v1
kind: Deployment
metadata:
name: db-noticias-deployment
spec:
template:
metadata:
name: db-noticias
labels:
app: db-noticias
spec:
containers:
- name: db-noticias-container
image: aluracursos/mysql-db:1
ports:
- containerPort: 3306
envFrom:
- configMapRef:
name: db-configmap
selector:
matchLabels:
app: db-noticias
Desde já agradeço!