Hello everybody
i’m actually facing an issue while applying my deployment:
I have the below message:
Error from server (BadRequest): error when creating "manifest/front/flaskapp-deployment.yaml": Deployment in version "v1" cannot be handled as a Deployment: json: cannot unmarshal object into Go struct field PodSpec.spec.template.spec.containers of type []v1.Container
Here’s my yaml file:
apiVersion: apps/v1
kind: Deployment
metadata:
name: flaskapp-deployment
labels:
app: flaskapp
spec:
replicas: 1
selector:
matchLabels:
app: flaskapp
template:
metadata:
labels:
app: flaskapp
spec:
containers:
env:
- name: MYSQL_DATABASE_DB
valueFrom:
secretKeyRef:
name: flaskapp-credentials
key: MYSQL_DATABASE_DB
- name: MYSQL_DATABASE_HOST
valueFrom:
secretKeyRef:
name: flaskapp-credentials
key: MYSQL_DATABASE_HOST
- name: MYSQL_DB_USER
valueFrom:
secretKeyRef:
name: flaskapp-credentials
key: MYSQL_DB_USER
- name: MYSQL_USER_PASSWORD
valueFrom:
secretKeyRef:
name: flaskapp-credentials
key: MYSQL_USER_PASSWORD
name: flaskapp
image: p3dr07/macertif:flaskapp-newest
resources:
limits:
memory: 1Gi
cpu: "0.5"
ports:
- containerPort: "5000"
imagePullSecrets:
- name: registry-secret
Could you please check what i’m doing wrong in my yaml file ?
Thank you,
BR,