Welcome to the Linux Foundation Forum!

Chapter 3 - kubectl to create the local docker registry. - Lab 3.2

Posts: 6
edited July 2020 in LFD259 Class Forum

I am getting this error when I try to run kubectl create -f localregistry.yaml

Error from server (Invalid): Deployment.apps "nginx" is invalid: spec.template.metadata.labels: Invalid value: map[string]string{"io.kompose.service":"nginx"}: selector does not match template labels

Comments

  • Posts: 2,449

    Hi @strongman1708,

    When editing localregistry.yaml, scroll down to the nginx Deployment, and ensure that the Deployment's spec.selector.matchLabels "io.kompose.service:nginx" key:value pair matches the Deployment's spec.template.metadata.labels "io.kompose.service:nginx" key:value pair.

    1. ...
    2. spec:
    3. replicas: 1
    4. selector:
    5. matchLabels:
    6. io.kompose.service: nginx
    7. strategy:
    8. type: Recreate
    9. template:
    10. metadata:
    11. creationTimestamp: null
    12. labels:
    13. io.kompose.service: nginx
    14. spec:
    15. containers:
    16. ...

    Comparing localregistry.yaml with edited-localregistry.yaml from the Solutions tarball may also help to locate the properties which do not match.

    Regards,
    -Chris

  • Hi Chris, Thank you.

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Categories

Upcoming Training