Solucionado (ver solução)
Solucionado
(ver solução)
1
resposta

StatefulSet.yaml erro no Google Cloud

StatefulSet.yaml no Google Cloud.

Especificações:

S.O: Win7 ou Ubuntu 16.04.4 (VirtualBox)

Client Version: version.Info{Major:"1", Minor:"10"

Server Version: version.Info{Major:"1", Minor:"8+"

kubectl create -f statefulset_google_cloud.yaml

Utilizando

apiVersion: apps/v1beta1

apresenta o seguinte erro

kubectl create -f statefulset_google_cloud.yaml
error: error validating "statefulset_google_cloud.yaml": error validating data: [ValidationError(StatefulSet.spec.template.spec.containers[0].volumeMounts[0]): unknown field "mouthPah" in io.k8s.api.core.v1.VolumeMount, ValidationError(StatefulSet.spec.template.spec.containers[0].volumeMounts[0]): missing required field "mountPath" in io.k8s.api.core.v1.VolumeMount, ValidationError(StatefulSet.spec.template.spec.volumes[0]): unknown field "PersistentVolumeClaim" in io.k8s.api.core.v1.Volume]; if you choose to ignore these errors, turn validation off with --validate=false

Se utilizo a

apiVersion: apps/v1

Apresenta o seguinte

error: unable to recognize "statefulset_google_cloud.yaml": no matches for kind "StatefulSet" in version "apps/v1"

Código do StatefulSet.yaml

apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: statefulset-mysql
spec:
  serviceName: db
  template:
    metadata:
      labels:
       name: mysql
    spec:
      containers:
        - name: container-mysql
          image: mysql:5.5
          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
              mountPah: /var/lib/mysql
      volumes:
      - name: volume-mysql
        PersistentVolumeClaim:
          claimName: configuracao-mysql

Para kubectl api-versions

apiextensions.k8s.io/v1beta1
apiregistration.k8s.io/v1beta1
apps/v1beta1
apps/v1beta2
authentication.k8s.io/v1
authentication.k8s.io/v1beta1
authorization.k8s.io/v1
authorization.k8s.io/v1beta1
autoscaling/v1
autoscaling/v2beta1
batch/v1
batch/v1beta1
certificates.k8s.io/v1beta1
extensions/v1beta1
networking.k8s.io/v1
policy/v1beta1
rbac.authorization.k8s.io/v1
rbac.authorization.k8s.io/v1beta1
storage.k8s.io/v1
storage.k8s.io/v1beta1
v1
1 resposta
solução!

Ola Lucas,

Acredito que o problema seja essa linha:

mountPah: /var/lib/mysql

Tente trocar por

mountPath:  /var/lib/mysql

Att