k8s external ip configuration
See original GitHub issue@jacobtomlinson made a comment here on externalizing services. I would suggest that the default be a NodePort
for a two reasons:
- Ingress/LoadBalancers can be tricky to setup/configure – especially for beginners
- note: on clouds (GKE at least) ingress is automatically setup
- Testing may be challenging (though not impossible)
NodePorts are builtin to k8s, we can easily test, and the setup should work out of the box without additional configuration
When using a NodePort I believe the pod/service is accessible by any nodeIP: https://kubernetes.io/docs/tutorials/services/source-ip/#source-ip-for-services-with-type-nodeport
For configuring a NodePort I would recommend looking at: https://kubernetes.io/docs/tasks/access-application-cluster/service-access-application-cluster/
or the following:
kind: Service
apiVersion: v1
metadata:
name: SERVICENAME
spec:
type: NodePort
selector:
app: APPNAME
ports:
# nodePort - a static port assigned on each the node
# port - port exposed internally in the cluster (assigned on creation)
# targetPort - the container port to send requests to
- nodePort: 30163
port: 8080
cc @jcrist
@jacobtomlinson do you have thoughts here ?
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Exposing an External IP Address to Access an Application in a ...
This page shows how to create a Kubernetes Service object that exposes an external IP address. Before you begin Install kubectl.
Read more >Learn how to use Kubernetes External IP service type - Medium
Step 1: Setup Kubernetes cluster · Step 2: Create Kubernetes deployments · Step 3: Expose the deployments as External IP type · Step...
Read more >Assign External IP to a Kubernetes Service - Stack Overflow
First of all run this command: kubectl get -n namespace services. Above command will return output like this: NAME TYPE CLUSTER-IP ...
Read more >Expose external ip address - Unofficial Kubernetes
This page shows how to create a Kubernetes Service object that exposes an external IP address. Install kubectl. Use a cloud provider like...
Read more >Exposing an External IP Address to Access an Application in a ...
This page shows how to create a Kubernetes Service object that exposes an external IP address. Objectives; Before you begin; Creating a service...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I went with
LoadBalancer
as the default for this reason, but hopefully have things done in a way that users could useNodePort
if needed.This was done in #71.