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

Fix failures in output #52

Merged
merged 1 commit into from Feb 14, 2017
Merged

Fix failures in output #52

merged 1 commit into from Feb 14, 2017

Conversation

vhosakot
Copy link
Contributor

@vhosakot vhosakot commented Feb 13, 2017

Since https://github.com/att-comdev/halcyon-kubernetes/blob/master/kube-deploy/roles/kube-init/tasks/ubuntu-masters.yml#L18 displays the expected error The connection to the server localhost:8080 was refused - did you specify the right host or port?, Ansible shows this as a failure when it is not a real failure (see below). Hence, added failed_when: false for this task. Also added this task after https://github.com/att-comdev/halcyon-kubernetes/blob/master/kube-deploy/roles/kube-init/tasks/ubuntu-masters.yml#L32-L43 (after initializing the kubernetes master) to make sure that kubectl works after the kubernetes master has been initialized.

TASK [kube-init : check for bootstrap] *****************************************
fatal: [kube1]: FAILED! => {"changed": true, "cmd": "kubectl get nodes", "delta": "0:00:00.255915", "end": "2017-02-11 06:30:51.426674", "failed": true, "rc": 1, "start": "2017-02-11 06:30:51.170759", "stderr": "The connection to the server localhost:8080 was refused - did you specify the right host or port?", "stdout": "", "stdout_lines": [], "warnings": []}
...ignoring

https://github.com/att-comdev/halcyon-kubernetes/blob/master/kube-deploy/roles/kube-prep/tasks/prep-host-dns.yml#L62 fails on kube{2,3,4} as there will be no containers running on them and we see the failure "docker rm" requires at least 1 argument(s).\nSee 'docker rm --help' since xrgs runs docker rm -f with no input (container ID). See below. Hence, added -r for xargs so that docker rm -f is not run when there are no containers running. The -r option of xargs means --no-run-if-empty.

TASK [kube-prep : forcing all k8s containers to be recreated with correct dns settings] ***
fatal: [kube4]: FAILED! => {"changed": true, "cmd": "docker ps | awk '$NF ~ /^k8s_/ { print $1}' | xargs -l1 docker rm -f", "delta": "0:00:01.419671", "end": "2017-02-11 06:36:11.164915", "failed": true, "rc": 123, "start": "2017-02-11 06:36:09.745244", "stderr": "\"docker rm\" requires at least 1 argument(s).\nSee 'docker rm --help'.\n\nUsage:  docker rm [OPTIONS] CONTAINER [CONTAINER...]\n\nRemove one or more containers", "stdout": "", "stdout_lines": [], "warnings": []}
...ignoring
fatal: [kube2]: FAILED! => {"changed": true, "cmd": "docker ps | awk '$NF ~ /^k8s_/ { print $1}' | xargs -l1 docker rm -f", "delta": "0:00:01.157304", "end": "2017-02-11 06:36:12.779749", "failed": true, "rc": 123, "start": "2017-02-11 06:36:11.622445", "stderr": "\"docker rm\" requires at least 1 argument(s).\nSee 'docker rm --help'.\n\nUsage:  docker rm [OPTIONS] CONTAINER [CONTAINER...]\n\nRemove one or more containers", "stdout": "", "stdout_lines": [], "warnings": []}
...ignoring
fatal: [kube3]: FAILED! => {"changed": true, "cmd": "docker ps | awk '$NF ~ /^k8s_/ { print $1}' | xargs -l1 docker rm -f", "delta": "0:00:01.207939", "end": "2017-02-11 06:36:13.106148", "failed": true, "rc": 123, "start": "2017-02-11 06:36:11.898209", "stderr": "\"docker rm\" requires at least 1 argument(s).\nSee 'docker rm --help'.\n\nUsage:  docker rm [OPTIONS] CONTAINER [CONTAINER...]\n\nRemove one or more containers", "stdout": "", "stdout_lines": [], "warnings": []}
...ignoring

The test results are in https://gist.github.com/vhosakot/65095b5904fc07ff1756aa09152c7bfc.

Fixes att-comdev/halcyon-vagrant-kubernetes#48

@vhosakot vhosakot changed the title Fixes https://github.com/att-comdev/halcyon-vagrant-kubernetes/issues/48 Fix failures in output Feb 13, 2017
@vhosakot vhosakot changed the title Fix failures in output Fix failures in the output of "vagrant up" Feb 13, 2017
@vhosakot vhosakot changed the title Fix failures in the output of "vagrant up" Fix failures in output Feb 13, 2017
@aric49
Copy link
Member

aric49 commented Feb 13, 2017

Thank you for your submission! This is an area I have wanted to address for a while, but has been difficult to find the time. This definitely cleans up the ansible output when the vagrant environment is deployed.

Any concerns @v1k0d3n? LGTM

@v1k0d3n
Copy link
Collaborator

v1k0d3n commented Feb 13, 2017

i'm a big fan of these changes. it will make the overall experience smoother for our openstack-helm developers as well as the kolla-kubernetes folks.

@aric49 have you had a chance to test these changes? at first glance they look good...but i need to run through them at some point today.

@vhosakot
Copy link
Contributor Author

@aric49 @v1k0d3n thanks for the comments! 😄 Once you test this PR, if you'd like to compare with my test results, my test results are at https://gist.github.com/vhosakot/65095b5904fc07ff1756aa09152c7bfc.

Is there a plan to add CI/gating/Jenkins bot for this repo? I ask because I think it is very important to test the health of this repo when there is a change. I have some sanity tests in mind that I'd like to add at the end of the deployment to make sure that system sanity is good. We can just run some commands (kubectl, docker, systemctl) and validate the output to make sure that things are good. Let me know your thoughts.

@aric49
Copy link
Member

aric49 commented Feb 13, 2017

@v1k0d3n Tested from my end.. Everything runs great.

@vhosakot -- We are working on getting CICD working, ASAP! Thanks for the suggestions!

@v1k0d3n
Copy link
Collaborator

v1k0d3n commented Feb 14, 2017

sounds great! @vhosakot, again...really great having this PR; thank you! 👍.

We had Jenkins at one point, and it was working well. As we're working through our repos...we're aligning with some best practices provided from the Kubernetes community. As we try to find a better home for Openstack-Helm, we wanted these changes to pass gates methodically, and our Jenkins team is working on this now. Should be available soon!

I'm not quite sure we could do Travis for this repo...but if you think we could...I would be all for it! At least in this case, it would be easy for the development team(s) to maintain their own gating/CI.

@v1k0d3n v1k0d3n merged commit 0875143 into att-comdev:master Feb 14, 2017
@vhosakot
Copy link
Contributor Author

Cool, thanks for merging this @v1k0d3n! Yes, I think a Jenkins bot for this repo is great. I can help add few sanity tests once Jenkins gating is added for this repo.

Could you update the halcyon-kubernetes submodule in https://github.com/att-comdev/halcyon-vagrant-kubernetes (which currently point to the tree https://github.com/att-comdev/halcyon-kubernetes/tree/3b4698c2c032a86c3d28d97debcffd2dcc5090a5 which is 5 days old) so that users get the latest halcyon-kubernetes master repo when they clone/pull the halcyon-vagrant-kubernetes repo. Thanks!

@v1k0d3n
Copy link
Collaborator

v1k0d3n commented Feb 14, 2017

@vhosakot absolutely! i'll do that right now.

@js5175 and @nadeemanwar: where are we with adding a jenkinsfile to this repo? once this is added, than our devs can start hacking away at it, and take off some of the load for you guys. sounds like @vhosakot is willing to help out a bit.

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

Successfully merging this pull request may close these issues.

None yet

3 participants