<p>I'm trying to achieve following, I have installed Kube cluster (version 1.18) using kops on AWS EC2. It's up and running but now I want to expose some workloads to the internet to be available via subdomains but it isnt working as expected and I use ingress for that.</p>
<p>More details below:</p>
<pre><code>Client Version: v1.18.3
Server Version: v1.18.3

helm version --short
Client: v2.17.0+ga690bad
Server: v2.17.0+ga690bad
</code></pre>
<p><em><strong>Chart is below:</strong></em></p>
<pre><code>deploy.yaml:
    
        name: custom-smscs
        branch: k8s
        git: git@github.com:REDACTED
        
        image:
          repository: &lt;account_id&gt;.dkr.ecr.eu-west-1.amazonaws.com/custom_smscs
        
        service:
          port: 80
          internalPort: 80
          healthEndpoint: /health
</code></pre>
<p>deployment.yaml:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: &quot;{{ .Chart.Name }}-deployment&quot;
  labels:
    app: {{ .Values.name }}
spec:
  replicas: {{ .Values.replicaCount }}
  selector:
    matchLabels:
      app: {{ .Values.name }}
  template:
    metadata:
      labels:
        app: {{ .Values.name }}
    spec:
      containers:
      - name: {{ .Values.name }}
        image: &quot;{{ .Values.image.repository }}:{{ .Values.image.tag }}&quot;
        ports:
        - containerPort: {{ .Values.service.internalPort }}
        env:
        - name: NODE_ENV
          value: {{ .Values.environment }}
        livenessProbe:
          httpGet:
            path: {{ .Values.service.healthEndpoint }}
            port: {{ .Values.service.internalPort }}
          initialDelaySeconds: 15
          timeoutSeconds: 10
          periodSeconds: {{ .Values.service.healthPeriod }}
          successThreshold: 1
          failureThreshold: {{ .Values.service.healthThreshold }}
        resources:
{{ toYaml .Values.resources | indent 12 }}
</code></pre>
<p>service.yaml:</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: &quot;{{ .Values.name }}-service&quot;
  labels:
    chart: &quot;{{ .Chart.Name }}-{{ .Chart.Version }}&quot;
spec:
  type: {{ .Values.service.type }}
  selector:
          app: &quot;{{ .Values.name }}&quot;
  ports:
  - port: {{ .Values.service.port }}
    targetPort: {{ .Values.service.internalPort }}
    protocol: TCP
    name: http
  {{- if .Values.service.ports }}
  {{- range $name, $port := .Values.service.ports }}
  - port: {{ $port }}
    targetPort: {{ $port }}
    protocol: TCP
    name: {{ $name }}
  {{- end }}
  {{- end }}
  selector:
    app: {{ .Values.name }}
</code></pre>
<p>ingress.yaml:</p>
<pre><code>apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: {{ .Values.name }}-ingress
  namespace: default
  annotations:
    kubernetes.io/ingress.class: nginx
spec:
  rules:
  - host: customsmscs.my-domain.com
    http:
      paths:
        - path: /
          backend:
            serviceName: {{ .Values.name }}-service
            servicePort: {{ .Values.service.port }}
</code></pre>
<p>values.yaml:</p>
<pre><code>replicaCount: 1
image:
  repository: replaced
  tag: &quot;0.0.1&quot;
  pullPolicy: Always
service:
  type: ClusterIP
  name: replaced
  port: 80
  internalPort: 80
  healthEndpoint: /health
  healthPeriod: 30
  healthThreshold: 3
environment: production
resources:
  limits:
    cpu: 256m
    memory: 256Mi
  requests:
    cpu: 100m
    memory: 128Mi
autoscaling:
  enabled: false
  minReplicas: 1
  maxReplicas: 2
  target: 80
</code></pre>
<p>The nginx was installed using following command:</p>
<pre><code>kc apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v0.46.0/deploy/static/provider/aws/deploy-tls-termination.yaml
</code></pre>
<p>There is everything required to run the nginx-ingress correctly:</p>
<pre><code>    kc -n ingress-nginx get po
    NAME                                       READY   STATUS      RESTARTS   AGE
    ingress-nginx-admission-create-qltch       0/1     Completed   0          154m
    ingress-nginx-admission-patch-6ll84        0/1     Completed   0          154m
    ingress-nginx-controller-b4678dfcb-8gn56   1/1     Running     0          154m
</code></pre>
<pre><code>    kc get all | grep custom
pod/custom-smscs-deployment-6cd5f58bb8-ht49w   1/1     Running   0          37m
service/custom-smscs-service   ClusterIP   100.70.5.207     &lt;none&gt;        80/TCP            37m
deployment.apps/custom-smscs-deployment   1/1     1            1           37m
replicaset.apps/custom-smscs-deployment-6cd5f58bb8   1         1         1       37m
</code></pre>
<pre><code>    kc get ing
    NAME                   CLASS    HOSTS                                   ADDRESS                                                                   PORTS   AGE
   custom-smscs-ingress   &lt;none&gt;   customsmscs.my-domain.com   &lt;ELB&gt;.amazonaws.com   80      38m
</code></pre>
<pre><code>    kc get ep
    NAME                   ENDPOINTS                               AGE
    custom-smscs-service   100.101.173.27:80                       40m
</code></pre>
<p>But when I do describe the ingress i noticed some error, not sure it's a reason or not:</p>
<p>nginx log:</p>
<pre><code>    I0525 09:47:46.702227       6 controller.go:146] &quot;Configuration changes detected, backend reload required&quot;
    I0525 09:47:46.780938       6 controller.go:163] &quot;Backend successfully reloaded&quot;
    I0525 09:47:46.781209       6 event.go:282] Event(v1.ObjectReference{Kind:&quot;Pod&quot;, Namespace:&quot;ingress-nginx&quot;, Name:&quot;ingress-nginx-controller-b4678dfcb-8gn56&quot;, UID:&quot;d5d9246b-63a8-4eba-8467-fdec0f3f9b3f&quot;, APIVersion:&quot;v1&quot;, ResourceVersion:&quot;89646&quot;, FieldPath:&quot;&quot;}): type: 'Normal' reason: 'RELOAD' NGINX reload triggered due to a change in configuration
    I0525 09:48:19.528969       6 status.go:284] &quot;updating Ingress status&quot; namespace=&quot;default&quot; ingress=&quot;custom-smscs-ingress&quot; currentValue=[] newValue=[{IP: Hostname:&lt;ELB&gt;.eu-west-1.elb.amazonaws.com Ports:[]}]
    I0525 09:48:19.533791       6 event.go:282] Event(v1.ObjectReference{Kind:&quot;Ingress&quot;, Namespace:&quot;default&quot;, Name:&quot;custom-smscs-ingress&quot;, UID:&quot;309890dd-1148-4aa8-bc14-62e57bbd969f&quot;, APIVersion:&quot;networking.k8s.io/v1beta1&quot;, ResourceVersion:&quot;267393&quot;, FieldPath:&quot;&quot;}): type: 'Normal' reason: 'Sync' Scheduled for sync
</code></pre>
<p><strong>&lt;error: endpoints &quot;default-http-backend&quot; not found&gt;</strong></p>
<pre><code>        kc describe ing custom-smscs-ingress
    Name:             custom-smscs-ingress
    Namespace:        default
    Address:          &lt;ELB&gt;.eu-west-1.elb.amazonaws.com
    Default backend:  default-http-backend:80 (&lt;error: endpoints &quot;default-http-backend&quot; not found&gt;)
    Rules:
      Host                                   Path  Backends
      ----                                   ----  --------
      customsmscs.my-domain.com  
                                             /   custom-smscs-service:80 (100.101.173.27:80)
    Annotations:                             kubernetes.io/ingress.class: nginx
    Events:
      Type    Reason  Age                From                      Message
      ----    ------  ----               ----                      -------
      Normal  Sync    43m (x2 over 43m)  nginx-ingress-controller  Scheduled for sync
</code></pre>
<p>So everything is looking good apart from the error above but when im trying to open an app.example.com in the browser im getting &quot;Hmmm… can't reach this page&quot;. But when I open the ELB DNS endpoint URL in the browser I get &quot;404 not found&quot; which I guess is correct response as I called a default backend.</p>
<p>Another thing I noticed is that on the ELB there is only one of two nodes is in service:</p>
<p><a href="https://i.stack.imgur.com/uLn8x.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uLn8x.png" alt="enter image description here" /></a></p>
<p>I'm literally have spent 4 days on it but can't make it working.</p>
<p>Do you have any idea how to fix/overcome it guys?</p>
<p>Thank you in advance!</p>

Denis
<p>Alright, the solution was so easy....
I have added DNS A record (alias) like *.ks8.my-domain.com pointing to the ingress ELB and created an SSL certificate in AWS Certificate Manager, as well there is one change I had to do, in the <em>ingress.yaml</em> the *host: * parameter should be changed to <em>customsmscs.k8s.my-domain.com</em> instead of <em>customsmscs.my-domain.com</em>.
And then I deleted the deployment and all related resources (ingress, service, etc) and redeployed it and now the app is available at the <a href="https://customsmscs.k8s.my-domain.com" rel="nofollow noreferrer">https://customsmscs.k8s.my-domain.com</a>.</p>
<p>Thanks @thomas for advice, you helped me a lot!</p>
