{"id":825,"date":"2022-02-04T16:39:31","date_gmt":"2022-02-04T15:39:31","guid":{"rendered":"https:\/\/www.ume.li\/blog\/?p=825"},"modified":"2022-02-08T15:03:51","modified_gmt":"2022-02-08T14:03:51","slug":"hcl-component-pack-7-mulitple-namespaces-downsize","status":"publish","type":"post","link":"https:\/\/www.ume.li\/blog\/2022\/02\/04\/hcl-component-pack-7-mulitple-namespaces-downsize\/","title":{"rendered":"HCL Component Pack 7 &#8211; Mulitple Namespaces &#8211; downsize"},"content":{"rendered":"<p>For smaller environments it&#8217;s possible to downsize most of the containers to 1 instance. Except for redis, mongo and elasticsearch. Checking the statefulsets, redis requires 75M to 1G, mongo from 50M to 200M, elasticsearch from 3Gi to 4Gi.<br \/>\nReducing the pods for redis and mongo is not an option. <\/p>\n<p>Example scale for mw-proxy<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nkubectl -n connections get deployments\r\nkubectl -n connections scale --replicas=1 deployment\/mw-proxy\r\n<\/pre>\n<p>So I focused on elasticsearch. There are 2 options. Reducing memory consumption and reducing the number of pods.<br \/>\nReduce the memory requirements can be achieved if you look at the helm chart.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nhelm show values elasticsearch7-0.1.0-20210427-114731.tgz  &gt; elasticsearch.yml\r\n<\/pre>\n<p>There you get all the parameters that can be set by helm.<\/p>\n<p>So for my testenvironment I ended with this yaml file:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nclient:\r\n  ES_JAVA_OPTS_XMS: -Xms512m\r\n  ES_JAVA_OPTS_XMX: -Xmx512m\r\n  replicas: 2\r\n  resources:\r\n    limits:\r\n      cpu: '2'\r\n      mem: 2048Mi\r\n    requests:\r\n      cpu: '0.1'\r\n      mem: 1024Mi\r\ncommon:\r\n  storageClassName: nfs-client\r\n  storageSize: 8Gi\r\ndata:\r\n  ES_JAVA_OPTS_XMS: -Xms768m\r\n  ES_JAVA_OPTS_XMX: -Xmx768m\r\n  replicas: 2\r\n  resources:\r\n    limits:\r\n      cpu: '2'\r\n      mem: 4096Mi\r\n    requests:\r\n      cpu: '0.5'\r\n      mem: 2048Mi\r\nimage:\r\n  repository: harbor-lab.belsoft.ch:443\/connections\r\n  tag: 20210427-114731\r\nmaster:\r\n  ES_JAVA_OPTS_XMS: -Xms512m\r\n  ES_JAVA_OPTS_XMX: -Xmx512m\r\n  replicas: 2\r\n  resources:\r\n    limits:\r\n      cpu: '1'\r\n      mem: 1024Mi\r\n    requests:\r\n      cpu: '0.1'\r\n      mem: 512Mi\r\nnamespace: connect6\r\nnodeAffinityRequired: false\r\ncreateSecret: false\r\nrollingUpdate:\r\n  maxSurge: 1\r\n  maxUnavailable: 0\r\ntag: 20210427-114731\r\n<\/pre>\n<p>That&#8217;s just a first try, maybe it can be reduced even a bit more agressive.<\/p>\n<p>I used this to install the helm chart.<br \/>\n<a href=\"https:\/\/www.ume.li\/blog\/2022\/02\/04\/hcl-component-pack-7-mulitple-namespaces-downsize\/selection_1058\/\" rel=\"attachment wp-att-827\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ume.li\/blog\/wp-content\/uploads\/2022\/02\/Selection_1058-300x75.png\" alt=\"\" width=\"300\" height=\"75\" class=\"alignleft size-medium wp-image-827\" srcset=\"https:\/\/www.ume.li\/blog\/wp-content\/uploads\/2022\/02\/Selection_1058-300x75.png 300w, https:\/\/www.ume.li\/blog\/wp-content\/uploads\/2022\/02\/Selection_1058.png 435w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>This setup requires some additional adjustments before you connect connections to elasticsearch: <\/p>\n<p>a) <a href=\"https:\/\/help.hcltechsw.com\/connections\/v7\/admin\/install\/inst_managing_es_index_cnx_typeahead_search.html?hl=shard\" title=\"Replica Count\" rel=\"noopener\" target=\"_blank\">change the number of replicas for quickresults<\/a>. I reduced the es-data to 2 pods, so the replica count should be set to 1 (default is 2). If you don&#8217;t adjust this value, the index will have a yellow or red status.<\/p>\n<p>b) It might be usefull to <a href=\"https:\/\/help.hcltechsw.com\/connections\/v7\/admin\/install\/cp_config_es_number_shards.html?hl=shard\" rel=\"noopener\" target=\"_blank\">reduce the shard counter <\/a>if you plan to use metrics.<\/p>\n<p>If you reduce the number of pods for elasticsearch after your indices have been created you may have a look at the <a href=\"https:\/\/www.elastic.co\/guide\/en\/elasticsearch\/reference\/current\/index-modules.html#dynamic-index-settings\" rel=\"noopener\" target=\"_blank\">index modules api<\/a> to bring your indices into a green state.<\/p>\n<p>After these modifications I&#8217;m down to 6.6G after restart.<br \/>\n<a href=\"https:\/\/www.ume.li\/blog\/2022\/02\/04\/hcl-component-pack-7-mulitple-namespaces-downsize\/selection_1059\/\" rel=\"attachment wp-att-828\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ume.li\/blog\/wp-content\/uploads\/2022\/02\/Selection_1059-300x100.png\" alt=\"\" width=\"300\" height=\"100\" class=\"alignleft size-medium wp-image-828\" srcset=\"https:\/\/www.ume.li\/blog\/wp-content\/uploads\/2022\/02\/Selection_1059-300x100.png 300w, https:\/\/www.ume.li\/blog\/wp-content\/uploads\/2022\/02\/Selection_1059.png 745w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>For smaller environments it&#8217;s possible to downsize most of the containers to 1 instance. Except for redis, mongo and elasticsearch.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[62,54,23],"tags":[67,24,73],"class_list":["post-825","post","type-post","status-publish","format-standard","hentry","category-62","category-component-pack","category-connections","tag-component-pack","tag-connections","tag-downsize"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.ume.li\/blog\/wp-json\/wp\/v2\/posts\/825","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ume.li\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ume.li\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ume.li\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ume.li\/blog\/wp-json\/wp\/v2\/comments?post=825"}],"version-history":[{"count":4,"href":"https:\/\/www.ume.li\/blog\/wp-json\/wp\/v2\/posts\/825\/revisions"}],"predecessor-version":[{"id":832,"href":"https:\/\/www.ume.li\/blog\/wp-json\/wp\/v2\/posts\/825\/revisions\/832"}],"wp:attachment":[{"href":"https:\/\/www.ume.li\/blog\/wp-json\/wp\/v2\/media?parent=825"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ume.li\/blog\/wp-json\/wp\/v2\/categories?post=825"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ume.li\/blog\/wp-json\/wp\/v2\/tags?post=825"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}