Open viglesiasce opened 5 years ago
It seems like there is different behavior depending on the environment. Here's the console output from my build from the jenkins UI.
Started by user unknown or anonymous
Building in workspace /usr/local/google/home/stephenshank/Documents/google-kubernetes-engine-plugin/work/jobs/hello/workspace
No credentials specified
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url https://github.com/jenkinsci/google-kubernetes-engine-plugin.git # timeout=10
Fetching upstream changes from https://github.com/jenkinsci/google-kubernetes-engine-plugin.git
> git --version # timeout=10
> git fetch --tags --progress https://github.com/jenkinsci/google-kubernetes-engine-plugin.git +refs/heads/*:refs/remotes/origin/*
> git rev-parse refs/remotes/origin/develop^{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/develop^{commit} # timeout=10
Checking out Revision db14b1db74e4296c09f4cc36a3745520cc27d2fb (refs/remotes/origin/develop)
> git config core.sparsecheckout # timeout=10
> git checkout -f db14b1db74e4296c09f4cc36a3745520cc27d2fb
Commit message: "Merge pull request #57 from stephenashank/feature/issue56instructionfix"
> git rev-list --no-walk db14b1db74e4296c09f4cc36a3745520cc27d2fb # timeout=10
$ kubectl --kubeconfig /usr/local/google/home/stephenshank/Documents/google-kubernetes-engine-plugin/work/jobs/hello/workspace/.kube1027573903809928450config config use-context gke_graphitestephenshank_us-central1-a_standard-cluster-1
$ kubectl --kubeconfig /usr/local/google/home/stephenshank/Documents/google-kubernetes-engine-plugin/work/jobs/hello/workspace/.kube1027573903809928450config get --namespace default namespace default -o json
$ kubectl --kubeconfig /usr/local/google/home/stephenshank/Documents/google-kubernetes-engine-plugin/work/jobs/hello/workspace/.kube736431482384517979config config use-context gke_graphitestephenshank_us-central1-a_standard-cluster-1
$ kubectl --kubeconfig /usr/local/google/home/stephenshank/Documents/google-kubernetes-engine-plugin/work/jobs/hello/workspace/.kube736431482384517979config apply --namespace default -f /usr/local/google/home/stephenshank/Documents/google-kubernetes-engine-plugin/work/jobs/hello/workspace/docs/resources/manifest.yaml
Verifying manifests: /usr/local/google/home/stephenshank/Documents/google-kubernetes-engine-plugin/work/jobs/hello/workspace/docs/resources/manifest.yaml
Verifying 1 objects:
Verifying: apps/v1/Deployment: nginx-deployment
$ kubectl --kubeconfig /usr/local/google/home/stephenshank/Documents/google-kubernetes-engine-plugin/work/jobs/hello/workspace/.kube873112613718848570config config use-context gke_graphitestephenshank_us-central1-a_standard-cluster-1
$ kubectl --kubeconfig /usr/local/google/home/stephenshank/Documents/google-kubernetes-engine-plugin/work/jobs/hello/workspace/.kube873112613718848570config get --namespace default deployment nginx-deployment -o json
Verifying: apps/v1/Deployment: nginx-deployment
$ kubectl --kubeconfig /usr/local/google/home/stephenshank/Documents/google-kubernetes-engine-plugin/work/jobs/hello/workspace/.kube4682006455367160805config config use-context gke_graphitestephenshank_us-central1-a_standard-cluster-1
$ kubectl --kubeconfig /usr/local/google/home/stephenshank/Documents/google-kubernetes-engine-plugin/work/jobs/hello/workspace/.kube4682006455367160805config get --namespace default deployment nginx-deployment -o json
Successfully verified apps/v1/Deployment: nginx-deployment
AvailableReplicas = 3, MinimumReplicas = 3
Finished: SUCCESS
This is what came from the command line where I was running mvn hpi:run
:
May 03, 2019 2:28:57 PM com.google.jenkins.plugins.k8sengine.KubernetesEngineBuilder perform
INFO: GKE Deploying, projectId: graphitestephenshank cluster: standard-cluster-1 zone: us-central1-a
May 03, 2019 2:28:59 PM com.google.jenkins.plugins.k8sengine.KubernetesEngineBuilder verify
INFO: GKE verifying deployment to, projectId: graphitestephenshank cluster: standard-cluster-1 zone: us-central1-a manifests: /usr/local/google/home/stephenshank/Documents/google-kubernetes-engine-plugin/work/jobs/hello/workspace/docs/resources/manifest.yaml
May 03, 2019 2:28:59 PM com.google.jenkins.plugins.k8sengine.KubernetesVerifiers$DeploymentVerifier verify
INFO: Verifying deployment, nginx-deployment
May 03, 2019 2:29:04 PM com.google.jenkins.plugins.k8sengine.KubernetesVerifiers$DeploymentVerifier verify
INFO: Verifying deployment, nginx-deployment
May 03, 2019 2:29:05 PM com.google.jenkins.plugins.k8sengine.VerificationTask verifyObjects
INFO: 0 error results
May 03, 2019 2:29:05 PM hudson.model.Run execute
INFO: hello #25 main build action completed: SUCCESS
Was this done on an existing deployment? If not can you try to delete and re-create it with the plugin?
On Fri, May 3, 2019 at 2:34 PM Stephen Shank notifications@github.com wrote:
It seems like there is different behavior depending on the environment. Here's the console output from my build from the jenkins UI.
Started by user unknown or anonymous Building in workspace /usr/local/google/home/stephenshank/Documents/google-kubernetes-engine-plugin/work/jobs/hello/workspace No credentials specified
git rev-parse --is-inside-work-tree # timeout=10 Fetching changes from the remote Git repository git config remote.origin.url https://github.com/jenkinsci/google-kubernetes-engine-plugin.git # timeout=10 Fetching upstream changes from https://github.com/jenkinsci/google-kubernetes-engine-plugin.git git --version # timeout=10 git fetch --tags --progress https://github.com/jenkinsci/google-kubernetes-engine-plugin.git +refs/heads/:refs/remotes/origin/ git rev-parse refs/remotes/origin/develop^{commit} # timeout=10 git rev-parse refs/remotes/origin/origin/develop^{commit} # timeout=10 Checking out Revision db14b1db74e4296c09f4cc36a3745520cc27d2fb (refs/remotes/origin/develop) git config core.sparsecheckout # timeout=10 git checkout -f db14b1db74e4296c09f4cc36a3745520cc27d2fb Commit message: "Merge pull request #57 from stephenashank/feature/issue56instructionfix" git rev-list --no-walk db14b1db74e4296c09f4cc36a3745520cc27d2fb # timeout=10 $ kubectl --kubeconfig /usr/local/google/home/stephenshank/Documents/google-kubernetes-engine-plugin/work/jobs/hello/workspace/.kube1027573903809928450config config use-context gke_graphitestephenshank_us-central1-a_standard-cluster-1 $ kubectl --kubeconfig /usr/local/google/home/stephenshank/Documents/google-kubernetes-engine-plugin/work/jobs/hello/workspace/.kube1027573903809928450config get --namespace default namespace default -o json $ kubectl --kubeconfig /usr/local/google/home/stephenshank/Documents/google-kubernetes-engine-plugin/work/jobs/hello/workspace/.kube736431482384517979config config use-context gke_graphitestephenshank_us-central1-a_standard-cluster-1 $ kubectl --kubeconfig /usr/local/google/home/stephenshank/Documents/google-kubernetes-engine-plugin/work/jobs/hello/workspace/.kube736431482384517979config apply --namespace default -f /usr/local/google/home/stephenshank/Documents/google-kubernetes-engine-plugin/work/jobs/hello/workspace/docs/resources/manifest.yaml Verifying manifests: /usr/local/google/home/stephenshank/Documents/google-kubernetes-engine-plugin/work/jobs/hello/workspace/docs/resources/manifest.yaml Verifying 1 objects: Verifying: apps/v1/Deployment: nginx-deployment $ kubectl --kubeconfig /usr/local/google/home/stephenshank/Documents/google-kubernetes-engine-plugin/work/jobs/hello/workspace/.kube873112613718848570config config use-context gke_graphitestephenshank_us-central1-a_standard-cluster-1 $ kubectl --kubeconfig /usr/local/google/home/stephenshank/Documents/google-kubernetes-engine-plugin/work/jobs/hello/workspace/.kube873112613718848570config get --namespace default deployment nginx-deployment -o json Verifying: apps/v1/Deployment: nginx-deployment $ kubectl --kubeconfig /usr/local/google/home/stephenshank/Documents/google-kubernetes-engine-plugin/work/jobs/hello/workspace/.kube4682006455367160805config config use-context gke_graphitestephenshank_us-central1-a_standard-cluster-1 $ kubectl --kubeconfig /usr/local/google/home/stephenshank/Documents/google-kubernetes-engine-plugin/work/jobs/hello/workspace/.kube4682006455367160805config get --namespace default deployment nginx-deployment -o json Successfully verified apps/v1/Deployment: nginx-deployment AvailableReplicas = 3, MinimumReplicas = 3
Finished: SUCCESS
This is what came from the command line where I was running mvn hpi:run:
May 03, 2019 2:28:57 PM com.google.jenkins.plugins.k8sengine.KubernetesEngineBuilder perform INFO: GKE Deploying, projectId: graphitestephenshank cluster: standard-cluster-1 zone: us-central1-a May 03, 2019 2:28:59 PM com.google.jenkins.plugins.k8sengine.KubernetesEngineBuilder verify INFO: GKE verifying deployment to, projectId: graphitestephenshank cluster: standard-cluster-1 zone: us-central1-a manifests: /usr/local/google/home/stephenshank/Documents/google-kubernetes-engine-plugin/work/jobs/hello/workspace/docs/resources/manifest.yaml May 03, 2019 2:28:59 PM com.google.jenkins.plugins.k8sengine.KubernetesVerifiers$DeploymentVerifier verify INFO: Verifying deployment, nginx-deployment May 03, 2019 2:29:04 PM com.google.jenkins.plugins.k8sengine.KubernetesVerifiers$DeploymentVerifier verify INFO: Verifying deployment, nginx-deployment May 03, 2019 2:29:05 PM com.google.jenkins.plugins.k8sengine.VerificationTask verifyObjects INFO: 0 error results May 03, 2019 2:29:05 PM hudson.model.Run execute INFO: hello #25 main build action completed: SUCCESS
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jenkinsci/google-kubernetes-engine-plugin/issues/67#issuecomment-489247075, or mute the thread https://github.com/notifications/unsubscribe-auth/AADEFJ5KGQEZFHJVNAI4WLTPTSVXVANCNFSM4HKXBB2Q .
It's possible that the Jenkins logs don't include the logs from the launcher's process. I suspect the reason you see the deployment like that is because of how we run kubectl get
with the -o json
flag, which is currently required for verification.
It might be possible to replace the use of kubectl get
with calls to the GKE API, but that also might run into the same issues that we have with kubectl apply
where we can't use the GKE API
No, this was not for an existing deployment
I explored using the Kubernetes SDK and it did not make sense in light of the fact that we are using kubectl already and other reasons I can disclose offline.
Need to re-enable a subset of logs
The full deployment JSON is being printed out during deployment validation. We should remove this and only add it back when we have a way to enable "debug" mode or log levels for this step.
Example log snippet here (it is 100x longer than this):