title: Not geting public DNS name for service(Stuck in pending)-Openshift on AWS
body: <p>Followed the installation guide to setup cluster: <a href="https://s3.amazonaws.com/quickstart-reference/redhat/openshift/latest/doc/red-hat-openshift-on-the-aws-cloud.pdf" rel="nofollow noreferrer">https://s3.amazonaws.com/quickstart-reference/redhat/openshift/latest/doc/red-hat-openshift-on-the-aws-cloud.pdf</a></p>
  
  <p>I'm able to get the public DNS name for a service in Kubernetes but not in Openshift. It is very basic thing, I dont know why it is not working?. I'm attaching manifest files that  are used to create app and server. It is not working openshift.</p>
  
  <p><a href="https://pastebin.com/raw/RC9B4n7W" rel="nofollow noreferrer">prometheus-configmap.yml</a></p>
  
  <p><a href="https://pastebin.com/raw/2XGdtJxZ" rel="nofollow noreferrer">prometheus-rbac.yml</a></p>
  
  <p><a href="https://pastebin.com/raw/4NKGhi6y" rel="nofollow noreferrer">prometheus-deployment.yml</a></p>
  
  <h1>In K8s</h1>
  
  <pre><code>kubectl apply -f prometheus-configmap.yml
  kubectl apply -f prometheus-rbac.yml
  kubectl apply -f prometheus-deployment.yml
  
  veeru@ultron:~/prometheus-k8s-monitoring$ kubectl describe svc prometheus-test
  Name:                     prometheus-test
  Namespace:                default
  Labels:                   name=prometheus-test
  Annotations:              kubectl.kubernetes.io/last-applied-configuration={"apiVersion":"v1","kind":"Service","metadata":{"annotations":{"prometheus.io/scrape":"true"},"labels":{"name":"prometheus-test"},"name":"prometheus-te...
                            prometheus.io/scrape=true
  Selector:                 app=prometheus-test
  Type:                     LoadBalancer
  IP:                       100.xx.xx.xx
  LoadBalancer Ingress:     xxxxx-1679955855.us-east-2.elb.amazonaws.com
  Port:                     prometheus-test  9090/TCP
  TargetPort:               9090/TCP
  NodePort:                 prometheus-test  31558/TCP
  Endpoints:                100.xx.xx.xx:9090
  Session Affinity:         None
  External Traffic Policy:  Cluster
  Events:
    Type    Reason                Age   From                Message
    ----    ------                ----  ----                -------
    Normal  EnsuringLoadBalancer  9m    service-controller  Ensuring load balancer
    Normal  EnsuredLoadBalancer   9m    service-controller  Ensured load balancer
  </code></pre>
  
  <p>In above you can see that I got the LoadBalancer Ingress with public DNS name.</p>
  
  <h1>In Openshift</h1>
  
  <pre><code>kubectl apply -f prometheus-configmap.yml
  kubectl apply -f prometheus-rbac.yml
  kubectl apply -f prometheus-deployment.yml
  
  root@ultron:/home/veeru/prometheus-k8s-monitoring# oc describe svc prometheus-test
  Name:           prometheus-test
  Namespace:      spinnaker
  Labels:         name=prometheus-test
  Annotations:        kubectl.kubernetes.io/last-applied-configuration={"apiVersion":"v1","kind":"Service","metadata":{"annotations":{"prometheus.io/scrape":"true"},"labels":{"name":"prometheus-test"},"name":"prometheus-te...
              prometheus.io/scrape=true
  Selector:       app=prometheus-test
  Type:           LoadBalancer
  IP:         172.30.134.153
  Port:           prometheus-test 9090/TCP
  NodePort:       prometheus-test 31667/TCP
  Endpoints:      &lt;none&gt;
  Session Affinity:   None
  Events:
    FirstSeen LastSeen    Count   From            SubObjectPath   Type        Reason              Message
    --------- --------    -----   ----            -------------   --------    ------              -------
    10m       36s     8   service-controller          Normal      CreatingLoadBalancer        Creating load balancer
    10m       36s     8   service-controller          Warning     CreatingLoadBalancerFailed  Error creating load balancer (will retry): Failed to create load balancer for service spinnaker/prometheus-test: could not find any suitable subnets for creating the ELB
  </code></pre>
  
  <p>You can see the status failed to create load balancer for service</p>
  
  <p>If I specify annotation like --> <code>service.beta.kubernetes.io/aws-load-balancer-internal: 0.0.0.0/0</code></p>
  
  <p>Then I'm able get the "internal" DNS name for service </p>
  
  <pre><code>root@ultron:/home/veeru/prometheus-k8s-monitoring# oc describe svc test4-dev
  Name:                     test4-dev
  Namespace:                default
  Labels:                   &lt;none&gt;
  Annotations:              service.beta.kubernetes.io/aws-load-balancer-internal=0.0.0.0/0
  Selector:                 load-balancer-test4-dev=true
  Type:                     LoadBalancer
  IP:                       172.30.177.217
  LoadBalancer Ingress:     internal-xxxxx-298335522.us-east-2.elb.amazonaws.com
  Port:                     http  8080/TCP
  TargetPort:               8080/TCP
  NodePort:                 http  31595/TCP
  Endpoints:                10.131.0.75:8080
  Session Affinity:         None
  External Traffic Policy:  Cluster
  Events:
    Type    Reason                Age                 From                Message
    ----    ------                ----                ----                -------
    Normal  CreatingLoadBalancer  1m (x208 over 16h)  service-controller  Creating load balancer
  </code></pre>
  
  <p>Openshift is not using AWS ELB to create public DNS name?.</p>