Error auto deploy redmine from Gitlab to Rancher Kubernetes
Hi, I have config auto deploy redmine source from Gitlab to Rancher Kubernetes
I get this error in pipelines
Running with gitlab-runner 13.7.0 (943fc252)
on gitlab-gitlab-runner-6d654d79bf-2br4d eoUoyzGF
Preparing the "kubernetes" executor
00:00
Using Kubernetes namespace: 3s-git-prod
WARNING: Pulling GitLab Runner helper image from Docker Hub. Helper image is migrating to registry.gitlab.com, for more information see https://docs.gitlab.com/runner/configuration/advanced-configuration.html#migrating-helper-image-to-registrygitlabcom
Using Kubernetes executor with image registry.gitlab.com/gitlab-org/cluster-integration/auto-deploy-image:v2.1.0 ...
Preparing environment
00:10
Waiting for pod 3s-git-prod/runner-eouoyzgf-project-432-concurrent-04m9gl to be running, status is Pending
Waiting for pod 3s-git-prod/runner-eouoyzgf-project-432-concurrent-04m9gl to be running, status is Pending
ContainersNotReady: "containers with unready status: [build helper]"
ContainersNotReady: "containers with unready status: [build helper]"
Waiting for pod 3s-git-prod/runner-eouoyzgf-project-432-concurrent-04m9gl to be running, status is Pending
ContainersNotReady: "containers with unready status: [build helper]"
ContainersNotReady: "containers with unready status: [build helper]"
Running on runner-eouoyzgf-project-432-concurrent-04m9gl via gitlab-gitlab-runner-6d654d79bf-2br4d...
Getting source from Git repository
00:06
Fetching changes with git depth set to 50...
Initialized empty Git repository in /builds/3si/insight/.git/
Created fresh repository.
Checking out f321c7db as develop...
Skipping Git submodules setup
Executing "step_script" stage of the job script
00:47
$ auto-deploy check_kube_domain
$ auto-deploy download_chart
"stable" has been added to your repositories
"bitnami" has been added to your repositories
Adding Helm chart repository '3s-charts'
"3s-charts" has been added to your repositories
Downloading remote chart '3s-charts/auto-deploy-redmine'...
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "3s-charts" chart repository
...Successfully got an update from the "bitnami" chart repository
...Successfully got an update from the "stable" chart repository
Update Complete. ⎈Happy Helming!⎈
Saving 1 charts
Downloading postgresql from repo https://charts.helm.sh/stable
Deleting outdated charts
$ auto-deploy ensure_namespace
NAME STATUS AGE
3s-insight-dev Active 90d
$ auto-deploy initialize_tiller
Deprecated: Helm 3 does not have Tiller.
$ auto-deploy create_secret
Create secret...
secret "gitlab-registry-3si-insight" deleted
secret/gitlab-registry-3si-insight replaced
$ auto-deploy deploy
Error: release: not found
Using PostgreSQL helm values file '.gitlab/auto-deploy-postgres-values.yaml'
Release "review-develop-3zknud-postgresql" has been upgraded. Happy Helming!
NAME: review-develop-3zknud-postgresql
LAST DEPLOYED: Mon Jan 4 10:57:07 2021
NAMESPACE: 3s-insight-dev
STATUS: deployed
REVISION: 16
TEST SUITE: None
NOTES:
** Please be patient while the chart is being deployed **
PostgreSQL can be accessed via port 5432 on the following DNS name from within your cluster:
review-develop-3zknud-postgresql.3s-insight-dev.svc.cluster.local - Read/Write connection
To get the password for "user" run:
export POSTGRES_PASSWORD=$(kubectl get secret --namespace 3s-insight-dev review-develop-3zknud-postgresql -o jsonpath="{.data.postgresql-password}" | base64 --decode)
To connect to your database run the following command:
kubectl run review-develop-3zknud-postgresql-client --rm --tty -i --restart='Never' --namespace 3s-insight-dev --image docker.io/bitnami/postgresql:9.6.16 --env="PGPASSWORD=$POSTGRES_PASSWORD" --command -- psql --host review-develop-3zknud-postgresql -U user -d review-develop-3zknud -p 5432
To connect to your database from outside the cluster execute the following commands:
kubectl port-forward --namespace 3s-insight-dev svc/review-develop-3zknud-postgresql 5432:5432 &
PGPASSWORD="$POSTGRES_PASSWORD" psql --host 127.0.0.1 -U user -d review-develop-3zknud -p 5432
WARNING: Rolling tag detected (bitnami/postgresql:9.6.16), please note that it is strongly recommended to avoid using rolling tags in a production environment.
+info https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/
Validating chart version...
Fetching the previously deployed chart version...
Fetching the deploying chart version...
secret "review-develop-3zknud-secret" deleted
secret/review-develop-3zknud-secret replaced
Using helm values file '.devops/2-deploy/values.yaml'
Deploying new stable release...
Release "review-develop-3zknud" does not exist. Installing it now.
Error: unable to build kubernetes objects from release manifest: unable to recognize "": no matches for kind "Deployment" in version "extensions/v1beta1"
Uploading artifacts for failed job
00:00
Uploading artifacts...
WARNING: environment_url.txt: no matching files
WARNING: tiller.log: no matching files
ERROR: No files to upload
Cleaning up file based variables
00:01
ERROR: Job failed: command terminated with exit code 1
This is content of gitlab-ci.yml
include:
- template: Auto-DevOps.gitlab-ci.yml
.auto-deploy:
image: registry.gitlab.com/gitlab-org/cluster-integration/auto-deploy-image:v2.1.0
variables:
AUTO_DEVOPS_FORCE_DEPLOY_V2: 1
variables:
DOCKERFILE_PATH: .devops/1-build/Dockerfile
# Config to use Redmine chart from 3S Helm Charts repo
AUTO_DEVOPS_CHART: 3s-charts/auto-deploy-redmine
TEST_DISABLED: "true"
CODE_QUALITY_DISABLED: "true"
LICENSE_MANAGEMENT_DISABLED: "true"
PERFORMANCE_DISABLED: "true"
LOAD_PERFORMANCE_DISABLED: "true"
SAST_DISABLED: "true"
SECRET_DETECTION_DISABLED: "true"
DEPENDENCY_SCANNING_DISABLED: "true"
CONTAINER_SCANNING_DISABLED: "true"
DAST_DISABLED: "true"
HELM_UPGRADE_VALUES_FILE: .devops/2-deploy/values.yaml
HELM_UPGRADE_EXTRA_ARGS: --set service.commonName=
MIGRATE_HELM_2T03: "true"
build:
rules:
- if: '$CI_COMMIT_BRANCH == "feature/collapse_sidebar" || $CI_COMMIT_BRANCH == "feature/30549-timesheet-plugin" || $CI_COMMIT_BRANCH == "develop" || $CI_COMMIT_BRANCH == "master"'
review:
variables:
KUBE_INGRESS_BASE_DOMAIN: dev.abc.vn
environment:
url: http://$CI_PROJECT_NAME-$CI_ENVIRONMENT_SLUG.$KUBE_INGRESS_BASE_DOMAIN
kubernetes:
namespace: 3s-insight-dev
rules:
- if: '$CI_COMMIT_BRANCH == "feature/collapse_sidebar" || $CI_COMMIT_BRANCH == "feature/30549-timesheet-plugin" || $CI_COMMIT_BRANCH == "develop"'
production:
variables:
KUBE_INGRESS_BASE_DOMAIN: abc.vn
environment:
url: http://$CI_PROJECT_NAME.$KUBE_INGRESS_BASE_DOMAIN
kubernetes:
namespace: 3s-insight-prod
This is content of deployment.yamml in template chart
{{- if not .Values.application.initializeCommand -}}
apiVersion: {{ default "extensions/v1beta1" .Values.deploymentApiVersion }}
kind: Deployment
metadata:
name: {{ template "trackableappname" . }}
annotations:
{{ if .Values.gitlab.app }}app.gitlab.com/app: {{ .Values.gitlab.app | quote }}{{ end }}
{{ if .Values.gitlab.env }}app.gitlab.com/env: {{ .Values.gitlab.env | quote }}{{ end }}
labels:
app: {{ template "appname" . }}
track: "{{ .Values.application.track }}"
tier: "{{ .Values.application.tier }}"
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
{{- if or .Values.enableSelector (eq (default "extensions/v1beta1" .Values.deploymentApiVersion) "apps/v1") }}
selector:
matchLabels:
app: {{ template "appname" . }}
track: "{{ .Values.application.track }}"
tier: "{{ .Values.application.tier }}"
release: {{ .Release.Name }}
{{- end }}
replicas: {{ .Values.replicaCount }}
{{- if .Values.strategyType }}
strategy:
type: {{ .Values.strategyType | quote }}
{{- end }}
template:
metadata:
annotations:
checksum/application-secrets: "{{ .Values.application.secretChecksum }}"
{{ if .Values.gitlab.app }}app.gitlab.com/app: {{ .Values.gitlab.app | quote }}{{ end }}
{{ if .Values.gitlab.env }}app.gitlab.com/env: {{ .Values.gitlab.env | quote }}{{ end }}
{{- if .Values.podAnnotations }}
{{ toYaml .Values.podAnnotations | indent 8 }}
{{- end }}
labels:
app: {{ template "appname" . }}
track: "{{ .Values.application.track }}"
tier: "{{ .Values.application.tier }}"
release: {{ .Release.Name }}
spec:
imagePullSecrets:
{{ toYaml .Values.image.secrets | indent 10 }}
containers:
- name: {{ .Chart.Name }}
image: {{ template "imagename" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if .Values.application.secretName }}
lifecycle:
postStart:
exec:
command: ["/bin/sh", "-c", cp /tmp/secrets/* /usr/src/redmine/config/]
volumeMounts:
- name: config
mountPath: /tmp/secrets
{{- if .Values.redmine.persistence.enabled }}
- name: files
mountPath: /usr/src/redmine/files
- name: rich-files
mountPath: /usr/src/redmine/public/system/rich/rich_files
{{- end }}
envFrom:
- secretRef:
name: {{ .Values.application.secretName }}
{{- end }}
env:
{{- if .Values.postgresql.managed }}
- name: POSTGRES_USER
valueFrom:
secretKeyRef:
name: app-postgres
key: username
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: app-postgres
key: password
- name: POSTGRES_HOST
valueFrom:
secretKeyRef:
name: app-postgres
key: privateIP
{{- end }}
- name: REDMINE_DB_POSTGRES
value: {{ printf "%s-%s" .Values.gitlab.env "postgresql" | quote }}
- name: REDMINE_DB_USERNAME
value: {{ .Values.postgresql.postgresUser }}
- name: REDMINE_DB_PASSWORD
value: {{ .Values.postgresql.postgresPassword }}
- name: REDMINE_DB_DATABASE
value: {{ .Values.postgresql.postgresDatabase }}
- name: DATABASE_URL
value: {{ .Values.application.database_url | quote }}
- name: GITLAB_ENVIRONMENT_NAME
value: {{ .Values.gitlab.envName | quote }}
- name: GITLAB_ENVIRONMENT_URL
value: {{ .Values.gitlab.envURL | quote }}
{{ if .Values.podEnvironment }}{{ toYaml .Values.podEnvironment | indent 8 }}{{ end }}
ports:
- name: "{{ .Values.service.name }}"
containerPort: {{ .Values.service.internalPort }}
{{- if .Values.livenessProbe.enabled }}
livenessProbe:
tcpSocket:
port: http
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
successThreshold: {{ .Values.livenessProbe.successThreshold }}
failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
{{- else if .Values.customLivenessProbe }}
livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customLivenessProbe "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.readinessProbe.enabled }}
readinessProbe:
tcpSocket:
port: http
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
successThreshold: {{ .Values.readinessProbe.successThreshold }}
failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
{{- else if .Values.customReadinessProbe }}
readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customReadinessProbe "context" $) | nindent 12 }}
{{- end }}
resources:
{{ toYaml .Values.resources | indent 12 }}
{{- end -}}
{{- if .Values.application.secretName }}
volumes:
{{- if .Values.redmine.persistence.enabled }}
- name: files
persistentVolumeClaim:
claimName: {{ template "fullname" . }}
- name: rich-files
persistentVolumeClaim:
claimName: "{{ template "fullname" . }}-rich-files"
{{- end }}
- name: config
secret:
secretName: {{ .Values.application.secretName }}
items:
- key: CONFIGURATION_YML
path: configuration.yml
{{- end }}
Please help me to fix Thanks!