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

"kubeadm init" on offline environment #54188

Closed
khj809 opened this issue Oct 19, 2017 · 8 comments
Closed

"kubeadm init" on offline environment #54188

khj809 opened this issue Oct 19, 2017 · 8 comments
Labels
needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one.

Comments

@khj809
Copy link

khj809 commented Oct 19, 2017

Hi. I'm trying to set up kubernetes cluster on my private network.
All machines are RHEL 7.3 and use latest kubernetes version (v1.8.1) with docker-ce 17.03.2.
I thought that everything I need is some packages(kubeadm, kubectl, kubelet, kubernetes-cni and dependencies) and images (starts with gcr.io/google_containers/... and pod network images), so I prepared and installed them. But when I run "kubeadm init", it still requires internet connection with following messages.

Unable to get URL "https://dl.k8s.io/release/stable-1.8.txt": Get https://dl.k8s.io/release/stable-1.8.txt: dial tcp: lookup dl.k8s.io on [::1]:53: read udp [::1]:54829->[::1]:53: read: connection refused

What should I do anything else?

@k8s-github-robot
Copy link

@khj809
There are no sig labels on this issue. Please add a sig label by:

  1. mentioning a sig: @kubernetes/sig-<group-name>-<group-suffix>
    e.g., @kubernetes/sig-contributor-experience-<group-suffix> to notify the contributor experience sig, OR

  2. specifying the label manually: /sig <label>
    e.g., /sig scalability to apply the sig/scalability label

Note: Method 1 will trigger an email to the group. See the group list and label list.
The <group-suffix> in the method 1 has to be replaced with one of these: bugs, feature-requests, pr-reviews, test-failures, proposals

@k8s-github-robot k8s-github-robot added the needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Oct 19, 2017
@wackxu
Copy link
Contributor

wackxu commented Oct 19, 2017

@khj809 you can add a flag --kubernetes-version=v1.8.1 then it will skip request the URL

@khj809
Copy link
Author

khj809 commented Oct 19, 2017

@wackxu Thanks! It works!

@khj809 khj809 closed this as completed Oct 19, 2017
@yaniveliash
Copy link

Doesn't work on v1.10 offline mode with the statement -> --kubernetes-version=stable-1.10

@nsulek
Copy link

nsulek commented Apr 10, 2018

you can try with

kubeadm init --kubernetes-version=v1.10.0

it works for me

@brentpearson
Copy link

Is there a guide anywhere on the internet for getting this to work? I know I've got to somehow do the following:

  • Setup a local Docker registry.
  • Get the Docker images that "kubeadm init" needs into the local Docker registry.
  • Make the "kubeadm init" command use the local Docker registry to get the Docker images.

I thought I had accomplished this. I can run "docker images" and it lists all the images that I believe "kubeadm init" needs, but something still isn't working. I discovered running a "docker pull " for one of the images that "docker images" shows doesn't work (can't connect, or says image not available if I precede it with my local registry machine's address instead of the remote domain), so that's probably part of the problem.

Even if that was working, is that it? I'm betting there's more, and it'd be good to have a clear procedure for how to get the "kubeadm init" command to work on a machine with no internet access. I've found plenty of search results with the topic being raise, but none with any working solutions.

@antonputra
Copy link

You can create config.yaml file, for example

apiVersion: kubeadm.k8s.io/v1alpha1
kind: MasterConfiguration
api:
  advertiseAddress: 10.44.70.201
networking:
  podSubnet: 192.168.0.0/16
kubernetesVersion: 1.10.5

and run kubeadm init --config=kubeadm-config.yaml

puneetguptanitj added a commit to platform9/nodeadm that referenced this issue Aug 10, 2018
if Kind and APIVersion is not set in config.yaml. (These are set
as omit if empty upstream)
puneetguptanitj added a commit to platform9/nodeadm that referenced this issue Aug 11, 2018
if Kind and APIVersion is not set in config.yaml. (These are set
as omit if empty upstream)
puneetguptanitj added a commit to platform9/nodeadm that referenced this issue Aug 11, 2018
if Kind and APIVersion is not set in config.yaml. (These are set
as omit if empty upstream)
@weisjohn
Copy link

weisjohn commented Sep 5, 2018

NOTE: The --config file option also works for a few other kubeadm commands, such as kubeadm alpha phase certs apiserver and kubeadm alpha phase certs etcd-peer, which is helpful when you're running in offline mode (see kubernetes/kubeadm#338 (comment)).

For those commands, I was able to use a config.yml that looked simply like:

kubernetesVersion: 1.11.2

So, my command was:

$ kubeadm alpha phase certs apiserver --config=./config.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one.
Projects
None yet
Development

No branches or pull requests

8 participants