GitLab AutoDevOps deployment fails with "error: no matches for kind "Namespace" in version "v1""
Summary
On deployment to local K8s cluster, build and tests pass, but deployment fails with "error: no matches for kind "Namespace" in version "v1"".
Steps to reproduce
- Create local k8s 1.19 cluster
- Connect cluster to GitLab
- Install MetalLB to facilitate GitLab Ingress, install GitLab Ingress via UI.
- Attempt to deploy an image to the cluster.
What is the current bug behavior?
Deployment fails. We've tried many different auto-deploy-values, with clearing cache and removing/re-adding cluster between attempts, deleting gitlab-managed-apps namespace, and combinations thereof, but currently we get the issue with a .gitlab/auto_deploy_values.yaml that reads as follows:
deploymentApiVersion: apps/v1
postgresql:
enabled: false
image:
tag: latest
pullPolicy: Always
What is the expected correct behavior?
Deployment succeeds.
Relevant logs and/or screenshots
Job log has the following output:
Created fresh repository.
Checking out ecc55555 as master...
Skipping Git submodules setup
Executing "step_script" stage of the job script
$ auto-deploy check_kube_domain
$ auto-deploy download_chart
Creating /root/.helm
Creating /root/.helm/repository
Creating /root/.helm/repository/cache
Creating /root/.helm/repository/local
Creating /root/.helm/plugins
Creating /root/.helm/starters
Creating /root/.helm/cache/archive
Creating /root/.helm/repository/repositories.yaml
Adding stable repo with URL: https://kubernetes-charts.storage.googleapis.com
Adding local repo with URL: http://127.0.0.1:8879/charts
$HELM_HOME has been configured at /root/.helm.
Not installing Tiller due to 'client-only' flag having been set
Download skipped. Using the default chart included in auto-deploy-image...
Hang tight while we grab the latest from your chart repositories...
...Unable to get an update from the "local" chart repository (http://127.0.0.1:8879/charts):
Get "http://127.0.0.1:8879/charts/index.yaml": dial tcp 127.0.0.1:8879: connect: connection refused
...Successfully got an update from the "stable" chart repository
Update Complete.
Saving 1 charts
Downloading postgresql from repo https://kubernetes-charts.storage.googleapis.com/
Deleting outdated charts
Hang tight while we grab the latest from your chart repositories...
...Unable to get an update from the "local" chart repository (http://127.0.0.1:8879/charts):
Get "http://127.0.0.1:8879/charts/index.yaml": dial tcp 127.0.0.1:8879: connect: connection refused
...Successfully got an update from the "stable" chart repository
Update Complete.
Saving 1 charts
Downloading postgresql from repo https://kubernetes-charts.storage.googleapis.com/
Deleting outdated charts
$ auto-deploy ensure_namespace
error: the server doesn't have a resource type "namespace"
error: no matches for kind "Namespace" in version "v1"
Uploading artifacts for failed job
00:01
Uploading artifacts...
WARNING: environment_url.txt: no matching files
WARNING: tiller.log: no matching files
ERROR: No files to upload
ERROR: Job failed: exit code 1
Output of checks
This bug happens on GitLab.com
@tkuah, I've seen you respond to some related issues -- hopefully you can point us in the right direction.