tencent cloud

Tencent Kubernetes Engine

Release Notes and Announcements
Release Notes
Announcements
Release Notes
Product Introduction
Overview
Strengths
Architecture
Scenarios
Features
Concepts
Native Kubernetes Terms
Common High-Risk Operations
Regions and Availability Zones
Service Regions and Service Providers
Open Source Components
Purchase Guide
Purchase Instructions
Purchase a TKE General Cluster
Purchasing Native Nodes
Purchasing a Super Node
Getting Started
Beginner’s Guide
Quickly Creating a Standard Cluster
Examples
Container Application Deployment Check List
Cluster Configuration
General Cluster Overview
Cluster Management
Network Management
Storage Management
Node Management
GPU Resource Management
Remote Terminals
Application Configuration
Workload Management
Service and Configuration Management
Component and Application Management
Auto Scaling
Container Login Methods
Observability Configuration
Ops Observability
Cost Insights and Optimization
Scheduler Configuration
Scheduling Component Overview
Resource Utilization Optimization Scheduling
Business Priority Assurance Scheduling
QoS Awareness Scheduling
Security and Stability
TKE Security Group Settings
Identity Authentication and Authorization
Application Security
Multi-cluster Management
Planned Upgrade
Backup Center
Cloud Native Service Guide
Cloud Service for etcd
TMP
TKE Serverless Cluster Guide
TKE Registered Cluster Guide
Use Cases
Cluster
Serverless Cluster
Scheduling
Security
Service Deployment
Network
Release
Logs
Monitoring
OPS
Terraform
DevOps
Auto Scaling
Containerization
Microservice
Cost Management
Hybrid Cloud
AI
Troubleshooting
Disk Full
High Workload
Memory Fragmentation
Cluster DNS Troubleshooting
Cluster kube-proxy Troubleshooting
Cluster API Server Inaccessibility Troubleshooting
Service and Ingress Inaccessibility Troubleshooting
Common Service & Ingress Errors and Solutions
Engel Ingres appears in Connechtin Reverside
CLB Ingress Creation Error
Troubleshooting for Pod Network Inaccessibility
Pod Status Exception and Handling
Authorizing Tencent Cloud OPS Team for Troubleshooting
CLB Loopback
API Documentation
History
Introduction
API Category
Making API Requests
Elastic Cluster APIs
Resource Reserved Coupon APIs
Cluster APIs
Third-party Node APIs
Relevant APIs for Addon
Network APIs
Node APIs
Node Pool APIs
TKE Edge Cluster APIs
Cloud Native Monitoring APIs
Scaling group APIs
Super Node APIs
Other APIs
Data Types
Error Codes
TKE API 2022-05-01
FAQs
TKE General Cluster
TKE Serverless Cluster
About OPS
Hidden Danger Handling
About Services
Image Repositories
About Remote Terminals
Event FAQs
Resource Management
Service Agreement
TKE Service Level Agreement
TKE Serverless Service Level Agreement
Contact Us
Glossary

Quick Start

PDF
Mode fokus
Ukuran font
Terakhir diperbarui: 2024-08-12 17:48:23

Overview

Nginx Ingress Controller is a Kubernetes Ingress controller based on the high-performance NGINX reverse proxy, and it is also one of the most commonly used open-source Ingress implementations. This document explains how to self-build an Nginx Ingress Controller in the TKE environment, mainly using helm for installation and providing some values.yaml configuration guidance.

Prerequisites

A TKE cluster is created.
The helm is installed.
The TKE cluster's kubeconfig is configured, with the permissions to operate the TKE cluster. For more details, see connect to the cluster.

Installation with helm

Add helm repo:
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
View default configuration:
helm show values ingress-nginx/ingress-nginx
The Nginx Ingress dependent image is under the registry.k8s.io registry. In the network environment in Chinese mainland, it cannot be pulled. You can replace it with the mirror image in docker hub.
Prepare values.yaml:
controller: # The following configuration replaces the dependent image with the mirror image on docker hub to ensure it can be pulled in the environment in Chinese mainland.
image:
registry: docker.io
image: k8smirror/ingress-nginx-controller
admissionWebhooks:
patch:
image:
registry: docker.io
image: k8smirror/ingress-nginx-kube-webhook-certgen
defaultBackend:
image:
registry: docker.io
image: k8smirror/defaultbackend-amd64
opentelemetry:
image:
registry: docker.io
image: k8smirror/ingress-nginx-opentelemetry
Note:
All mirror images in the configuration use image-porter for long-term automatic synchronization, so you can perform installation and upgrade with confidence.
Installation:
helm upgrade --install ingress-nginx ingress-nginx/ingress-nginx \\
--namespace ingress-nginx --create-namespace \\
-f values.yaml
Note:
If you need to modify the values configuration or upgrade the version in the future, you can update Nginx Ingress Controller by running this command.
Check the traffic entry (CLB VIP or domain name):
$ kubectl get services -n ingress-nginx
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
ingress-nginx-controller LoadBalancer xxx.xx.xxx.xxx xxx.xx.xx.xxx 80:30683/TCP,443:32111/TCP 53s
ingress-nginx-controller-admission ClusterIP xxx.xx.xxx.xxx <none> 443/TCP 53s
Note:
EXTERNAL-IP of a LoadBalancer service is the VIP or domain name of the CLB. You can configure DNS resolution for it. If it is a VIP, configure an A record; if it is a CLB domain name, configure a CNAME record.

Versions and Upgrades

The version of Nginx Ingress needs to be compatible with the Kubernetes cluster version. Refer to the official Supported Versions table to confirm if the current cluster version supports the latest Nginx Ingress. If not, you need to specify the chart version during installation.
For example, if the current TKE cluster version is 1.24, the latest chart version can only be 4.7.*. Run the following commands to check available versions:
$ helm search repo ingress-nginx/ingress-nginx --versions | grep 4.7.
ingress-nginx/ingress-nginx 4.7.5 1.8.5 Ingress controller for Kubernetes using NGINX a...
ingress-nginx/ingress-nginx 4.7.3 1.8.4 Ingress controller for Kubernetes using NGINX a...
ingress-nginx/ingress-nginx 4.7.2 1.8.2 Ingress controller for Kubernetes using NGINX a...
ingress-nginx/ingress-nginx 4.7.1 1.8.1 Ingress controller for Kubernetes using NGINX a...
ingress-nginx/ingress-nginx 4.7.0 1.8.0 Ingress controller for Kubernetes using NGINX a...
You can see that the latest 4.7.* version is 4.7.5. Add the version number during installation:
helm upgrade --install ingress-nginx ingress-nginx/ingress-nginx \\
--version 4.7.5 \\
--namespace ingress-nginx --create-namespace \\
-f values.yaml
Note:
Before upgrading the TKE cluster, check if the current Nginx Ingress version is compatible with the upgraded cluster version. If not, upgrade Nginx Ingress first (run the preceding command to specify the chart version).

Using Ingress

Nginx Ingress implements the standard capabilities of Kubernetes's Ingress API definition. For basic usage of Ingress, refer to the Kubernetes official documentation.
You must specify ingressClassName as IngressClass (nginx by default) used by the Nginx Ingress instance:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: nginx
spec:
ingressClassName: nginx
rules:
- http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: nginx
port:
number: 80
Additionally, Nginx Ingress has many other unique features. For details on extending the features of Ingress through Ingress annotations, refer to Nginx Ingress Annotations.

More Customization

If you need more customization for Nginx Ingress, refer to the following document and merge the values.yaml configuration as needed. The Complete Example of values.yaml Configuration provides a complete example of values.yaml configuration after merging.


Bantuan dan Dukungan

Apakah halaman ini membantu?

masukan