yugabyte / charts

Respository of all helm charts that are owned by YugabyteDB for database deployment acroos various K8s configurations
36 stars 41 forks source link

[PLAT-8803] [YBA] Add extra volume support for postgres container #166

Closed shinji62 closed 1 year ago

shinji62 commented 1 year ago

On a system with huge_page enabled it seems more reasonable to just mount the huge page config into the container, that will avoid any issues that we can faced when trying to deactivate huge_page which doesn't seems to fully work anyway.

For example for the Postgres container with we disabled huge_page on the Postgres conf the container start but resource shared_buffer 400Kb and max_connections 20 seems limited,

fixing permissions on existing directory /var/lib/postgresql/data/pgdata ... ok  
creating subdirectories ... ok                          
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 20                
selecting default shared_buffers ... 400kB              
selecting default time zone ... Etc/UTC                 
creating configuration files ... ok                     
running bootstrap script ... ok                         
performing post-bootstrap initialization ... ok     

When mounting the hugepage into the container we can see the shared_buffer and the max connections are ok

fixing permissions on existing directory /var/lib/postgresql/data/pgdata ..ok            
creating subdirectories ... ok                           
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100               
selecting default shared_buffers ... 128MB              
selecting default time zone ... Etc/UTC                 
creating configuration files ... ok                     
running bootstrap script ... ok                         
performing post-bootstrap initialization ... ok         
syncing data to disk ... ok

To reproduce

1- Create a EKS cluster 2- SSH to one of the node and enable hugepagee

echo "vm.nr_hugepages=256" >> /etc/sysctl.conf
sysctl -p
sudo systemctl restart kubelet

3- Deploy yba to the specific host with node selector

nodeSelector:
  kubernetes.io/hostname: hostname # you can check with kubectl get nodes --show-labels

helm upgrade --install yw-test yugabytedb/yugaware --version 2.17.2 -n yb-platform --values your_yba-value.yml

4- if you don't mount the hugepage you will see that YBA can be deployed because of max connections reached.

shinji62 commented 1 year ago

cc @iSignal

shinji62 commented 1 year ago

@bhavin192 Let me know if you need any changes

shinji62 commented 1 year ago

@bhavin192 I have updated the PR please merge it when you can, you will be nice to do the fix for 2.18 as well