Ingress in Managed Namespace
The Mayope Managed Namespace assists you exposing your http services to the web.
#
Deploy an ingress with dynamic domainIf you don't have an own domain yet, you can use a dynamic mayope domain for this purpose.
#
Request- Go to the
Namespace
tab - Chose the namespace where you want to deploy your LoadBalancer Service
- Click on the
Domains
drawer at the bottom of the detail view - Click on
Request Dynamic Domain
, enter your desired prefix and click onRequest
: - After successfully requesting, your Domain should be displayed in the Table
- 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 domainYou 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.
- Enter your domain in the
Request own domain
form - Submit with the
Request Domain
button - You wil need to create a TXT Resource Record in your dns configuration of this domain (prove of ownership).
- after a few minutes your domain should appear in the
Domain Overview
table - You can use your domain in your ingresses
- You need to set the
A Record
of your own domain to theloadBalancerIp
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 creationTo 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