bootstrapping kube-scheduler
手順
-
Dockerfile_kube-scheduler.armhf
を作成する
Dockerfile_kube-scheduler.armhf
cat << 'EOF' > Dockerfile_kube-scheduler.armhf FROM arm64v8/ubuntu:bionic ARG VERSION="v1.30.1" ARG ARCH="arm64" RUN set -ex \ && apt update \ && apt install -y wget \ && apt clean \ && wget -P /usr/bin/ https://dl.k8s.io/$VERSION/bin/linux/$ARCH/kube-scheduler \ && chmod +x /usr/bin/kube-scheduler \ && install -o root -g root -m 755 -d /var/lib/kubernetes \ && install -o root -g root -m 755 -d /etc/kubernetes/config COPY kube-scheduler.yaml /etc/kubernetes/config/ COPY kube-scheduler.kubeconfig /var/lib/kubernetes/ ENTRYPOINT ["/usr/bin/kube-scheduler"] EOF
-
kube-schedulerのconfig生成
-
k8s 1.19.0 で
KubeSchedulerConfiguration
が betaにupdateされています- https://qiita.com/everpeace/items/7dbf14773db82e765370
kube-scheduler.yaml
cat << EOF > kube-scheduler.yaml --- apiVersion: kubescheduler.config.k8s.io/v1 kind: KubeSchedulerConfiguration clientConnection: kubeconfig: "/var/lib/kubernetes/kube-scheduler.kubeconfig" leaderElection: leaderElect: false EOF
- https://qiita.com/everpeace/items/7dbf14773db82e765370
-
image build
sudo nerdctl build --namespace k8s.io -t k8s-kube-scheduler --file=Dockerfile_kube-scheduler.armhf ./
-
pod manifestsを
/etc/kubelet.d
へ作成する
/etc/kubelet.d/kube-scheduler.yaml
cat << EOF | sudo tee /etc/kubelet.d/kube-scheduler.yaml --- apiVersion: v1 kind: Pod metadata: name: kube-scheduler namespace: kube-system labels: tier: control-plane component: kube-scheduler spec: # https://kubernetes.io/docs/tasks/administer-cluster/guaranteed-scheduling-critical-addon-pods/ priorityClassName: system-node-critical hostNetwork: true containers: - name: kube-scheduler image: k8s-kube-scheduler:latest imagePullPolicy: IfNotPresent resources: requests: cpu: "256m" memory: "128Mi" limits: cpu: "384m" memory: "128Mi" command: - /usr/bin/kube-scheduler - --config=/etc/kubernetes/config/kube-scheduler.yaml - --v=2 EOF
-
crictl
でコンテナ起動を確認する$ sudo crictl ps --name kube-scheduler CONTAINER IMAGE CREATED STATE NAME ATTEMPT POD ID a19648dec2d54 70e852515b3c74175bb3ad4855287cb81101921b2b1f5a890fa4ebd0eeeee684 15 seconds ago Running kube-scheduler 0 da1d0572bc2b1