I'm trying to set up a full CI/CD pipeline for a SpringBoot application, starting from a GitLab repository (see https://gitlab.com/pietrom/clock-api) and automatically deploying to a Kubernetes Cluster backed by Google Cloud Platform.
My pipeline works quite fine (the app is built, it is packaged as a Docker image, the image is published on my project registry and containers are started for both staging and production environment), except for a detail: Operation/Environments page shows me both environments, with the following warning:
Kubernetes deployment not found To see deployment progress for your environments, make sure your deployments are in Kubernetes namespace <projectname>, and annotated with app.gitlab.com/app=$CI_PROJECT_PATH_SLUG and app.gitlab.com/env=$CI_ENVIRONMENT_SLUG. I googled around a bit but I can't resolve this problem: my deployment.yml contains requested annotation, both for deployment and pod:
apiVersion: extensions/v1beta1 kind: Deployment metadata: name: clock-api-ENVIRONMENT annotations: app.gitlab.com/app: "PROJECT_PATH_SLUG" app.gitlab.com/env: "ENVIRONMENT" spec: replicas: 1 template: metadata: labels: app: ENVIRONMENT annotations: prometheus.io/scrape: "true" prometheus.io/port: "8080" prometheus.io/path: "/actuator/prometheus" app.gitlab.com/app: "PROJECT_PATH_SLUG" app.gitlab.com/env: "ENVIRONMENT" spec: containers: - name: clock-api-ENVIRONMENT image: registry.gitlab.com/pietrom/clock-api imagePullPolicy: Always ports: - containerPort: 8080 imagePullSecrets: - name: registry.gitlab.com PROJECT_PATH_SLUG and ENVIRONMENT placeholder are substituded (using sed) during pipeline execution with values provided by GitLab infrastructure ($CI_PROJECT_PATH_SLUG and $CI_ENVIRONMENT_SLUG, respectively) and I can see the expected values in my GCP console, but GitLab integration does not seem to work.
I'm missing something but I can't figure what differences there are between my deployment setup and the official documentation available here.
Thanks in advance for your help!
--namespace $CI_PROJECT_PATH_SLUG(i.e.pietrom-clock-apiin my case), too, but the result is the same: everything in the pipeline works fine, but Environment page shows the Kubernetes deployment not found warning...