0

I am trying to follow the https://github.com/kelseyhightower/kubernetes-the-hard-way/ guide and in the kube-scheduler step where I need to create a scheduler yaml file by executing the following command I am seeing the error shown below. I am sure its more of a permission issue than kube setup process

code

cat <<EOF | sudo tee /etc/kubernetes/config/kube-scheduler.yaml
apiVersion: kubescheduler.config.k8s.io/v1beta1
kind: KubeSchedulerConfiguration
clientConnection:
  kubeconfig: "/var/lib/kubernetes/kube-scheduler.kubeconfig"
leaderElection:
  leaderElect: true
EOF

ERROR :: tee: /etc/kubernetes/config/kube-scheduler.yaml: No such file or directory

I tried to manually create the yaml file with sudo inside tee: /etc/kubernetes/ but not able to. Any pointers on what my options are would be of great help.

James Stan
  • 51
  • 6

1 Answers1

0

Did you create a config directory before?

sudo mkdir -p /etc/kubernetes/config

I was getting the same error until I paid attention to this

KubePony
  • 144
  • 1
  • 7
  • Yes I manually created the config directory and even tried to copy the yaml file from other directory to /config but none helped. – James Stan Jan 18 '22 at 13:12
  • @JamesStan and after that you got an error while copying? Is the file not there? – KubePony Jan 18 '22 at 13:58
  • via cat >> I am trying to create a yaml file inside the location but irrespective of the process even if i try to manually create any file Via vi it is not letting me do that. I tried with Sudo and also followed the instruction provided in this thread https://stackoverflow.com/questions/8253362/etc-apt-sources-list-e212-cant-open-file-for-writing – James Stan Jan 18 '22 at 15:39
  • @JamesStan i would advise you to check the permissions on the /config directory, or even temporarily change them, for example via `sudo chmod 777 /etc/kubernetes/config` and try again. If this does not help, then something really strange is going on in your system. In any case, you can keep *.yaml files in a directory convenient for you, according to the instructions you will just need to change the path to them in the service configuration – KubePony Jan 18 '22 at 16:42