Skip to content

Missing selector in postgres-deployment.yaml? #31

@4everinbeta

Description

@4everinbeta

I'm getting the following error when I attempt to create the postgres-deployment.yaml

error: error validating "postgres-deployment.yml": error validating data: ValidationError(Deployment.spec): missing required field "selector" in io.k8s.api.apps.v1.DeploymentSpec; if you choose to ignore these errors, turn validation off with --validate=false

I can ignore it for now but it seems like something that should be demonstrated to the current spec. Or am I (very likely) missing something?

UPDATE

I actually can't seem to ignore it. Now I feel confident I am doing something wrong.

The Deployment "postgres" is invalid:
* spec.selector: Required value
* spec.template.metadata.labels: Invalid value: map[string]string{"app":"postgres"}: `selector` does not match template `labels`

UPDATE 2

By rolling back the api version it works. But I'm still not sure that is the correct solution?

apiVersion: apps/v1beta1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions