kubernetes: deploying kong helm chart

2/11/2019

I deploy kong via helm on my kubernetes cluster but I can't configure it as I want.

helm install stable/kong -f values.yaml

value.yaml:

{
   "persistence.size":"1Gi",
   "persistence.storageClass":"my-kong-storage"
}

Unfortunately, the created persistenceVolumeClaim stays at 8G instead of 1Gi. Even adding "persistence.enabled":false has no effect on deployment. So I think my all my configuration is bad.

What should be a good configuration file?

I am using kubernetes rancher deployment on bare metal servers. I use Local Persistent Volumes. (working well with mongo-replicaset deployment)

-- Slim
kong
kubernetes
kubernetes-helm

2 Answers

2/12/2019

What you are trying to do is to configure a dependency chart (a.k.a subchart ) which is a little different from a main chart when it comes to writing values.yaml. Here is how you can do it:

As postgresql is a dependency chart for kong so you have to use the name of the dependency chart as a key then the rest of the options you need to modify in the following form:

The content of values.yaml does not need to be surrounded with curly braces. so you need to remove it from the code you posted in the question.

<dependcy-chart-name>:
  <configuration-key-name>: <configuration-value>

For Rancher you have to write it as the following:

#values.yaml for rancher
postgresql.persistence.storageClass: "my-kong-storage"
postgresql.persistence.size: "1Gi"

Unlike if you are using helm itself with vanilla kubernetes - at least - you can write the values.yml as below:

#values.yaml for helm
postgresql:
  persistence:
    storageClass: "my-kong-storage"
    size: "1Gi"
-- Mostafa Hussein
Source: StackOverflow

2/12/2019

Please tell us which cluster setup you are using. A cloud managed service? Custom setup kubernetes?

The problem you are facing is that there is a "minimum size" of storage to be provisioned. For example in IBM Cloud it is 20 GB. So even if 2GB are requested in the PVC , you will end up with a 20GB PV.

Please check the documentation of your NFS Provisioner / Storage Class

-- LeonG
Source: StackOverflow