Kommander uses Flux to manage the resources responsible for deploying apps such as Prometheus and Loki to the cluster. You can create an override configmap to change the properties of an application as described here:
https://support.d2iq.com/hc/en-us/articles/6426856722580-How-to-increase-the-memory-limits-of-the-kommander-cm-pod
However, how would you change the values of the Pod responsible for reading in these overrides and managing application deployments? If you attempt to modify the deployment for source controller directly, you will find that it is immediately reverted to its original state. If the source controller pod is oom-killing and you need to bump the memory limit for its pod from 1G to 2G, you will have to modify the template stored in Gitea in order to solve this issue. DKP 2.2.1 has improvements for memory management over DKP 2.2.1, so in addition to solving any oomkill issues via the method below, we encourage you to upgrade to 2.2.1 for these improvements.
1. Clone the Git Repository stored in Gitea that is used to manage the source controller:
kubectl -n kommander get secret kommander-traefik-certificate -o go-template='{{index .data "ca.crt"|base64decode}}' > ca.crt && git clone -c http.sslCAInfo=$(pwd)/ca.crt https://$(kubectl -n kommander get secret admin-git-credentials -o go-template='{{.data.username|base64decode}}:{{.data.password|base64decode}}')@$((kubectl -n kommander get cm konvoyconfig-kubeaddons -o go-template='{{if ne .data.clusterHostname ""}}{{.data.clusterHostname}}{{"\n"}}{{end}}' &&
kubectl -n kommander get ingress gitea -o jsonpath="{.status.loadBalancer.ingress[0]['ip','hostname']}") | head -1)/dkp/kommander/git/kommander/kommander
Note: For 2.3.x, there were some changes to the objects being queried, you may use the following snippet to arrive at the same outcome (cloned Git repo)
# GETS THE CRT file
kubectl --kubeconfig=${CLUSTER_NAME}.conf -n kommander get secret kommander-traefik-tls -o go-template='{{index .data "ca.crt"|base64decode}}' > ca.crt
# ASSEMBLE URL HERE
USERANDPASS=$(kubectl --kubeconfig=${CLUSTER_NAME}.conf -n kommander get secret admin-git-credentials -o go-template='{{.data.username|base64decode}}:{{.data.password|base64decode}}')
GITEAINGRESS=$(kubectl --kubeconfig=${CLUSTER_NAME}.conf -n kommander get ingress gitea -o jsonpath="{.status.loadBalancer.ingress[0]['ip','hostname']}")
# USES THE CRT ABOVE
git clone -c http.sslCAInfo=$(pwd)/ca.crt https://$USERANDPASS@$GITEAINGRESS/dkp/kommander/git/kommander/kommander
2. This will create a folder called kommander. Go to kommander/services/kommander-flux/0.27.4/templates and edit the file called:
apps_v1_deployment_source-controller.yaml
This is the template file used to control the source-controller deployment in your cluster. Change the resource limit in this file to 2g then save it.
3. Push the change you made back to Gitea:
git add apps_v1_deployment_source-controller.yaml
git commit -m 'update source-controller-resources'
git push
4. Check that the source controller pod has restarted:
kubectl get pods -A | grep source
kommander-flux source-controller-584d7f5d98-8rxgc 0/1 ContainerCreating 0 2s
5. Once the pod is running, check its config to ensure you now have 2g as a memory limit.