1

I'm new to Google Cloud Platform and Kubernetes. I've been following this tutorial and stuck with the following command:

kubectl expose rc my-nginx --target-port=80 --type=NodePort

When in try to expose the RC it would print:

Error from server (NotFound): replicationcontrollers "my-nginx" not found

Am I missing something here?

rzkrzzz
  • 11
  • 2

1 Answers1

2

You can use the following commands to create nginx pod and expose it as a service, as mentioned in this article:

Create nginx pod:

kubectl run nginx --image=nginx --port=80

Expose nginx as a service:

kubectl expose deployment nginx --target-port=80 --type=NodePort
Faizan
  • 1,408
  • 10
  • 17