Search code examples
kubernetesgoogle-cloud-platformgoogle-kubernetes-engineskaffold

GCP Kuberentes Cloud Deploy vs Cloud build


I am deploying a kubernetes app via github on GCP clusters. Everything works fine then.. I came across cloud deploy delivery pipeline..now I am stuck.

Following the docs here

apiVersion: skaffold/v2beta12
kind: Config
build:
  artifacts:
  - image: skaffold-example
deploy:
  kubectl:
    manifests:
      - k8s-*

In the k8s folder I have my deployment files like so

apiVersion: apps/v1
kind: Deployment
metadata:
  name: ixh-auth-depl
  labels:
    app: ixh-auth
spec:
  replicas: 1
  selector:
    matchLabels:
      app: ixh-auth
  template:
    metadata:
      labels:
        app: ixh-auth
    spec:
      containers:
      - name: ixh-auth
        image: mb/ixh-auth:latest
        ports:
        - containerPort: 3000
        resources:
          requests:
            cpu: 100m
            memory: 500Mi

but it gives the error invalid kubernetes manifest. I cannot find anything to read on this and don't know how to proceed.


Solution

  • The correct way to declare the manifests was this. The wildcard probably didn't work. The folder name here would be k8s-manifests.

    deploy:
      kubectl:
        manifests:
          - k8s-manifests/redis-deployment.yml
          - k8s-manifests/node-depl.yml
          - k8s-manifests/node-service.yml