Giter Club home page Giter Club logo

Comments (5)

tao12345666333 avatar tao12345666333 commented on July 3, 2024

what's your helm version?

from kubernetes-ingress-controller.

HappyHuru avatar HappyHuru commented on July 3, 2024

Hi @tao12345666333

Thanks for the response. Let me clearly explain what I am trying to do with Kong on Kubernetes
I am new to Kong Ingress. I trying to deploy Kong as my ingress and ingress controller.

For my understanding:
I followed the below steps with respective versions

  1. Containerd - containerd containerd.io 1.6.26
  2. K8S Version
    Client Version: v1.28.0
    Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
    Server Version: v1.28.0
  3. Calico version
    Image: docker.io/calico/pod2daemon-flexvol:v3.26.4
    Image: docker.io/calico/cni:v3.26.4
    Image: docker.io/calico/node:v3.26.4

Steps to reproduce:

Ran the below helm commands to deploy kong in the cluster
reference: https://github.com/Kong/charts
I ran these commands to deploy kong

helm repo add kong https://charts.konghq.com
helm fetch kong/kong #this fetched the version kong-2.37.0
helm install kong kong/ -n kong

Error:

  1. When I am running this I am getting the error
    Error: parse error at (kong/templates/_helpers.tpl:1281): unclosed action

Workaround/Solution:

I changed the line kong/templates/_helpers.tpl:1281 into a single line
{{- if and (semverCompare ">= 3.1.0" (include "kong.effectiveVersion" .Values.ingressController.image)) (contains (print .Values.ingressController.env.feature_gates) "KongServiceFacade=true") }}

Result:

$ helm install kong kong/ -n kong
NAME: kong
LAST DEPLOYED: Wed Feb 19 09:12:48 2024
NAMESPACE: kong
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
To connect to Kong, please execute the following commands:

HOST=$(kubectl get svc --namespace kong kong-kong-proxy -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
PORT=$(kubectl get svc --namespace kong kong-kong-proxy -o jsonpath='{.spec.ports[0].port}')
export PROXY_IP=${HOST}:${PORT}
curl $PROXY_IP

Once installed, please follow along the getting started guide to start using
Kong: https://docs.konghq.com/kubernetes-ingress-controller/latest/guides/getting-started/

WARNING: Kong Manager will not be functional because the Admin API is not
enabled. Setting both .admin.enabled and .admin.http.enabled and/or
.admin.tls.enabled to true to enable the Admin API over HTTP/TLS.


This leads me to another confusions:

  1. As per the docs referred above recommend to deploy Gateway. However, my understanding is either Gateway or Ingress can be used to route the traffic. Please correct me if am understanding wrongly.
  2. Defining my K8S Cluster - Single node , K8s 1.28 running on GCP VM which has internal and external IP only.
  3. I deployed this kong in my dev namespace and tried to deploy ingress for my microservices.

changed kong-proxy service type to LoadBalancer
changed kong-admin service type to LoadBalancer (I deployed admin as I was receiving error that admin is required to start ingress controller)
added externalIPs: 34.x.x.x in values.yaml

  1. kong-proxy and kong-admin - picked my externalIP from values.yaml
  2. However I am getting error which is throwing from _helpers.tpl like that

Error

Error: could not retrieve Kong admin root: making HTTP request: Get "http://[localhost]:8001/": dial tcp localhost:80: connect: connection refused
Error: could not retrieve Kong admin root: making HTTP request: Get "http://[localhost]:8001/": dial tcp localhost:80: connect: connection refused

I changed localhost to loadBalancerIP in _helpers.tpl and updated externalIPs to loadBalancerIP in values.yaml. Updated service and container port of admin to 80 under http. Still I am facing same error.

Defaulted container "ingress-controller" out of: ingress-controller, proxy, clear-stale-pid (init)
time="2024-02-21T08:59:56Z" level=info msg="diagnostics server disabled"
time="2024-02-21T08:59:56Z" level=info msg="starting controller manager" commit=119dca97739dafee5f0539b96774144754328e8d logger=setup release=2.1.1 repo="https://github.com/Kong/kubernetes-ingress-controller.git"
time="2024-02-21T08:59:56Z" level=info msg="getting enabled options and features" logger=setup
time="2024-02-21T08:59:56Z" level=info msg="getting the kubernetes client configuration" logger=setup
W0221 08:59:56.413211 1 client_config.go:615] Neither --kubeconfig nor --master was specified. Using the inClusterConfig. This might not work.
time="2024-02-21T08:59:56Z" level=info msg="getting the kong admin api client configuration" logger=setup
time="2024-02-21T08:59:56Z" level=error msg="tag filtering disabled because Kong Admin API does not support tags" error="making HTTP request: Get "http://[35.238.59.45]:80/tags": dial tcp 35.238.59.45:80: connect: connection refused" logger=setup
Error: could not retrieve Kong admin root: making HTTP request: Get "http://[35.238.59.45]:80/": dial tcp 35.238.59.45:80: connect: connection refused
Error: could not retrieve Kong admin root: making HTTP request: Get "http://[35.238.59.45]:80/": dial tcp 35.238.59.45:80: connect: connection refused

Please help me what are the required components to be enabled if I want to deploy Kong as my ingressController. Currently, I am trying with http only.

Highly appreciate for the help.

from kubernetes-ingress-controller.

tao12345666333 avatar tao12345666333 commented on July 3, 2024

Thank you for the detailed steps. I will try to reproduce it.

from kubernetes-ingress-controller.

tao12345666333 avatar tao12345666333 commented on July 3, 2024

In the steps you mentioned above, you provided the following command.

helm repo add kong https://charts.konghq.com/
helm fetch kong/kong #this fetched the version kong-2.37.0
helm install kong kong/ -n kong

The last command shows that you installed it through the local Kong directory instead of installing it through the Kong Helm repo.

So you can try changing to a different directory, to ensure that there is no kong directory with the same name in the current directory.

from kubernetes-ingress-controller.

tao12345666333 avatar tao12345666333 commented on July 3, 2024

As per the docs referred above recommend to deploy Gateway. However, my understanding is either Gateway or Ingress can be used to route the traffic. Please correct me if am understanding wrongly.

Gateway is the component that actually carries traffic. After installing KIC, you have deployed both the KIC controller and Gateway.

jintao.zhang@kic-jt-test:~$ kubectl -n kong get pods 
NAME                       READY   STATUS    RESTARTS   AGE
kong-kong-58bb4bdc-bcl2c   2/2     Running   0          3m34s

The client's traffic only needs to access the svc named *-kong-proxy.

jintao.zhang@kic-jt-test:~$ kubectl -n kong get svc
NAME                           TYPE           CLUSTER-IP     EXTERNAL-IP    PORT(S)                         AGE
kong-kong-manager              NodePort       10.96.224.91   <none>         8002:30270/TCP,8445:30597/TCP   3m38s
kong-kong-proxy                LoadBalancer   10.96.43.82    172.18.128.2   80:32608/TCP,443:31650/TCP      3m38s
kong-kong-validation-webhook   ClusterIP      10.96.249.53   <none>         443/TCP                         3m38s

from kubernetes-ingress-controller.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.