Skip to main content

Ingress in Managed Namespace

The Mayope Managed Namespace assists you exposing your http services to the web.

Deploy an ingress with dynamic domain#

If you don't have an own domain yet, you can use a dynamic mayope domain for this purpose.

Request#

  1. Go to the Namespace tab
  2. Chose the namespace where you want to deploy your LoadBalancer Service
  3. Click on the Domains drawer at the bottom of the detail view
  4. Click on Request Dynamic Domain, enter your desired prefix and click on Request:
  5. After successfully requesting, your Domain should be displayed in the Table
  6. Create your ingress as below:
# Create hello world deploymentapiVersion: apps/v1kind: Deploymentmetadata:  name: nginxspec:  selector:    matchLabels:      app: nginx  template:    metadata:      labels:        app: nginx    spec:      containers:        - name: nginx          image: nginxdemos/hello          ports:            - name: http              containerPort: 80---# Create service for hello-world deploymentapiVersion: v1kind: Servicemetadata:  name: nginxspec:  ports:    - name: http      port: 80      protocol: TCP      targetPort: 80  selector:    app: nginx  type: ClusterIP---# Create an ingress to expose the serviceapiVersion: networking.k8s.io/v1beta1kind: Ingressmetadata:  name: nginx  annotations:    kubernetes.io/ingress.class: "nginx"spec:  rules:    - host: {{HOST}} # Host from the first column of the table      http:        paths:          - path: /            backend:              serviceName: nginx              servicePort: 80

After a couple of minutes you can access your ingress through: https://{{HOST}}.

The host will be automatically exposed with https. You can however disable this behaviour: Disable with annotation

Using your own domain#

You can also use you own host for the ingress. To ensure you own this host you have to first register it in your Domains in the Mayope Dashboard.

  1. Enter your domain in the Request own domain form
  2. Submit with the Request Domain button
  3. You wil need to create a TXT Resource Record in your dns configuration of this domain (prove of ownership).
  4. after a few minutes your domain should appear in the Domain Overview table
  5. You can use your domain in your ingresses
  6. You need to set the A Record of your own domain to the loadBalancerIp of the Namespace(detail view) where you use the deployment below
# Create hello world deploymentapiVersion: apps/v1kind: Deploymentmetadata:  name: nginxspec:  selector:    matchLabels:      app: nginx  template:    metadata:      labels:        app: nginx    spec:      containers:        - name: nginx          image: nginxdemos/hello          ports:            - name: http              containerPort: 80---# Create service for hello-world deploymentapiVersion: v1kind: Servicemetadata:  name: nginxspec:  ports:    - name: http      port: 80      protocol: TCP      targetPort: 80  selector:    app: nginx  type: ClusterIP---apiVersion: networking.k8s.io/v1beta1kind: Ingressmetadata:  name: nginx  annotations:    kubernetes.io/ingress.class: "nginx"spec:  rules:    - host: "my-host.org"      http:        paths:          - path: /            backend:              serviceName: "nginx"              servicePort: 80

The TLS-Certificate will automatically be created through Let's Encrypt.

Disable Automated TLS-Certificate creation#

To disable automated TLS-Certificate creation you can set the annotation mayope.managekubernetes.net/automatic-tls to false.

apiVersion: networking.k8s.io/v1beta1kind: Ingressmetadata:  name: nginx  annotations:    kubernetes.io/ingress.class: "nginx"    mayope.managekubernetes.net/automatic-tls: "false"spec:  rules:    - host: "my-host.org"      http:        paths:          - path: /            backend:              serviceName: "nginx"              servicePort: 80