Hi everyone, A big thank you to the K3s team for ...
# k3s
b
Hi everyone, A big thank you to the K3s team for their amazing work. I'm trying to deploy a scheduler plugin with K3s, but I'm having trouble because I can't find the paths /etc/kubernetes/scheduler.conf and /etc/kubernetes/configs/scheduler-config.yaml. Can anyone help me with this? Thanks in advance!
Copy code
apiVersion: apps/v1
kind: Deployment
metadata:
  name: schedulingplugin
  namespace: kube-system
spec:
  replicas: 1
  selector:
    matchLabels:
      component: scheduler
      tier: control-plane
  template:
    metadata:
      labels:
        component: scheduler
        tier: control-plane
    spec:
      nodeSelector:
        node-role.kubernetes.io/control-plane: ""
      containers:
        - image: localhost:5000/scheduler-plugins/kube-scheduler:latest
          imagePullPolicy: Never
          command:
          - /bin/kube-scheduler
          - --authentication-kubeconfig=/etc/kubernetes/scheduler.conf
          - --authorization-kubeconfig=/etc/kubernetes/scheduler.conf
          - --config=/etc/kubernetes/configs/scheduler-config.yaml
          - -v=9
          name: schedulingplugin
          securityContext:
            privileged: true
          volumeMounts:
          - mountPath: /etc/kubernetes
            name: etckubernetes
      hostNetwork: false
      hostPID: false
      volumes:
      - hostPath:
          path: /etc/kubernetes/
          type: Directory
        name: etckubernetes
c
K3s doesn't generate those files, the scheduler is configured and run in the main k3s process. You'd need to generate the equivalent files by hand and store them in a configmap or secret thats mounted in the pod.
b
Can you help me generate these files? What commands should I type?
c
for scheduler-config.yaml you should put whatever configuration your scheduler wants, I can’t help you with that
for scheduler.conf you can use any kubeconfig that has the correct privilege, if you’re feeling lazy and just want to get it working you could use the admin one
the kubeconfig and certs/keys used by the k3s default scheduler are actually at /var/lib/rancher/k3s/server/cred/scheduler.kubeconfig /var/lib/rancher/k3s/server/tls/client-scheduler.crt /var/lib/rancher/k3s/server/tls/client-scheduler.key
b
Thank you