jenkins-x / jx

Jenkins X provides automated CI+CD for Kubernetes with Preview Environments on Pull Requests using Cloud Native pipelines from Tekton
https://jenkins-x.io/
Apache License 2.0
4.58k stars 788 forks source link

jenkins-x-gcpreviews job is failing on serverless installs #3297

Closed romainverduci closed 5 years ago

romainverduci commented 5 years ago

Summary

jenkins-x-gcpreviews is relying on jenkins ServiceAccountwhich is only created using static master. When using serverless jenkins configurations, it's failing and not cleaning up preview environments

Steps to reproduce the behavior

  1. Given a jx cluster configured to use serverless jenkins
  2. Create a quickstart (let's say golang-http), open a PR to get a preview env
  3. Close the PR
  4. Run the gcpreviews job manually (or wait to it to happen automatically): kubectl create job --from=cronjob/jenkins-x-gcpreviews jenkins-x-gcpreviews

Expected behavior

Preview env should be removed

Actual behavior

gcpreviews Job is failing with the following error: Warning FailedCreate 5m59s (x295 over 28h) job-controller Error creating: pods "jenkins-x-gcpreviews-" is forbidden: error looking up service account jx/jenkins: serviceaccount "jenkins" not found

Jx version

The output of jx version is:

NAME VERSION jx 1.3.953 jenkins x platform 0.0.3499 Kubernetes cluster v1.11.6-gke.2 kubectl v1.13.2 helm client v2.12.1+g02a47c7 helm server v2.12.2+g7d2b0c7 git git version 2.17.2 (Apple Git-113) Operating System Mac OS X 10.14.3 build 18D109

Jenkins type

Kubernetes cluster

GKE

Operating system / Environment

Mac OS X 10.14

romainverduci commented 5 years ago

Fixed by https://github.com/jenkins-x/jenkins-x-platform/pull/5012