-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
e2e-kubeadm: Allow pinning Kubernetes version. #2761
Conversation
/assign @krzyzacy |
Not sure if I'm accumulating too much kubeadm-specific logic into the |
yeah, sounds sane to move all kubeadm stuff to it's own scenario, or in kubetest/anywhere.go? |
Sure. Just two questions:
|
scenarios/kubernetes_e2e.py
Outdated
|
||
k8s_version = mode.job_env().get('KUBEADM_KUBERNETES_VERSION') | ||
if k8s_version: | ||
opt += ' --kubernetes-anywhere-kubernetes-version %s' % k8s_version |
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.
update test :-)
scenarios/kubernetes_e2e.py
Outdated
def start(self, args): | ||
"""Runs e2e-runner.sh after setting env and installing prereqs.""" | ||
print >>sys.stderr, 'starts with local mode' | ||
def job_env(self): |
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.
maybe this should be a property
scenarios/kubernetes_e2e.py
Outdated
@@ -377,6 +382,11 @@ def main(args): | |||
' --kubernetes-anywhere-phase2-provider kubeadm' \ | |||
' --kubernetes-anywhere-cluster %s' \ | |||
' --kubernetes-anywhere-kubeadm-version %s' % (cluster, version) | |||
|
|||
k8s_version = mode.job_env().get('KUBEADM_KUBERNETES_VERSION') |
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.
docker mode does not have job_env()
though... you might want to check mutual exclusive?
It seems all you want for kubeadm is add bunch of flags to kubetest. You can create the scenario and pass those flags through config.json, like, But sgtm if you want to get this in first and refactor in a separate PR :-) |
735b1f7
to
ec0b124
Compare
Looks like I need to convert my |
4672969
to
04c768d
Compare
Okay, I've converted this functionality from an environment variable in the |
04c768d
to
ebc12f8
Compare
(Rebased) |
ebc12f8
to
9fac2f9
Compare
lg overall, please fix the presubmit |
and will this make https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/logs/ci-kubernetes-e2e-kubeadm-gce-1-7/2?log#log better? |
Sweet! Yes, this should fix both the |
9fac2f9
to
b2f2d90
Compare
it might also conflict with #3084, let's see who gets in first |
The race is on. I'll go distract Erick while the presubmits finish. |
I lost the race :-(. Rebasing now. |
b2f2d90
to
1bb693c
Compare
cc @caesarxuchao this should fix kubeadm in 1.7 you asked earlier |
1bb693c
to
b948f18
Compare
scenarios/kubernetes_e2e.py
Outdated
@@ -473,6 +479,9 @@ def create_parser(): | |||
parser.add_argument( | |||
'--kubeadm', choices=['ci', 'periodic', 'pull']) | |||
parser.add_argument( | |||
'--kubeadm-kubernetes-version', default=None, help='Version of Kubernetes to use while ' | |||
'testing kubeadm (e.g. latest, latest-1.6, 1.6.4, etc)') |
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 can just pass in --kubernetes-anywhere-kubernetes-version=x.x.x
from config.json, rest should be automatic, which means you don't need to create a new flag here.
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 did consider this after I saw #3082. I have been intentionally trying to keep the options to the scenario to be kubeadm-based (and keeping kubernetes-anywhere an implementation detail under the covers). It's probably worth redoing the kubetest args to be consistent with these in the future, since kubeadm is the only thing we test using kubernetes-anywhere.
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 would probably add some presubmit check say --kubeadm-kubernetes-version
must set --kubeadm
, rather than complicate the logic here? Since this is against #3082.
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.
maybe make https://github.com/kubernetes/test-infra/blob/master/jenkins/bootstrap_test.py#L2159 more complicated :-)
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'm a little confused. What logic did you want removed from here? Or are you saying that we should add logic to make sure that if someone specifies --kubeadm-kubernetes-version
and forgets to set --kubeadm
, we should have an error, but that new logic should go into a presubmit test instead of a runtime check in the scenario?
Rebased again and fixed a bug where all of the kubernetes-anywhere flags had prepended spaces, which made kubetest reject them. |
Okay I don't think that failure was because of me:
/retest |
Add support for kubeadm e2e jobs to specify a version string to use that ultimately gets passed as "kubeadm init --kubernetes-version <version>". This is important for e2e jobs running against release branches, instead of always using "latest".
b948f18
to
3909d9d
Compare
@krzyzacy and I chatted offline. I've pulled out the new kubeadm flag in favor of just using the kubetest kubernetes-anywhere flag instead. I'm still testing the jobs locally, but please have a look! |
/lgtm |
hope it will fix things :-) |
Well I was going to finish testing before merging, but I guess we'll roll forward if any problems are found. 😄 |
Add support for kubeadm e2e jobs to specify a version string to use that ultimately gets passed as
kubeadm init --kubernetes-version <version>
. This is important for e2e jobs running against release branches, instead of always usinglatest
.