1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

kubernetesでcontroller-managerの設定変更をする

Posted at

kubernetesのcontroller-managerには色々な設定があります。

これらを使おうと思った時に以外とどうやればいいのかわからないことがあるので備忘がでらまとめます。

設定方法

注意
この設定ファイルを修正するとすぐにk8sが検知してcontroller-managerのpodがrestartしますので、注意しましょう。
※つまり設定を反映するためのrestart処理はユーザはやらなくてよいということです。

/etc/kubernetes/manifests/kube-controller-manager.yaml

apiVersion: v1
kind: Pod
metadata:
  creationTimestamp: null
  labels:
    component: kube-controller-manager
    tier: control-plane
  name: kube-controller-manager
  namespace: kube-system
spec:
  containers:
  - command:
    - kube-controller-manager
    - --allocate-node-cidrs=true
    - --authentication-kubeconfig=/etc/kubernetes/controller-manager.conf
    - --authorization-kubeconfig=/etc/kubernetes/controller-manager.conf
    - --bind-address=127.0.0.1
    - --client-ca-file=/etc/kubernetes/pki/ca.crt
    - --cluster-cidr=10.244.0.0/16
    - --cluster-signing-cert-file=/etc/kubernetes/pki/ca.crt
    - --cluster-signing-key-file=/etc/kubernetes/pki/ca.key
    - --controllers=*,bootstrapsigner,tokencleaner
    - --kubeconfig=/etc/kubernetes/controller-manager.conf
    - --leader-elect=true
    - --node-cidr-mask-size=24
    - --requestheader-client-ca-file=/etc/kubernetes/pki/front-proxy-ca.crt
    - --root-ca-file=/etc/kubernetes/pki/ca.crt
    - --service-account-private-key-file=/etc/kubernetes/pki/sa.key
    - --use-service-account-credentials=true
    env:
    - name: no_proxy
      value: localhost,127.0.0.1,172.16.0.0/24,k8s-admin-001,k8s-node-001,k8s-node-002,service-ac,service-bd,10.96.0.0/12,10.244.0.0/16
    image: k8s.gcr.io/kube-controller-manager:v1.14.3

こんな感じに書かれているので、以下のように追記しましょう。

    - --service-account-private-key-file=/etc/kubernetes/pki/sa.key
    - --use-service-account-credentials=true
    - --node-monitor-grace-period=10s ←追記
    env:
    - name: no_proxy
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?