kubernetesgoogle-kubernetes-engine

Kubernetes: Unable to create replicaSet: error: no objects passed to create


I'm trying to create replicaSet in kubernetes by using below yaml file.

            apiVersion: apps/v1
            kind: ReplicaSet
            metadata:
                name: kubia
            spec:
                replicas: 2
                selector:
                    matchLabels:
                        app: kubia
                    template:
                        metadata:
                            labels:
                                app: kubia
                        spec:
                            containers: 
                            - name: kubia
                                image: luksa/kubia

Then I run the below command

$ kubectl create -f replicaSet/kubia-replicaset.yaml

This command gave me the below error

 error: no objects passed to create

Any idea why I'm getting this error. How to resolve this error and successfully create the replicaSet?


Solution

  • This image should be parallel to name

    containers: 
        - name: kubia
          image: luksa/kubia