Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Conversation

@mofsal
Copy link
Contributor

@mofsal mofsal commented Aug 14, 2018

At least in Kubectl version v1.11.1, the format for exposing a Kubernetes application is:

Usage:
kubectl expose (-f FILENAME | TYPE NAME) [--port=port] [--protocol=TCP|UDP] [--target-port=number-or-name]
[--name=name] [--external-ip=external-ip-of-service] [--type=type] [options]

The "--port=3000" flag should come before "--type=NodePort" otherwise it isn't recognised. Similarly, the "--name" flag names the service which will be the same as the deployment's name by default anyway. Having it there for me for some reason threw an error:

Error from server (NotFound): deployments.extensions "—-name=deploy-react-kubernetes-service" not found.

I just removed it and it worked.

mofsal and others added 2 commits August 14, 2018 12:09
At least in version v1.11.1, the format for exposing a Kubernetes application is: Usage: kubectl expose (-f FILENAME | TYPE NAME) [--port=port] [--protocol=TCP|UDP] [--target-port=number-or-name] [--name=name] [--external-ip=external-ip-of-service] [--type=type] [options] The "--port=3000" flag should come before "--type=NodePort" otherwise it isn't recognised. Similarly, the "--name" flag names the service which will be the same as the deployment's name by default anyway. Having it there for me for some reason threw an error: Error from server (NotFound): deployments.extensions "—-name=deploy-react-kubernetes-service" not found. I just removed it and it worked.
@rizchelwood rizchelwood merged commit 9805295 into IBM:master Dec 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

2 participants