Tutorials  /  Container & Cloud

Setting Up Nginx Ingress Controller on centron Kubernetes with Helm

Ccentron Redaktion · November 2024 ·3 min read ·Container & Cloud, Tutorial

We'll show you how to efficiently manage inbound traffic on your centron Kubernetes cluster using Helm and the Nginx Ingress Controller. From installation to configuring TLS certificates with Let's Encrypt – this guide takes you through each step for smooth configuration. Optimize your routing strategies and secure your applications with this comprehensive tutorial.

Step 1: Installing the Nginx Ingress Controller

# Add the Ingress-nginx Helm repository:

helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx

# Update your system to inform Helm of the contents of the new repository:

helm repo update

# Install the Nginx Ingress Controller on your cluster:

helm install nginx-ingress ingress-nginx/ingress-nginx --set controller.publishService.enabled=true

K8

Matching infrastructure at centron

From container to cluster: managed Kubernetes with cStack starts at €29.99 per month – control plane, autoscaler and traffic included. Explore managed Kubernetes →

Step 2: Configuring DNS Records

After installing the Ingress Controller, configure your DNS records to point to the load balancer created by the controller. This allows the Ingress Controller to route incoming traffic to the correct services. Use the A records of your domains to point to the IP address of the load balancer.

Step 3: Creating an Ingress Resource

An Ingress resource defines how incoming HTTP and HTTPS traffic from outside the cluster is routed to services within the cluster. Here’s an example of a simple Ingress resource:

apiVersion: networking.k8s.io/v1

kind: Ingress

metadata:

name: example-ingress

spec:

rules:

- host: example.com

http:

paths:

- path: /

pathType: Prefix

backend:

service:

name: example-service

port:

number: 80

This Ingress resource directs traffic from "example.com" to the "example-service" service.

Step 4: Securing the Ingress Resource with TLS

To enhance the security of your applications, you should use TLS certificates to encrypt communication between your users and your cluster. To do this, install Cert-Manager and create a ClusterIssuer for Let's Encrypt. Then configure your Ingress resources to use TLS and leverage the created certificates.

apiVersion: networking.k8s.io/v1

kind: Ingress

metadata:

name: example-ingress

annotations:

cert-manager.io/cluster-issuer: letsencrypt-prod

spec:

tls:

- hosts:

- example.com

secretName: example-tls-secret

rules:

- host: example.com

http:

paths:

- path: /

pathType: Prefix

backend:

service:

name: example-service

port:

number: 80

This Ingress resource uses TLS certificates from Let's Encrypt to encrypt traffic for the domain "example.com".

Conclusion

Setting up the Nginx Ingress Controller, configuring DNS records, creating Ingress resources, and using TLS certificates with Cert-Manager are essential steps to manage your Kubernetes cluster resources securely and efficiently. These steps enable you to securely and reliably operate your applications on the Internet. Guide: Setting Up Nginx Ingress Controller on centron Kubernetes with Helm Configuration

Jetzt 200 € Guthaben sichern

Testen Sie Ihr Setup auf ccloud³

Registrieren Sie sich in der ccloud³ und erhalten Sie 200 € Startguthaben für Ihr Projekt – z. B. für eine PostgreSQL-VM mit automatischen Backups.

centron Redaktion Technische Redaktion

Das Redaktionsteam von centron schreibt Anleitungen aus dem Betriebsalltag: getestet auf unserer eigenen Plattform, betrieben im Rechenzentrum in Hallstadt bei Bamberg.

Kategorie Container & Cloud
Teilen
Noch offene Fragen?

Unser Team hilft Ihnen bei Ihrem konkreten Setup weiter – von Menschen, die die Plattform selbst betreiben.

War dieses Tutorial hilfreich?

Ihre Antwort wird anonym gespeichert und hilft uns, die Tutorials zu verbessern.

Kommentare

Noch keine Kommentare – stellen Sie die erste Frage zu diesem Tutorial.

Zum Kommentieren anmelden

Kommentare stehen centron-Kunden offen. Melden Sie sich in Ihrem Konto an, um eine Frage zu diesem Tutorial zu stellen.

Weiterlesen

Das könnte Sie auch interessieren

Jetzt kostenlos anfangen

Melden Sie sich an und erhalten Sie in den ersten 60 Tagen ein Guthaben von 200 € bei centron.

Dieses Werbeangebot gilt nur für neue Konten. Angebot ausschließlich für Gewerbetreibende.

Jetzt loslegen Sales kontaktieren