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
This pr fixes Kubeedge Installer to support Centos #721
Conversation
|
please remove keadm/log |
for centos kubeedge installer ready cloud ready edgecore ready cloud with device model error edgecontroller ready cloud and edge are ready update wget everything ok kubeedge centos installer works delete log
|
The author info in commit history is not correct. Please fix it. You may follow this instruction /assign @sids-b |
|
to address the previous commit you can actual use this command: HEAD~3 means you will use the 4th last commit as rebase base |
|
|
||
| //Install docker-ce | ||
| fmt.Println("stdout is %s", stdout) | ||
| dockerInst := fmt.Sprintf("sudo yum install -y --skip-broken docker-ce-%s", stdout) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please take care of downgrade and "--allow-change-held-packages" apt-get flag equivalent in yum
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@congfairy , have you taken care of this ?
| // yum install -y yum-utils | ||
| // yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo | ||
| //yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo | ||
| // yum-config-manager --add-repo /etc/yum.repos.d/docker.repo | ||
| // yum makecache |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove these comments
| func (c *CentOS) addK8SRepositoryAndUpdate() error { | ||
| //Get the distribution version | ||
| // cmd := &Command{Cmd: exec.Command("sh", "-c", "lsb_release -cs")} | ||
| // cmd.ExecuteCommand() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove all commented code
| cmd := &Command{Cmd: exec.Command("sh", "-c", updtRepo)} | ||
| cmd.ExecuteCommand() | ||
| updtRepoErr := cmd.GetStdErr() | ||
| fmt.Printf("updtRepoErr %s", updtRepoErr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to print incase there is no error. Hence remove this print
| fmt.Println("Expected K8S('", k8sComponent, "') version to install is", stdout) | ||
|
|
||
| //Install respective K8S components based on where it is being installed | ||
| k8sInst := fmt.Sprintf("yum install -y kubeadm-%s kubelet-%s kubectl-%s --disableexcludes=kubernetes", stdout, stdout, stdout) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please take care of downgrade and "--allow-change-held-packages" apt-get flag equivalent in yum
keadm/app/cmd/util/cloudinstaller.go
Outdated
| if err != nil { | ||
| return err | ||
| } | ||
| time.Sleep(5 * time.Second) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this sleep very much necessary? If not, please remove, or else check if you can reduce it to 1 second.
keadm/app/cmd/util/cloudinstaller.go
Outdated
| @@ -50,6 +55,11 @@ func (cu *KubeCloudInstTool) InstallTools() error { | |||
| if err != nil { | |||
| return err | |||
| } | |||
| time.Sleep(5 * time.Second) | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this sleep is required. Please remove.
| fmt.Println("Edgecontroller started") | ||
|
|
||
| return nil | ||
| } | ||
|
|
||
| //create device model and device CRDS | ||
| func (cu *KubeCloudInstTool) createdevicemodel() error { | ||
| cmdf := fmt.Sprintf("kubectl create -f $GOPATH/src/github.com/kubeedge/kubeedge/build/crds/devices/devices_v1alpha1_devicemodel.yaml") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both kubectl commands will not work if KubeEdge code is not cloned already. keadm init will simply download binaries and not these crd file. Please fix this approach.
Possibly you might have to download only these files in /etc/kubeedge/cloud/conf/ path and in kubectl command access this path to create crd files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean in createdevicemodel function we download devices_v1alpha1_devicemodel.yaml file to /etc/kubeedge/cloud/conf directory firstly and then kubectl create?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@congfairy: yes do wget on devices_v1alpha1_devicemodel.yaml and instance.yaml file from source code in /etc/kubeedge/cloud/conf..
Then u can do kubectl apply....
keadm/app/cmd/util/common.go
Outdated
| KubernetesGPGURL = "https://packages.cloud.google.com/apt/doc/apt-key.gpg" | ||
|
|
||
| KubernetesDownloadURL = "https://apt.kubernetes.io/" | ||
| KubernetesGPGURL = "https://packages.cloud.google.com/apt/doc/apt-key.gpg" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename this as KubernetesGPGURL - >KubernetesUbuntuGPGURL , Modify it where ever it is used.
keadm/app/cmd/util/common.go
Outdated
| KubernetesDownloadURL = "https://apt.kubernetes.io/" | ||
| KubernetesGPGURL = "https://packages.cloud.google.com/apt/doc/apt-key.gpg" | ||
| KubernetesBaseurl = "https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64" | ||
| KubernetesGpgkey = "https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename this as KubernetesGpgkey - >KubernetesCentOSGPGKey , Modify it where ever it is used.
|
@congfairy , Please share your test results as well. I mean the console output after executing "keadm init" in master node and "keadm join" in worker node. Also show proof, if you have deployed deployment pods, secrets and configmap. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: If they are not already assigned, you can assign the PR to them by writing The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@samy2019 Yes, I have updated that. |
keadm/app/cmd/util/cloudinstaller.go
Outdated
| return fmt.Errorf("%s", errout) | ||
| err := cmd.StartCmd() | ||
| if err != nil { | ||
| fmt.Println("in error") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we log the error ? also can we shift to using log package instead of fmt for all logging ?
| return fmt.Errorf("%s", errout) | ||
| } | ||
| fmt.Println(cmd.GetStdOutput()) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove space
| install = false | ||
| } | ||
| if install == true { | ||
| cmd := &Command{Cmd: exec.Command("sh", "-c", "swapoff -a && kubeadm init --pod-network-cidr 10.244.0.0/16")} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@congfairy what if , User wants to use calico ,weaver or diffferent Overlay network...It will be better if we dynamically provision which overlay network user wants to use?
| fmt.Println("Edgecontroller started") | ||
|
|
||
| return nil | ||
| } | ||
|
|
||
| //create device model and device CRDS | ||
| func (cu *KubeCloudInstTool) createdevicemodel() error { | ||
| cmdf := fmt.Sprintf("kubectl create -f $GOPATH/src/github.com/kubeedge/kubeedge/build/crds/devices/devices_v1alpha1_devicemodel.yaml") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@congfairy: yes do wget on devices_v1alpha1_devicemodel.yaml and instance.yaml file from source code in /etc/kubeedge/cloud/conf..
Then u can do kubectl apply....
| } | ||
|
|
||
| fmt.Println("Expected K8S('", k8sComponent, "') version to install is", stdout) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove extra space .Its applicable everywhere
|
@congfairy , please resolve the conflicts... The PR looks good to me :) |
|
|
|
@srivatsav123
|
@congfairy , can you please try : |
|
Is the thing going? |
Looks like it's been hanging for a long time, and are you interested in fixing it based on the new keadm code? @FengyunPan2 |
|
@fisherxu Yes, I want to deploy kubeedge on Centos. After getting so many errors by keadm, I find this PR which is handing. Now I have deployed kubeedge on Centos by shell script. |
Now the keadm still doesn't support centos, most func still leave empty... I think you can try it, and now keadm don't install k8s/runtime, so we only need implement the kubeedge related funcs. :) |
|
PTAL: #1536 |
|
closing as #1536 is merged |


What type of PR is this?
/kind feature
What this PR does / why we need it:
Kubeedge Installer to support Centos
Which issue(s) this PR fixes:
This pr fixes Kubeedge Installer to support Centos #454
Installation steps
Cloud:
Edge:
On edge host: mkdir -p /etc/kubeedge
On cloud host: cd /etc/kubeedge/
scp -r certs.tgz username@ipEdgevm:/etc/kubeedge
On edge host untar the certs.tgz file: cd /etc/kubeedge
tar -xvzf certs.tgz
3./kubeedge join --edgecontrollerip=xxxx --edgenodeid=testing123 --k8sserverip=xxxx:8080
Here are the console output:

Cloud : After kubeedge init
Edge:

On the cloud,kubectl get nodes:
