Gulshan Kumar
Gulshan Kumar

Reputation: 13

While deploying an application I faced this error, can anyone help me

error: resource mapping not found for name: "pod-info-deployment" namespace: "development" from "deployment.yaml": no matches for kind "Deployment" in version "app/v1"
ensure CRDs are installed first

This is deployment.yaml file which I'm running.

---
apiVersion: app/v1
kind: Deployment
metadata:
  name: pod-info-deployment
  namespace: development
  labels:
    app: pod-info
spec:
  replicas: 3
  selectors:
    matchLabels:
      app: pod-info # select pods with this label to be managed by the deployment.
  template:
    metadata:
      labels:
        app: pod-info  # add a new label for each instance of our application that is
    spec:
      containers:
      - name: pod-info-container
        image: kimschles/pod-info-app:latest
        ports:
        - containerPort: 3000
        env:
          - name: POD_NAME
            valueFrom:
              fieldRef:
                fieldPath: metadata.name
          - name: POD_NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
          - name: POD_IP
            valueFrom:
              fieldRef:
                fieldPath: metadata.podIP

I was running this kubectl apply -f deployment.yaml It return error.

Upvotes: 0

Views: 1345

Answers (2)

JavaGuy
JavaGuy

Reputation: 21

There are three mistakes

  1. replace "app/v1" with "apps/v1"
  2. replace "selectors:" with "selector:"
  3. replace "fieldPath: metadata.podIP" with "fieldPath: status.podIP"

Upvotes: 2

Thomas
Thomas

Reputation: 12029

You have a typo in your apiVersion of the manifest. It should be apps/v1 not app/v1

Upvotes: 1

Related Questions