Skip to main content

Setup Ingress for your KEI Environment

This is the final step of the Section getting started process.

Setup Ingress to the Section Edge for HTTP workload

To setup ingress you will:

  1. Create the necessary Kubernetes Service object to expose the webserver to the Internet.
  2. Use your DNS provider to direct traffic to your webserver with a CNAME record.

Create a Service object

Create a yaml file, such as my-service.yaml

my-service.yaml
apiVersion: v1
kind: Service
metadata:
labels:
app: ingress-upstream
name: ingress-upstream
namespace: default
spec:
ports:
- name: 80-8080
port: 80
protocol: TCP
targetPort: 80
selector:
app: nginx
sessionAffinity: None
type: ClusterIP
status:
loadBalancer: {}

Use kubectl to create your ingress service

Deploy your service

kubectl apply -f my-service.yaml

The Service called ingress-upstream causes the deployment of special ingress pods into your environment that route traffic into your app. Read more about the Section HTTP Ingress.

See your service running on Section

kubectl get services

You will see a new ingress-upstream service, as in the following example.

NAME               TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)   AGE
kubernetes ClusterIP 10.xx.xx.xx <none> 443/TCP 6m55s
ingress-upstream ClusterIP 10.xx.xx.xx <none> 80/TCP 1s

See the pods running on Section's network

kubectl get pods -o wide

Note that you didn't set a location optization strategy, so Section will run your application with the default (2 locations).

Setup DNS

  • On the overview page of the Section Console, find and click your environment.
  • Under Settings select Domains.
  • Confirm that the domain name you provided when you created the environment is listed.
  • Visit your DNS provider and create a CNAME record to point to Section as instructed on the Section Console Domains page.
  • After some time you will be able to click the Verify button to confirm that DNS is engaged.

Read more about DNS and TLS.

Congratulations!

When you visit your hostname in a web browser, you'll see "Welcome to nginx!". This tells you that you application is successfully deployed!

Your environment page gives access to Traffic Monitor, which is a great way to see the traffic coming into your web server.

Explore other guides to learn about ways to control your app running on Section!