Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Installation and use of kong in kubernetes

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "the installation and use of kong in kubernetes". In the daily operation, I believe many people have doubts about the installation and use of kong in kubernetes. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "the installation and use of kong in kubernetes". Next, please follow the editor to study!

Refer to the official website:

Https://github.com/Kong/kubernetes-ingress-controller

Https://github.com/Kong/charts

Https://blog.csdn.net/qianghaohao/article/details/99691727

Install using helm

Download the appropriate helm example https://github.com/Kong/charts/tree/main/charts/kong/example-values

This download

Wget https://raw.githubusercontent.com/Kong/charts/main/charts/kong/example-values/minimal-kong-standalone.yaml

-refer to the modified configuration minimal-kong-standalone.yaml

Image: repository: kong tag: "2.3" env: prefix: / kong_prefix/ database: postgresadmin: enabled: true # modify ClusterIP, public network cannot access type: ClusterIP http: enabled: true servicePort: 8001 containerPort: 800 private k8s. Export NodePortproxy: type: NodePort http: nodePort: 30002 tls: nodePort: 30000postgresql: enabled: true persistence: storageClass: rook-cephfs accessModes:-ReadWriteMany postgresqlUsername: kong postgresqlDatabase: kong # fixed password, not random postgresqlPassword: Kong.=2021! PostgresqlPostgresPassword: Kong.=2021! Service: port: 5432ingressController: enabled: true installCRDs: false

Install kong

# install to the default default space helm install kong kong/kong-f minimal-kong-standalone.yamlhelm upgrade kong kong/kong-f minimal-kong-standalone.yaml

Install konga. Konga is a UI library that calls kong-admin to manage kong https://github.com/pantsel/konga

ApiVersion: apps/v1kind: Deploymentmetadata: name: konga labels: app: kongaspec: replicas: 1 selector: matchLabels: app: konga template: metadata: labels: app: kongaspec: containers:-env:-name: DB_ADAPTER value: postgres-name: DB_URI # kong-postgresql is service name value: "postgresql://kong : TCP restartPolicy: Always---apiVersion: v1kind: Servicemetadata: name: kongaspec: ports:-name: 1337 targetPort: 1337 protocol: TCP selector: app: konga---apiVersion: networking.k8s.io/v1kind: Ingressmetadata: name : konga-ingress annotations: kubernetes.io/ingress.class: kongspec: rules:-host: konga.your_domain.com http: paths:-path: / pathType: ImplementationSpecific backend: service: name: konga port: number: 1337

Effect of konga after operation

Prometheus monitoring of kong. First enable prometheus in konga

Install ServiceMonitor for prometheus. Prometheus installation reference https://my.oschina.net/u/160697/blog/3197715

ApiVersion: monitoring.coreos.com/v1kind: ServiceMonitormetadata: name: prometheus-kong # needs to fix release: prometheus. The default created prometheus uses this tag to identify that labels: release: prometheusspec: # is not in the same namespace, plus the service tag matching namespaceSelector namespaceSelector: matchNames:-default # selector: matchLabels: app.kubernetes.io/name: kong endpoints: # service corresponding to the port name-port: kong-admin. This ends the study of "installation and use of kong in kubernetes". I hope I can solve everyone's doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report