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

dind: move to hyperkube and 'openshift start network' #20764

Merged
merged 2 commits into from Aug 29, 2018

Conversation

dcbw
Copy link
Contributor

@dcbw dcbw commented Aug 27, 2018

Let's win half the battle and do the whole daemonset/image thing as the second part.

@openshift/sig-networking @squeed @danwinship @JacobTanenbaum

@openshift-ci-robot openshift-ci-robot added sig/networking size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 27, 2018
@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 27, 2018
@imcsk8
Copy link
Contributor

imcsk8 commented Aug 28, 2018

LGTM

Copy link
Contributor

@Miciah Miciah left a comment

Choose a reason for hiding this comment

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

A couple of small suggestions.

if [[ ! -f "${kube_config}" ]]; then
# use the static node config if it exists
# TODO: remove when static node configuration is no longer supported
for f in ${config_dir}/system*.kubeconfig; do
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd add a shopt -s failglob command here, or an additional check after the for loop to make sure $kube_config exists. (I was surprised to find that oc config --config=non-existent-file view --flatten does not fail.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Miciah yeah, I was surprised too. Anyway, added a post-for check.

@@ -15,7 +15,7 @@ function ovn-kubernetes-master() {

local master_config="${config_dir}/master-config.yaml"
cluster_cidr=$(python -c "import yaml; stream = file('${master_config}', 'r'); y = yaml.load(stream); print y['networkConfig']['clusterNetworks'][0]['cidr']")
apiserver=$(oc --config="${kube_config}" config view -o custom-columns=server:clusters[0].cluster.server | grep http)
apiserver=$(grep server ${kube_config} | cut -f 6 -d' ')
Copy link
Contributor

@Miciah Miciah Aug 28, 2018

Choose a reason for hiding this comment

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

Adding -m1, adding a colon to the pattern, and using awk would make the command more robust:

apiserver=$(grep -m1 server: ${kube_config} | awk '{print $2}')

Copy link
Contributor

Choose a reason for hiding this comment

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

apiserver=$(awk '/server:/ { print $2; exit }')

:-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Miciah fixed, thanks.

Copy link
Contributor

@danwinship danwinship left a comment

Choose a reason for hiding this comment

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

just nitpicks...

# Create the service account for openshift-sdn
if ! /usr/local/bin/oc --config="${kube_config}" get serviceaccount openshift-sdn >/dev/null 2>&1; then
/usr/local/bin/oc --config="${kube_config}" create serviceaccount openshift-sdn
/usr/local/bin/oc adm --config="${kube_config}" policy add-cluster-role-to-user cluster-admin -z openshift-sdn
Copy link
Contributor

Choose a reason for hiding this comment

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

For consistency move the "adm" after "--config...". (If you copied this from elsewhere it's presumably just an artifact of blindly running s/oadm/oc adm/ and not an example of good style.)

(likewise below)

local kube_config="${config_dir}/admin.kubeconfig"

local msg="apiserver to become alive"
os::util::wait-for-condition "${msg}" "is-api-running ${kube_config}"
Copy link
Contributor

Choose a reason for hiding this comment

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

drop ${msg}. (other calls to wait-for-condition below don't use a separate msg var)

@@ -15,7 +15,7 @@ function ovn-kubernetes-master() {

local master_config="${config_dir}/master-config.yaml"
cluster_cidr=$(python -c "import yaml; stream = file('${master_config}', 'r'); y = yaml.load(stream); print y['networkConfig']['clusterNetworks'][0]['cidr']")
apiserver=$(oc --config="${kube_config}" config view -o custom-columns=server:clusters[0].cluster.server | grep http)
apiserver=$(grep server ${kube_config} | cut -f 6 -d' ')
Copy link
Contributor

Choose a reason for hiding this comment

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

apiserver=$(awk '/server:/ { print $2; exit }')

:-)

@dcbw dcbw force-pushed the dind-hyperkube branch 4 times, most recently from 638e3ee to 697c652 Compare August 28, 2018 17:17
@dcbw
Copy link
Contributor Author

dcbw commented Aug 28, 2018

@Miciah @danwinship updated; PTAL thanks!

@Miciah
Copy link
Contributor

Miciah commented Aug 29, 2018

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 29, 2018
In preparation for moving to daemonsets, start using hyperkube on
nodes instead of the all-in-one. This requires a new node service
for openshift-sdn, and we might as well create a new service account
for that while we're at it.
Catch up with some recent changes in config reading, fix some bugs,
and consolidate some code.
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Aug 29, 2018
@dcbw
Copy link
Contributor Author

dcbw commented Aug 29, 2018

@Miciah @danwinship repushed to fix merge conflict, another LGTM would be great thanks!

@danwinship
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 29, 2018
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: danwinship, dcbw, Miciah

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

@dcbw
Copy link
Contributor Author

dcbw commented Aug 29, 2018

/retest

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit eadea61 into openshift:master Aug 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. sig/networking size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants