I have following setup:

  • Private OpenStack Cloud - o̲n̲l̲y̲ Web UI (Horizon) is accessible
    (API is restricted but maybe I could get access)
  • I have used CoreOS with a setup of one master and three nodes
  • Resources are standardized (as default of OpenStack)
  • I followed the getting-started guide for CoreOS (i.e. I'm using the default YAMLs for cloud-config provided) on GitHub

As I read extensions such like Web UI (kube-ui) can be added as Add-On - which I have added (only kube-ui).

Now if I run a test such like simple-nginx I get following output:

creating pods:

$ kubectl run my-nginx --image=nginx --replicas=2 --port=80

creating service:

$ kubectl expose rc my-nginx --port=80 --type=LoadBalancer          
NAME       LABELS         SELECTOR       IP(S)     PORT(S)
my-nginx   run=my-nginx   run=my-nginx             80/TCP

get service info:

$ kubectl describe service my-nginx                                                                                                
Name:           my-nginx
Namespace:      default
Labels:         run=my-nginx
Selector:       run=my-nginx
Type:           LoadBalancer
Port:           <unnamed>   80/TCP
NodePort:       <unnamed>   31170/TCP
Session Affinity:   None
No events.

I can access my service from every(!) external IP of the nodes.

My question now is as follows:

How can access any started service ether with a subdomain and therefore how can I set this configuration (for example I have domain.com as example) or could it be printed out on which node-IP I have to access my service (although I have only two replicas(?!))?

To describe my thoughts more understandable I mean following:

  • given domain: domain.com (pointing to master)
  • start service simple-nginx
  • service can be accessed with simple-nginx.domain.com

You need to do two things:

  • Run the kube-proxy on all nodes you want to access the VIPs (virtual IPs) for the services
  • Point the node's DNS in /etc/resolv.conf to point to the DNS server that is running in the kubernetes cluster.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.