Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Kubernetes: explicitly install deps during provisioning #3179

Merged
merged 2 commits into from
Jun 6, 2018

Conversation

jackfrancis
Copy link
Member

@jackfrancis jackfrancis commented Jun 5, 2018

What this PR does / why we need it: Outcome of this change:

Before:

azureuser@k8s-master-20389576-0:~$ sudo dpkg-query -l nfs*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                          Version             Architecture        Description
+++-=============================-===================-===================-===============================================================
un  nfs-common                    <none>              <none>              (no description available)

After:

azureuser@k8s-master-14035839-0:~$ sudo dpkg-query -l nfs*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                          Version             Architecture        Description
+++-=============================-===================-===================-===============================================================
un  nfs-client                    <none>              <none>              (no description available)
ii  nfs-common                    1:1.2.8-9ubuntu12.1 amd64               NFS support files common to client and server
un  nfs-kernel-server             <none>              <none>              (no description available)

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #

Special notes for your reviewer:

If applicable:

  • documentation
  • unit tests
  • tested backward compatibility (ie. deploy with previous version, upgrade with this branch)

Release note:

Kubernetes: explicitly install nfs-common during provisioning

@acs-bot
Copy link

acs-bot commented Jun 5, 2018

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: jackfrancis

Assign the PR to them by writing /assign @jackfrancis in a comment when ready.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ghost ghost assigned jackfrancis Jun 5, 2018
@ghost ghost added the in progress label Jun 5, 2018
@acs-bot acs-bot added the size/XS label Jun 5, 2018
@jackfrancis
Copy link
Member Author

/retest

@codecov
Copy link

codecov bot commented Jun 5, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@2012c1c). Click here to learn what that means.
The diff coverage is n/a.

@@            Coverage Diff            @@
##             master    #3179   +/-   ##
=========================================
  Coverage          ?   52.32%           
=========================================
  Files             ?      103           
  Lines             ?    15452           
  Branches          ?        0           
=========================================
  Hits              ?     8086           
  Misses            ?     6638           
  Partials          ?      728

@jackfrancis jackfrancis changed the title Kubernetes: explicitly install nfs-common during provisioning Kubernetes: explicitly install deps during provisioning Jun 6, 2018
@jackfrancis
Copy link
Member Author

@andyzhangx FYI

Copy link
Contributor

@CecileRobertMichon CecileRobertMichon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@@ -153,8 +153,11 @@ function installEtcd() {
retrycmd_if_failure 10 1 5 sudo etcdctl member update $MEMBER ${ETCD_PEER_URL} || exit $ERR_ETCD_CONFIG_FAIL
}

function installDeps() {
apt_get_install 20 30 180 apt-transport-https ca-certificates iptables iproute2 socat util-linux mount ebtables ethtool init-system-helpers nfs-common ceph-common conntrack glusterfs-client ipset jq || exit $ERR_APT_INSTALL_TIMEOUT
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some packages are already installed in base image, install existing packages won't fail in this command, right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and would you also add package list source in comment:
https://github.com/kubernetes/kubernetes/blob/master/build/debian-hyperkube-base/Dockerfile#L25-L44

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To your 1st question, correct, if a package is already installed the command won’t exit non-zero

@karataliu
Copy link
Contributor

Fixes #3022

Copy link
Member

@feiskyer feiskyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@jackfrancis jackfrancis merged commit 5203e3f into Azure:master Jun 6, 2018
@ghost ghost removed the in progress label Jun 6, 2018
@jackfrancis jackfrancis deleted the nfs-common branch June 6, 2018 05:38
@andyzhangx
Copy link
Contributor

andyzhangx commented Jun 6, 2018

@jackfrancis I am also fixing the flexvolume issue in AKS, it requires jq package, you will get following error when install jq on one agent node directly:

azureuser@aks-nodepool1-26705064-0:~$ sudo apt install jq -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 jq : Depends: libonig2 (>= 5.9.5) but it is not going to be installed
 linux-azure : Depends: linux-headers-azure (= 4.13.0.1018.19) but 4.13.0.1016.17 is to be installed
               Depends: linux-tools-azure (= 4.13.0.1018.19) but 4.13.0.1016.17 is to be installed
               Depends: linux-cloud-tools-azure (= 4.13.0.1018.19) but 4.13.0.1016.17 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

by running apt-get -f install and then run apt install jq -y, jq package will finally installed.
So I would suggest modify your installation scripts?

following is apt-get -f install command explanation:

-f, --fix-broken
Fix. Attempt to correct a system with broken dependencies in place. This option, when used with install/remove, can omit any packages to permit APT to deduce a likely solution. Any package(s) that are specified must completely correct the problem. This option is sometimes necessary when running APT for the first time; APT itself does not allow broken package dependencies to exist on a system. It is possible that a system's dependency structure can be so corrupt as to require manual intervention. Use of this option together with -m may produce an error in some situations.

@feiskyer
Copy link
Member

feiskyer commented Jun 6, 2018

@andyzhangx apt-get update should run first before install.

@andyzhangx
Copy link
Contributor

apt update does not work on my side, @jackfrancis you may double check whether jq is installed after AKS upgrade with this PR, I doubt there could be issue there.

azureuser@aks-nodepool1-26705064-1:~$ sudo apt install jq -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 jq : Depends: libonig2 (>= 5.9.5) but it is not going to be installed
 linux-azure : Depends: linux-headers-azure (= 4.13.0.1018.19) but 4.13.0.1016.17 is to be installed
               Depends: linux-tools-azure (= 4.13.0.1018.19) but 4.13.0.1016.17 is to be installed
               Depends: linux-cloud-tools-azure (= 4.13.0.1018.19) but 4.13.0.1016.17 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
azureuser@aks-nodepool1-26705064-1:~$ sudo apt update -y
Hit:1 http://azure.archive.ubuntu.com/ubuntu xenial InRelease
Get:2 http://azure.archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]
Get:3 http://azure.archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]
Hit:4 http://security.ubuntu.com/ubuntu xenial-security InRelease
Hit:5 https://aptdocker.azureedge.net/repo ubuntu-xenial InRelease
Get:6 http://azure.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [785 kB]
Get:7 http://azure.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [632 kB]
Fetched 1,633 kB in 0s (3,008 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
21 packages can be upgraded. Run 'apt list --upgradable' to see them.
azureuser@aks-nodepool1-26705064-1:~$ sudo apt install jq -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 jq : Depends: libonig2 (>= 5.9.5) but it is not going to be installed
 linux-azure : Depends: linux-headers-azure (= 4.13.0.1018.19) but 4.13.0.1016.17 is to be installed
               Depends: linux-tools-azure (= 4.13.0.1018.19) but 4.13.0.1016.17 is to be installed
               Depends: linux-cloud-tools-azure (= 4.13.0.1018.19) but 4.13.0.1016.17 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

@jackfrancis
Copy link
Member Author

@andyzhangx Thanks for the call-out.

Just verified jq installation is working on a newly built cluster:

azureuser@k8s-master-64268538-0:~$ which jq
/usr/bin/jq

By the way, here are the commands we run for that apt_get_install func:

https://github.com/Azure/acs-engine/blob/master/parts/k8s/kubernetesprovisionsource.sh#L74

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

Successfully merging this pull request may close these issues.

6 participants