云容器引擎 CCE-使用NodeLocal DNSCache提升DNS性能:常见问题

时间:2023-12-06 15:24:56

常见问题

  • 如何避免DNSConfig自动注入?

    解决方案:

    如果某个工作负载需要避免DNSConfig自动注入,可在Pod模板的labels字段中添加node-local-dns-injection: disabled的标签。示例如下:
    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: test
      namespace: default
    spec:
      replicas: 2
      selector:
        matchLabels:
          app: test
      template:
        metadata:
          labels:
            app: test
            node-local-dns-injection: disabled   # 避免DNSConfig自动注入
        spec:
          containers:
            - name: container-1
              image: nginx:latest
              imagePullPolicy: IfNotPresent
          imagePullSecrets:
            - name: default-secret
support.huaweicloud.com/usermanual-cce/cce_10_0362.html