Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kube-proxy fails to start #391

Closed
pbaettig opened this issue Oct 1, 2018 · 3 comments
Closed

kube-proxy fails to start #391

pbaettig opened this issue Oct 1, 2018 · 3 comments

Comments

@pbaettig
Copy link

pbaettig commented Oct 1, 2018

Trying to start kube-proxy fails

# systemctl start kube-proxy; journalctl -fu kube-proxy
-- Logs begin at Mon 2018-10-01 10:45:42 CEST. --
Oct 01 13:49:00 worker-0 systemd[1]: Started Kubernetes Kube Proxy.
Oct 01 13:49:00 worker-0 kube-proxy[7625]: F1001 13:49:00.317416    7625 server.go:360] invalid configuration: no configuration has been provided
Oct 01 13:49:00 worker-0 systemd[1]: kube-proxy.service: Main process exited, code=exited, status=255/n/a
Oct 01 13:49:00 worker-0 systemd[1]: kube-proxy.service: Unit entered failed state.
Oct 01 13:49:00 worker-0 systemd[1]: kube-proxy.service: Failed with result 'exit-code'.
Oct 01 13:49:05 worker-0 systemd[1]: kube-proxy.service: Service hold-off time over, scheduling restart.
Oct 01 13:49:05 worker-0 systemd[1]: Stopped Kubernetes Kube Proxy.

The systemd service file looks like this:

[Unit]
Description=Kubernetes Kube Proxy
Documentation=https://github.com/kubernetes/kubernetes

[Service]
ExecStart=/usr/local/bin/kube-proxy \
  --config=/var/lib/kube-proxy/kube-proxy-config.yaml
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target

The config file /var/lib/kube-proxy/kube-proxy-config.yaml looks like this:

kind: KubeProxyConfiguration
apiVersion: kubeproxy.config.k8s.io/v1alpha1
clientConnection:
  kubeconfig: "/var/lib/kube-proxy/kubeconfig"
mode: "iptables"
clusterCIDR: "10.200.0.0/16"

/var/lib/kube-proxy/kubeconfig looks like this:

apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: ...
    server: https://192.168.99.100:6443
  name: kubernetes-the-hard-way
contexts:
- context:
    cluster: kubernetes-the-hard-way
    user: system:kube-proxy
  name: default
current-context: ""
kind: Config
preferences: {}
users:
- name: system:kube-proxy
  user:
    client-certificate-data: ...
    client-key-data: ...

certificate-authority-data, client-certificate-data and client-key-data have been replaced with ...

Any input is highly appreciated 🙂

@hareeshrao4839
Copy link

hareeshrao4839 commented Oct 4, 2018

Please Check kube-proxy.service systemd unit file: (your missing something service section)

cat /etc/systemd/system/kube-proxy.service

[Unit]
Description=Kube Proxy

[Service]
ExecStart=/usr/local/bin/kube-proxy \
--config=/var/lib/kube-proxy/kube-proxy-config.yaml
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target

sudo systemctl daemon-reload
sudo systemctl enable containerd kubelet kube-proxy
sudo systemctl start containerd kubelet kube-proxy

i tried its working fine

@romankydybets
Copy link

Hi @pbaettig we can take a look together.
But look like you missed to create the apiserver API to configure the proxy.

@pbaettig
Copy link
Author

pbaettig commented Oct 8, 2018

Hi @Kydybets, thanks for the input! I didn't have time in the last couple of days to go back and try to get it working but thanks to your comment and some other stuff I read I'm semi-confident that I'll be able to get it working 😄 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants