okteto / samples

Learn how to develop with Okteto
https://okteto.com/
Apache License 2.0
111 stars 30 forks source link

[problem] The PHP sample is broken. #128

Closed gaocegege closed 2 years ago

gaocegege commented 2 years ago

When I follow the guide to step 3, there is an error:

x Application 'dev' not found in namespace 'default' Verify that your application has been deployed and your Kubernetes context is pointing to the right namespace Or set the 'autocreate' field in your okteto manifest if you want to create a standalone development container More information is available here: https://okteto.com/docs/reference/cli/#up

We need to add autocreate: true in okteto.yaml

pchico83 commented 2 years ago

@gaocegege which sample are you referring to? There are PHP samples in the repo:

gaocegege commented 2 years ago

https://github.com/okteto/samples/tree/master/php

pchico83 commented 2 years ago

@gaocegege which guide/tutorial did you follow to run the sample? is it in Okteto Cloud? or in your own kubernetes cluster?

gaocegege commented 2 years ago

I use my own Kubernetes cluster. I first deploy the manifests via kubectl apply -f ./manifetsts/. Then I run the command okteto up. I got the error here.

x Application 'dev' not found in namespace 'default'
Verify that your application has been deployed and your Kubernetes context is pointing to the right namespace
Or set the 'autocreate' field in your okteto manifest if you want to create a standalone development container
More information is available here: https://okteto.com/docs/reference/cli/#up

After I added the field autocreate: true in the okteto yaml, it works.

pchico83 commented 2 years ago

@gaocegege let me double-check two things:

gaocegege commented 2 years ago

your okteto context show is pointing to the same kubernetes context than kubectl

Yes.

you okteto manifest has this content.

I am using this https://github.com/okteto/samples/blob/master/php/okteto.yml

pchico83 commented 2 years ago

@gaocegege you are right, I was looking to the wrong sample. yes, it should have autocreate: true. Would you mind creating a PR to add it?

gaocegege commented 2 years ago

I created a PR to fix it. PTAL