k8s.io/kubernetes@v1.31.0-alpha.0.0.20240520171757-56147500dadc/cluster/addons/dns-horizontal-autoscaler/dns-horizontal-autoscaler.yaml (about)

     1  # Copyright 2016 The Kubernetes Authors.
     2  #
     3  # Licensed under the Apache License, Version 2.0 (the "License");
     4  # you may not use this file except in compliance with the License.
     5  # You may obtain a copy of the License at
     6  #
     7  #     http://www.apache.org/licenses/LICENSE-2.0
     8  #
     9  # Unless required by applicable law or agreed to in writing, software
    10  # distributed under the License is distributed on an "AS IS" BASIS,
    11  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  # See the License for the specific language governing permissions and
    13  # limitations under the License.
    14  
    15  kind: ServiceAccount
    16  apiVersion: v1
    17  metadata:
    18    name: kube-dns-autoscaler
    19    namespace: kube-system
    20    labels:
    21      addonmanager.kubernetes.io/mode: Reconcile
    22  ---
    23  kind: ClusterRole
    24  apiVersion: rbac.authorization.k8s.io/v1
    25  metadata:
    26    name: system:kube-dns-autoscaler
    27    labels:
    28      addonmanager.kubernetes.io/mode: Reconcile
    29  rules:
    30    - apiGroups: [""]
    31      resources: ["nodes"]
    32      verbs: ["list", "watch"]
    33    - apiGroups: [""]
    34      resources: ["replicationcontrollers/scale"]
    35      verbs: ["get", "update"]
    36    - apiGroups: ["apps"]
    37      resources: ["deployments/scale", "replicasets/scale"]
    38      verbs: ["get", "update"]
    39  # Remove the configmaps rule once below issue is fixed:
    40  # kubernetes-incubator/cluster-proportional-autoscaler#16
    41    - apiGroups: [""]
    42      resources: ["configmaps"]
    43      verbs: ["get", "create"]
    44  ---
    45  kind: ClusterRoleBinding
    46  apiVersion: rbac.authorization.k8s.io/v1
    47  metadata:
    48    name: system:kube-dns-autoscaler
    49    labels:
    50      addonmanager.kubernetes.io/mode: Reconcile
    51  subjects:
    52    - kind: ServiceAccount
    53      name: kube-dns-autoscaler
    54      namespace: kube-system
    55  roleRef:
    56    kind: ClusterRole
    57    name: system:kube-dns-autoscaler
    58    apiGroup: rbac.authorization.k8s.io
    59  
    60  ---
    61  apiVersion: apps/v1
    62  kind: Deployment
    63  metadata:
    64    name: kube-dns-autoscaler
    65    namespace: kube-system
    66    labels:
    67      k8s-app: kube-dns-autoscaler
    68      kubernetes.io/cluster-service: "true"
    69      addonmanager.kubernetes.io/mode: Reconcile
    70  spec:
    71    selector:
    72      matchLabels:
    73        k8s-app: kube-dns-autoscaler
    74    template:
    75      metadata:
    76        labels:
    77          k8s-app: kube-dns-autoscaler
    78      spec:
    79        priorityClassName: system-cluster-critical
    80        securityContext:
    81          seccompProfile:
    82            type: RuntimeDefault
    83          supplementalGroups: [ 65534 ]
    84          fsGroup: 65534
    85        nodeSelector:
    86          kubernetes.io/os: linux
    87        containers:
    88        - name: autoscaler
    89          image: registry.k8s.io/cpa/cluster-proportional-autoscaler:1.8.4
    90          resources:
    91              requests:
    92                  cpu: "20m"
    93                  memory: "10Mi"
    94          command:
    95            - /cluster-proportional-autoscaler
    96            - --namespace=kube-system
    97            - --configmap=kube-dns-autoscaler
    98            # Should keep target in sync with cluster/addons/dns/kube-dns.yaml.base
    99            - --target={{.Target}}
   100            # When cluster is using large nodes(with more cores), "coresPerReplica" should dominate.
   101            # If using small nodes, "nodesPerReplica" should dominate.
   102            - --default-params={"linear":{"coresPerReplica":256,"nodesPerReplica":16,"preventSinglePointFailure":true,"includeUnschedulableNodes":true}}
   103            - --logtostderr=true
   104            - --v=2
   105        tolerations:
   106        - key: "CriticalAddonsOnly"
   107          operator: "Exists"
   108        serviceAccountName: kube-dns-autoscaler