All posts

Create and Manage Kubernetes Ingress with Kubectl

The cluster is running, pods are healthy, services are online—yet the outside world can’t reach them. This is where Kubernetes Ingress comes in, and kubectl is your direct control. Ingress defines external access to internal services. Unlike a NodePort or LoadBalancer Service, an Ingress lets you route traffic based on hostnames and paths. It also integrates with TLS to secure requests. Using kubectl, you configure and inspect these rules without leaving your terminal. Create an Ingress with

Free White Paper

cert-manager for Kubernetes: The Complete Guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free. No spam. Unsubscribe anytime.

The cluster is running, pods are healthy, services are online—yet the outside world can’t reach them. This is where Kubernetes Ingress comes in, and kubectl is your direct control.

Ingress defines external access to internal services. Unlike a NodePort or LoadBalancer Service, an Ingress lets you route traffic based on hostnames and paths. It also integrates with TLS to secure requests. Using kubectl, you configure and inspect these rules without leaving your terminal.

Create an Ingress with Kubectl

First, ensure an Ingress controller is deployed. Popular options include NGINX, Traefik, and HAProxy. Without a controller, Ingress resources will sit idle.

Define an Ingress manifest (ingress.yaml):

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
 name: demo-ingress
spec:
 rules:
 - host: app.example.com
 http:
 paths:
 - path: /
 pathType: Prefix
 backend:
 service:
 name: demo-service
 port:
 number: 80

Apply it:

Continue reading? Get the full guide.

cert-manager for Kubernetes: Architecture Patterns & Best Practices

Free. No spam. Unsubscribe anytime.
kubectl apply -f ingress.yaml

Inspect and Debug

View your Ingress:

kubectl get ingress

Describe it for detailed status:

kubectl describe ingress demo-ingress

Check events for issues with routing or TLS:

kubectl get events --sort-by=.metadata.creationTimestamp

Securing with TLS

Add a tls block to your manifest and reference a Kubernetes Secret containing your certificate:

tls:
- hosts:
 - app.example.com
 secretName: tls-secret

Create the secret:

kubectl create secret tls tls-secret \
 --cert=cert.pem \
 --key=key.pem

Best Practices

  • Always deploy an Ingress controller before creating an Ingress resource.
  • Use host-based routing for clarity and maintainability.
  • Automate certificate renewal with cert-manager.
  • Monitor Ingress logs to detect routing errors early.

Mastering kubectl with Kubernetes Ingress means faster deployments, cleaner routing rules, and secure endpoints for your applications. See it live in minutes with hoop.dev.

Get started

See hoop.dev in action

One gateway for every database, container, and AI agent. Deploy in minutes.

Get a demoMore posts