Skip to content
This repository was archived by the owner on Jun 13, 2023. It is now read-only.

New wait command#43

Merged
JulienBalestra merged 3 commits intomasterfrom
JulienBalestra/wait-command
Jun 8, 2018
Merged

New wait command#43
JulienBalestra merged 3 commits intomasterfrom
JulienBalestra/wait-command

Conversation

@JulienBalestra
Copy link
Copy Markdown
Collaborator

@JulienBalestra JulienBalestra commented Jun 7, 2018

What does this PR do?

This new command remove any logic like:

until curl -sf http://127.0.0.1:8989/ready --connect-timeout 1 -w '\n'
do
    systemctl status pupernetes.service --no-pager --full
    journalctl -u pupernetes.service --no-pager -o cat -n 50 -e

    sleep 10
done

to be used like:

pupernetes wait pupernetes.service

This will nicely tail the associated journald entry without any duplicate.

[pupernetes.service] Starting github.com/DataDog/pupernetes...
[pupernetes.service] I0607 18:05:25.886126   27882 clean.go:32] Removed /home/jb/go/src/github.com/DataDog/pupernetes/sanbox/etcd-data
[pupernetes.service] I0607 18:05:25.886537   27882 clean.go:32] Removed /var/lib/p8s-kubelet
[pupernetes.service] I0607 18:05:25.886567   27882 clean.go:32] Removed /var/log/pods/
[pupernetes.service] I0607 18:05:25.886572   27882 clean.go:163] Cleanup finished
[pupernetes.service] I0607 18:05:25.924006   27882 hostname.go:59] Using hostname: "v1704"
[pupernetes.service] I0607 18:05:26.077163   27882 manifests.go:94] Using template collection of Kubernetes 1.10
[pupernetes.service] I0607 18:05:26.081590   27882 systemd.go:111] Already created systemd unit: p8s-etcd.service, untouched
[pupernetes.service] I0607 18:05:26.081739   27882 systemd.go:111] Already created systemd unit: p8s-kubelet.service, untouched
[pupernetes.service] I0607 18:05:26.082105   27882 systemd.go:111] Already created systemd unit: p8s-kube-apiserver.service, untouched
[pupernetes.service] I0607 18:05:28.600064   27882 setup.go:294] Setup ready /home/jb/go/src/github.com/DataDog/pupernetes/sanbox
[pupernetes.service] I0607 18:05:28.601200   27882 run.go:78] Timeout for this current run is 6h0m0s
[pupernetes.service] I0607 18:05:28.601243   27882 systemd_action.go:41] Starting systemd unit: p8s-etcd.service ...
[pupernetes.service] I0607 18:05:28.607118   27882 systemd_action.go:41] Starting systemd unit: p8s-kubelet.service ...
[pupernetes.service] I0607 18:05:28.611777   27882 systemd_action.go:41] Starting systemd unit: p8s-kube-apiserver.service ...
[pupernetes.service] I0607 18:05:29.614882   27882 state.go:36] Kubenertes apiserver not ready yet: Get http://127.0.0.1:8080/healthz: dial tcp 127.0.0.1:8080: connect: connection refused
[pupernetes.service] I0607 18:05:32.623306   27882 state.go:36] Kubenertes apiserver not ready yet: bad status code for http://127.0.0.1:8080/healthz: 500
[pupernetes.service] I0607 18:05:36.617347   27882 kubectl.go:14] Calling kubectl apply -f /home/jb/go/src/github.com/DataDog/pupernetes/sanbox/manifest-api ...
[pupernetes.service] I0607 18:05:37.597395   27882 kubectl.go:21] Successfully applied manifests:
[pupernetes.service] serviceaccount "coredns" created
[pupernetes.service] clusterrole.rbac.authorization.k8s.io "system:coredns" created
[pupernetes.service] clusterrolebinding.rbac.authorization.k8s.io "system:coredns" created
[pupernetes.service] configmap "coredns" created
[pupernetes.service] deployment.extensions "coredns" created
[pupernetes.service] service "coredns" created
[pupernetes.service] serviceaccount "kube-controller-manager" created
[pupernetes.service] pod "kube-controller-manager" created
[pupernetes.service] daemonset.extensions "kube-proxy" created
[pupernetes.service] daemonset.extensions "kube-scheduler" created
[pupernetes.service] clusterrolebinding.rbac.authorization.k8s.io "p8s-admin" created
[pupernetes.service] I0607 18:05:37.597553   27882 notify.go:39] Compiled with CGO_ENABLED=0, unable to ack the systemd notify. PPID is 1
[pupernetes.service] I0607 18:05:37.597567   27882 run.go:190] Pupernetes is ready
[pupernetes.service] Started github.com/DataDog/pupernetes.
[pupernetes.service] I0607 18:05:38.617325   27882 state.go:66] Kubelet log reports 1 running pods
I0607 18:05:39.207790   27645 wait.go:86] Systemd unit pupernetes.service is running

Motivation

The bash logic produce too much log lines and can saturate the output of the CI.

@JulienBalestra JulienBalestra added the enhancement New feature or request label Jun 7, 2018
@JulienBalestra JulienBalestra added this to the v0.4.0 milestone Jun 7, 2018
@JulienBalestra JulienBalestra requested a review from a team June 7, 2018 17:29
Copy link
Copy Markdown

@xvello xvello left a comment

Choose a reason for hiding this comment

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

LGTM!

@JulienBalestra JulienBalestra merged commit ad72f71 into master Jun 8, 2018
@JulienBalestra JulienBalestra deleted the JulienBalestra/wait-command branch June 8, 2018 11:27
@JulienBalestra JulienBalestra mentioned this pull request Jun 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants