Container Scanning Job fails over K8S cluster on Azure

Summary

While running AutoDevops pipeline over a Vue project, inside a K8s Cluster on Azure, the container_scanning job always keep waiting for the database to be up

Steps to reproduce

  • Create a Vue project
  • Enable AutoDevOps with runners over an AKS (Azure Kubernetes Service) Cluster
  • Make first commit with project code

What is the current bug behavior?

Fail when running on Kubernetes Cluster over Azure (AKS)

What is the expected correct behavior?

Success Job

Relevant logs and/or screenshots

Job Log

Running with gitlab-runner 12.2.0 (a987417a)
  on runner-gitlab-runner-7fd8cdb4cf-vrjqj 5sx1e2wp
Using Kubernetes namespace: gitlab-managed-apps
Using Kubernetes executor with image registry.gitlab.com/gitlab-org/security-products/analyzers/klar:$CS_MAJOR_VERSION ...
Waiting for pod gitlab-managed-apps/runner-5sx1e2wp-project-3-concurrent-1hhfcr to be running, status is Pending
Waiting for pod gitlab-managed-apps/runner-5sx1e2wp-project-3-concurrent-1hhfcr to be running, status is Pending
Running on runner-5sx1e2wp-project-3-concurrent-1hhfcr via runner-gitlab-runner-7fd8cdb4cf-vrjqj...
Skipping Git repository setup
Skipping Git checkout
Skipping Git submodules setup
$ /container-scanner/start.sh

Detected KUBERNETES_PORT environment variable, using 127.0.0.1 for CLAIR_VULNERABILITIES_DB_URL

Waiting for Clair daemon to start

Clair daemon not ready, waiting 1 second before retrying. Clair log contents:
{"Event":"pgsql: could not open database: dial tcp 127.0.0.1:5432: connect: connection refused","Level":"fatal","Location":"main.go:97","Time":"2019-10-14 22:10:46.621945"}
{"Event":"pgsql: could not open database: dial tcp 127.0.0.1:5432: connect: connection refused","Level":"fatal","Location":"main.go:97","Time":"2019-10-14 22:10:47.636891"}
{"Event":"pgsql: could not open database: dial tcp 127.0.0.1:5432: connect: connection refused","Level":"fatal","Location":"main.go:97","Time":"2019-10-14 22:10:49.652696"}
{"Event":"pgsql: could not open database: dial tcp 127.0.0.1:5432: connect: connection refused","Level":"fatal","Location":"main.go:97","Time":"2019-10-14 22:10:52.670830"}

Output of checks

Self-hosted gitlab ultimate

Results of GitLab environment info

Expand for output related to GitLab environment info
System information
System:		Ubuntu 18.04
Proxy:		no
Current User:	git
Using RVM:	no
Ruby Version:	2.6.3p62
Gem Version:	2.7.9
Bundler Version:1.17.3
Rake Version:	12.3.2
Redis Version:	3.2.12
Git Version:	2.22.0
Sidekiq Version:5.2.7
Go Version:	unknown

GitLab information
Version:	12.3.5-ee
Revision:	9dbaa740018
Directory:	/opt/gitlab/embedded/service/gitlab-rails
DB Adapter:	PostgreSQL
DB Version:	10.9
URL:		https://XXXX.com
HTTP Clone URL:	https://XXXX.com/some-group/some-project.git
SSH Clone URL:	git@XXXX.com:some-group/some-project.git
Elasticsearch:	no
Geo:		no
Using LDAP:	no
Using Omniauth:	yes
Omniauth Providers: 

GitLab Shell
Version:	10.0.0
Repository storage paths:
- default: 	/datadrive/gitlab/repositories
GitLab Shell path:		/opt/gitlab/embedded/service/gitlab-shell
Git:		/opt/gitlab/embedded/bin/git

Results of GitLab application Check

Expand for output related to the GitLab application check
Checking GitLab subtasks ...

Checking GitLab Shell ...

GitLab Shell: ... GitLab Shell version >= 10.0.0 ? ... OK (10.0.0)
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
Check GitLab API access: OK
Redis available via internal API: OK

gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Gitaly ...

Gitaly: ... default ... OK

Checking Gitaly ... Finished

Checking Sidekiq ...

Sidekiq: ... Running? ... yes
Number of Sidekiq processes ... 1

Checking Sidekiq ... Finished

Checking Incoming Email ...

Incoming Email: ... Reply by email is disabled in config/gitlab.yml

Checking Incoming Email ... Finished

Checking LDAP ...

LDAP: ... LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

Checking GitLab App ...

Git configured correctly? ... yes
Database config exists? ... yes
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config up to date? ... yes
Log directory writable? ... yes
Tmp directory writable? ... yes
Uploads directory exists? ... yes
Uploads directory has correct permissions? ... yes
Uploads directory tmp has correct permissions? ... skipped (no tmp uploads folder yet)
Init script exists? ... skipped (omnibus-gitlab has no init script)
Init script up-to-date? ... skipped (omnibus-gitlab has no init script)
Projects have namespace: ... 
3/1 ... yes
3/2 ... yes
1/3 ... yes
Redis version >= 2.8.0? ... yes
Ruby version >= 2.5.3 ? ... yes (2.6.3)
Git version >= 2.22.0 ? ... yes (2.22.0)
Git user has default SSH configuration? ... yes
Active users: ... 1
Is authorized keys file accessible? ... yes
Elasticsearch version 5.6 - 6.x? ... skipped (elasticsearch is disabled)

Checking GitLab App ... Finished


Checking GitLab subtasks ... Finished
Assignee Loading
Time tracking Loading