Kong Ingress Controller의 CRD 상세 설명
3331 단어 kong
이것은 API 게이트웨이 Kong의 학습 노트 중의 한 편으로 사용 과정에서 겪은 문제와 해결 방법은 API 게이트웨이 Kong의 사용 과정에서 겪은 문제와 해결 방법을 기록한다.
API 게이트웨이 Kong 학습노트(二): Kong과 Kubernetes를 통합하는 방법에서 Kong Ingress Controller가 정의한
CustomResourceDefinitions를 소개했는데 그때 아는 것이 많지 않고 사용법을 상세하게 기록하지 않았다.Kong Ingress Controller의 코드를 읽은 후에 기본적으로 그의 작업 과정을 파악했다. 여기에 KongPlugin,KongConsumer,KongIngress와 KongCredential의 용법을 상세하게 기록한다.KongPlugin 사용 방법
KongPlugin 형식은 다음과 같습니다.
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: Kong은 많은 플러그인을 실현했고 플러그인마다 설정이 같지 않으며 이러한 설정은 모두
config에 나타난다.rate-limiting 플러그인의 실례는 다음과 같습니다.apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: http-svc-consumer-ratelimiting
consumerRef: consumer-team-x
config:
hour: 1000
limit_by: ip
second: 100
plugin: rate-limiting
ip-restriction 플러그 인의 예는 다음과 같습니다.apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: echo-ip-restriction
namespace: demo-echo
disabled: false # optional
plugin: ip-restriction
config:
# whitelist: # “,” IP CIDR, 、
blacklist: 192.168.33.12,172.16.129.1
그것들
config 필드의 구조는 다르다. 모든 플러그인의config 필드에 어떤 설정이 있는지 플러그인 플러그인 문서에서 찾을 수 있다.rate-limiting, ip-restriction.KongIngress 사용 방법
KongIngress 중 일부 인 점에 각별히 주의해야 한다.Kong ingress controller는kubernetes에서 원생적으로 정의한ingress를kong의 설정으로 변환하지만,kong의 설정은 표준ingress의 내용보다 많고, 더 많은 설정은Kong Ingress에서 설정합니다.KongIngress의 구조는 다음과 같다
upstream,proxy와route 세 부분으로 구성된다.apiVersion: configuration.konghq.com/v1
kind: KongIngress
metadata:
name: configuration-demo
upstream:
hash_on: none
hash_fallback: none
healthchecks:
active:
concurrency: 10
healthy:
http_statuses:
- 200
- 302
interval: 0
successes: 0
http_path: "/"
timeout: 1
unhealthy:
http_failures: 0
http_statuses:
- 429
interval: 0
tcp_failures: 0
timeouts: 0
passive:
healthy:
http_statuses:
- 200
successes: 0
unhealthy:
http_failures: 0
http_statuses:
- 429
- 503
tcp_failures: 0
timeouts: 0
slots: 10
proxy:
protocol: http
path: /
connect_timeout: 10000
retries: 10
read_timeout: 10000
write_timeout: 10000
route:
methods:
- POST
- GET
regex_priority: 0
strip_path: false
preserve_host: true
protocols:
- http
- https
upstream에 설정된 부하 균형 알고리즘, 건강 검사 방법 등proxy에 설정된kong과backendserver가 통신할 때 시간 초과, 재시도 횟수 등route에 설정된 것은 루트가 일치하는 프로토콜, 방법과 루트의 우선순위이다.
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Mac 설치 Kong (2) OpenResty 'nginx' 실행 파일 을 찾 을 수 없습니다.Mac 설치 Kong (2) OpenResty 'nginx' 실행 파일 을 찾 을 수 없습니다. 나중에 동료 들 을 도와 nginx 를 디 버 깅 하고 현지에서 nginx 를 따로 설치 해서 openresty 를 닫...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.