系统环境。
kubeadm version
kubeadm version: &version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.4", GitCommit:"224be7bdce5a9dd0c2fd0d46b83865648e2fe0ba", GitTreeState:"clean", BuildDate:"2019-12-11T12:44:45Z", GoVersion:"go1.12.12", Compiler:"gc", Platform:"linux/amd64"}
helm version
version.BuildInfo{Version:"v3.0.1", GitCommit:"7c22ef9ce89e0ebeb7125ba2ebf7d421f3e82ffa", GitTreeState:"clean", GoVersion:"go1.13.4"}
helm repo list
NAME URL
stable https://kubernetes-charts.storage.googleapis.com
aliyuncs https://apphub.aliyuncs.com
bitnami https://charts.bitnami.com/bitnami
查找Kong Chart,并安装。
helm search repo kong
NAME CHART VERSION APP VERSION DESCRIPTION
aliyuncs/kong 0.27.0 1.3 The Cloud-Native Ingress and Service Mesh for A...
stable/kong 0.28.0 1.3 The Cloud-Native Ingress and Service Mesh for A...
helm install gateway stable/kong --version 0.28.0 \
--set admin.useTLS=false \
--set admin.nodePort=32444 \
--set proxy.http.nodePort=32080 \
--set proxy.tls.nodePort=32443 \
--set replicaCount=2
NAME: gateway
LAST DEPLOYED: Sun Dec 15 13:18:30 2019
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
1. Kong Admin can be accessed inside the cluster using:
DNS=gateway-kong-admin.default.svc.cluster.local
PORT=8444
To connect from outside the K8s cluster:
HOST=$(kubectl get nodes --namespace default -o jsonpath='{.items[0].status .addresses[0].address}')
PORT=$(kubectl get svc --namespace default gateway-kong-admin -o jsonpath=' {.spec.ports[0].nodePort}')
2. Kong Proxy can be accessed inside the cluster using:
DNS=gateway-kong-proxy.default.svc.cluster.localPORT=443To connect from out side the K8s cluster:
HOST=$(kubectl get nodes --namespace default -o jsonpath='{.items[0].status .addresses[0].address}')
PORT=$(kubectl get svc --namespace default gateway-kong-proxy -o jsonpath=' {.spec.ports[0].nodePort}')
查看Kubernetes各资源状态。
kubectl get all
NAME READY STATUS RESTARTS AGE
pod/gateway-kong-67fb7768ff-c6wg6 2/2 Running 2 6m59s
pod/gateway-kong-67fb7768ff-qczw5 2/2 Running 1 6m59s
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/gateway-kong-admin NodePort 10.1.31.119 <none> 8444:32444/TCP 7m
service/gateway-kong-proxy NodePort 10.1.244.45 <none> 80:32080/TCP,443:32443/TCP 7m
service/kubernetes ClusterIP 10.1.0.1 <none> 443/TCP