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

Dns config support with Simple Scaleable Mode #15537

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

116davinder
Copy link

@116davinder 116davinder commented Dec 23, 2024

What this PR does / why we need it:
TPL function causes the DNSconfig to be a string instead it is object as per kubernetes pod spec.
Ref: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-dns-config

Which issue(s) this PR fixes:
N/A

Special notes for your reviewer:

Before this PR

  • Expects string
write:
  replicas: 3
  autoscaling:
    minReplicas: 3
    enabled: true
  dnsConfig: 1.1.1.1               # <---- accepts only string
  • Final rendered template
.....
      affinity:
        podAntiAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
          - labelSelector:
              matchLabels:
                app.kubernetes.io/component: write
            topologyKey: kubernetes.io/hostname
      dnsConfig:
        1.1.1.1
      volumes:
        - name: config
          configMap:
            name: loki
            items:
              - key: "config.yaml"
                path: "config.yaml"
        - name: runtime-config
....
  • try to pass correct format as per k8s spec then helm chart fails as it expects a string instead of object.
write:
  replicas: 3
  autoscaling:
    enabled: true
    minReplicas: 3
  dnsConfig:
    nameservers:
      - 1.1.1.1
    searches:
      - .s3-outposts.me-south-1.amazonaws.com
$ helm template grafana/loki -f grafana-loki.yaml --debug
install.go:218: [debug] Original chart version: ""
install.go:235: [debug] CHART PATH: /home/pox/.cache/helm/repository/loki-6.24.0.tgz


Error: template: loki/templates/write/statefulset-write.yaml:154:16: executing "loki/templates/write/statefulset-write.yaml" at <.>: wrong type for value; expected string; got map[string]interface {}
helm.go:84: [debug] template: loki/templates/write/statefulset-write.yaml:154:16: executing "loki/templates/write/statefulset-write.yaml" at <.>: wrong type for value; expected string; got map[string]interface {}

After PR*

  • DNS Config will be object as per k8s spec as mentioned below
write:
  replicas: 3
  autoscaling:
    enabled: true
    minReplicas: 3
  dnsConfig:
    nameservers:
      - 1.1.1.1
    searches:
      - .s3-outposts.me-south-1.amazonaws.com
  • final rendered template
      affinity:
        podAntiAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
          - labelSelector:
              matchLabels:
                app.kubernetes.io/component: write
            topologyKey: kubernetes.io/hostname
      dnsConfig:
        nameservers:
        - 1.1.1.1
        searches:
        - s3-outposts.me-south-1.amazonaws.com
      volumes:
        - name: config
          configMap:
            name: loki
            items:
              - key: "config.yaml"
                path: "config.yaml"
  • final changes in the POD resolve.conf
/ $ cat /etc/resolv.conf
search default.svc.cluster.local svc.cluster.local cluster.local me-south-1.compute.internal s3-outposts.me-south-1.amazonaws.com
nameserver 10.104.0.10
nameserver 1.1.1.1
options ndots:5

* Update statefulset-write.yaml

Signed-off-by: DAVINDER PAL <dpsangwal@gmail.com>
Signed-off-by: DAVINDER PAL <dpsangwal@gmail.com>
Signed-off-by: DAVINDER PAL <dpsangwal@gmail.com>
Signed-off-by: DAVINDER PAL <dpsangwal@gmail.com>
@116davinder 116davinder requested a review from a team as a code owner December 23, 2024 08:26
@CLAassistant
Copy link

CLAassistant commented Dec 23, 2024

CLA assistant check
All committers have signed the CLA.

@116davinder 116davinder changed the title Dns config Simple Scaleable Mode Dns config support with Simple Scaleable Mode Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants