Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong example deployment.yaml file in apply docs #377

Open
kklis opened this issue Feb 2, 2024 · 5 comments · May be fixed by #379
Open

Wrong example deployment.yaml file in apply docs #377

kklis opened this issue Feb 2, 2024 · 5 comments · May be fixed by #379
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@kklis
Copy link

kklis commented Feb 2, 2024

The example file on https://kubectl.docs.kubernetes.io/references/kubectl/apply/ does not work, and kubectl apply -f deployment.yaml ends with decoding error:

# deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: the-deployment
spec:
  replicas: 5
  template:
    containers:
      - name: the-container
        image: registry/container:latest

There should be additional spec: under template for the deployment example to work:

# deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: the-deployment
spec:
  replicas: 5
  template:
    spec:
      containers:
        - name: the-container
          image: registry/container:latest
@kundan2707
Copy link

/triage accepted

@k8s-ci-robot k8s-ci-robot added the triage/accepted Indicates an issue or PR is ready to be actively worked on. label Feb 13, 2024
@kundan2707
Copy link

/kind bug

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Feb 13, 2024
@kundan2707
Copy link

yaml file should be valid one

@kundan2707
Copy link

/assign

@kundan2707
Copy link

correct yaml:

kind: Deployment
metadata:
  name: the-deployment
spec:
  replicas: 5
  selector:
    matchLabels:
      app: container
  template:
    metadata:
      labels:
        app: container
    spec:
      containers:
      - name: the-container
        image: registry/container:latest

@kundan2707 kundan2707 linked a pull request Feb 13, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants