Marcin Jahn | Dev Notebook
  • Home
  • Programming
  • Technologies
  • Projects
  • About
  • Home
  • Programming
  • Technologies
  • Projects
  • About
  • An icon of the Networking section Networking
    • HTTP Protocol
    • OSI Model
    • TCP Procol
    • UDP Protocol
    • WebSocket
    • HSTS
    • DNS
    • Server Name Indication
    • gRPC
  • An icon of the Security section Security
    • OAuth2
      • Sender Constraint
    • Cryptography
      • Cryptography Basics
    • TPM
      • Overiew
      • TPM Entities
      • TPM Operations
  • An icon of the Linux section Linux
    • Gist of Linux Tooling
    • Unknown
    • SELinux
    • Containers
    • Bash Scripting
    • Linux From Scratch
    • Networking
  • An icon of the Kubernetes section Kubernetes
    • Meaning and Purpose
    • Cluster
    • Dev Environment
    • Kubernetes API
    • Objects
    • Pods
    • Scaling
    • Events
    • Storage
    • Configuration
    • Organizing Objects
    • Services
    • Ingress
    • Helm
  • An icon of the Observability section Observability
    • Tracing
  • An icon of the Databases section Databases
    • ACID
    • Glossary
    • Index
    • B-Tree and B+Tree
    • Partitioning and Sharding
    • Concurrency
    • Database Tips
  • An icon of the SQL Server section SQL Server
    • Overview
    • T-SQL
  • An icon of the MongoDB section MongoDB
    • NoSQL Overview
    • MongoDB Overview
    • CRUD
    • Free Text Search
  • An icon of the Elasticsearch section Elasticsearch
    • Overview
  • An icon of the Git section Git
    • Git
  • An icon of the Ansible section Ansible
    • Ansible
  • An icon of the Azure section Azure
    • Table Storage
    • Microsoft Identity
  • An icon of the Google Cloud section Google Cloud
    • Overview
  • An icon of the Blockchain section Blockchain
    • Overview
    • Smart Contracts
    • Solidity
    • Dapps
  • Home Assistant
    • Home Assistant Tips
  • An icon of the Networking section Networking
    • HTTP Protocol
    • OSI Model
    • TCP Procol
    • UDP Protocol
    • WebSocket
    • HSTS
    • DNS
    • Server Name Indication
    • gRPC
  • An icon of the Security section Security
    • OAuth2
      • Sender Constraint
    • Cryptography
      • Cryptography Basics
    • TPM
      • Overiew
      • TPM Entities
      • TPM Operations
  • An icon of the Linux section Linux
    • Gist of Linux Tooling
    • Unknown
    • SELinux
    • Containers
    • Bash Scripting
    • Linux From Scratch
    • Networking
  • An icon of the Kubernetes section Kubernetes
    • Meaning and Purpose
    • Cluster
    • Dev Environment
    • Kubernetes API
    • Objects
    • Pods
    • Scaling
    • Events
    • Storage
    • Configuration
    • Organizing Objects
    • Services
    • Ingress
    • Helm
  • An icon of the Observability section Observability
    • Tracing
  • An icon of the Databases section Databases
    • ACID
    • Glossary
    • Index
    • B-Tree and B+Tree
    • Partitioning and Sharding
    • Concurrency
    • Database Tips
  • An icon of the SQL Server section SQL Server
    • Overview
    • T-SQL
  • An icon of the MongoDB section MongoDB
    • NoSQL Overview
    • MongoDB Overview
    • CRUD
    • Free Text Search
  • An icon of the Elasticsearch section Elasticsearch
    • Overview
  • An icon of the Git section Git
    • Git
  • An icon of the Ansible section Ansible
    • Ansible
  • An icon of the Azure section Azure
    • Table Storage
    • Microsoft Identity
  • An icon of the Google Cloud section Google Cloud
    • Overview
  • An icon of the Blockchain section Blockchain
    • Overview
    • Smart Contracts
    • Solidity
    • Dapps
  • Home Assistant
    • Home Assistant Tips

Ingress

Ingresses add features on top of services. Some of the features:

  • supporting L7 hosts
  • matching paths
  • TLS termination
  • session affinity
  • auth (e.g. OAuthProxy)
  • CORS
  • many other…

Ingress is a way for external users to access services within K8s. Ingress consists of:

  • Ingress object
  • L7 load balancer (reverse proxy)
  • Ingress Controller

Some ingress implementations require services to by of type ClusterIp. Some others require NodePort.

Some ingress implementations use separate (external) IP addresses per ingress object. Some others share the IP address for many ingress objects.

Most ingress implementations send requests to pods directly, skipping services (for performance?).

Nginx

Some of the most popular implementations of ingress use nginx. There are two implementations that use nginx: made by the K8s team, and another one made by the nginx team.

Most of the features of ingresses is configured via annotations. That’s due to variety of ingress implementations available on the market, each with different unique capabilities. It would be difficult to standardize the set of features that ingress should have, so the configuration exposed via Ingress object is minimal. Additionally, some ingresses are configured via separate K8s objects.

Default Backend

If no ingress rules match the request, normally a 404 is returned. We can specify a defualt backend service where unmatched requests will be sent to.

Multiple Ingress Controllers

We could have multiple ingress controllers installed on our cluster. In such a case, the ingress objects need to specify which controller should be used. Originally, it was done via the kubernetes.io/ingress.class annotation. Some ingress implementations still use it. It’s more recommended to rely on ingressClass. Different ingress controllers provide different classes. Installing a controller should automatically add a new ingressClass object to the cluster. We can list available classes with k get ingressclasses.

We can specify which controller to use via spec.ingressClassName on the ingress objects.

We are able to specify the default ingress class to be used by our ingress objects by setting an appropriate annotation on the selected class.

Custom ignress classes

We can create our own ingress classes that could refer to any installed ingress controllers. Some controllers allow specifying various parametes, and we could use our custom classes to provide these parameters.

With that approach we could reuse the specified config with multiple ingress objects by refering to our custom ingress class from them.

←  Services
Helm  →
© 2023 Marcin Jahn | Dev Notebook | All Rights Reserved. | Built with Astro.