Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to define the coredns and metrics-server pod resources #11342

Closed
fmunteanu opened this issue Nov 19, 2024 · 3 comments
Closed

Ability to define the coredns and metrics-server pod resources #11342

fmunteanu opened this issue Nov 19, 2024 · 3 comments

Comments

@fmunteanu
Copy link

fmunteanu commented Nov 19, 2024

Environmental Info:
K3s Version:

# k3s -v
k3s version v1.30.6+k3s1 (1829eaae)
go version go1.22.8

Node(s) CPU architecture, OS, and Version:

# uname -a
Linux apollo 6.8.0-1014-raspi #16-Ubuntu SMP PREEMPT_DYNAMIC Tue Oct 15 20:54:23 UTC 2024 aarch64 aarch64 aarch64 GNU/Linux

Cluster Configuration:
3 servers + 5 agents, HA enabled

Describe the bug:
I looked at the server configuration documentation and I could find any relevant setting allowing me to define the coredns and metrics-server resources. I also did a search through closed issues, without finding any relevant information. I see for example the metrics-server pod resources set to:

    Requests:
      cpu:        100m
      memory:     70Mi

Where are these values configured? Ideally, I would like to also set the number of pods to 2 (instead of 1), not sure if this is recommended.

Current server configuration on apollo server:

# cat /etc/rancher/k3s/config.yaml
bind-address: 192.168.4.2
cluster-dns: 10.43.0.10
cluster-domain: cluster.local
disable:
  - local-storage
  - servicelb
  - traefik
disable-cloud-controller: true
disable-kube-proxy: true
disable-network-policy: true
embedded-registry: true
etcd-expose-metrics: true
flannel-backend: none
kube-controller-manager-arg: bind-address=192.168.4.2
kube-scheduler-arg: bind-address=192.168.4.2
node-taint:
  - node.cilium.io/agent-not-ready:NoExecute
  - node-role.kubernetes.io/control-plane:NoSchedule
server: https://192.168.4.10:6443
tls-san:
  - 192.168.4.10
token: redacted
@dereknola
Copy link
Member

The values you are looking for are defined in https://github.com/k3s-io/k3s/blob/master/manifests/coredns.yaml#L125-L130. They are controlled via the manifests for the pods. You will need to override those values with your own using. https://docs.k3s.io/helm#customizing-packaged-components-with-helmchartconfig.

@fmunteanu
Copy link
Author

fmunteanu commented Nov 19, 2024

Thank you for the useful information @dereknola. Just some clarification, your Helm example talks about HelmChartConfig kind, but my changed are related to Deployment kind. What would be the proper template format, DeploymentConfig?

Since containers are a list, setting a specific value will delete the other list elements:

apiVersion: helm.cattle.io/v1
kind: DeploymentConfig
metadata:
  name: coredns
  namespace: kube-system
spec:
  template:
    spec:
      containers:
      - name: coredns
        resources:
          limits:
            cpu: null
            memory: 256Mi
          requests:
            cpu: 100m
            memory: 256Mi

What would be the correct template format?

@github-project-automation github-project-automation bot moved this from New to Done Issue in K3s Development Nov 19, 2024
@fmunteanu fmunteanu reopened this Nov 19, 2024
@brandond
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done Issue
Development

No branches or pull requests

3 participants