Commit a7c69dab authored by Christos Tranoris's avatar Christos Tranoris
Browse files

change gitlab

parent 9e02717c
Loading
Loading
Loading
Loading
Loading
+10 −16
Changes for .gitlab-ci.yml: 10 added lines, 16 removed lines.
Original line number Diff line number Diff line
# Lints the Helm chart on every push. On a Git tag "vX.Y.Z" it packages the chart
# as version X.Y.Z and pushes it to Harbor as an OCI artifact:
#   oci://${HARBOR_REGISTRY}/${HARBOR_PROJECT}/chronos:X.Y.Z
# as version X.Y.Z and pushes it as an OCI artifact to this project's GitLab
# container registry:
#   oci://${CI_REGISTRY_IMAGE}/chronos:X.Y.Z
#   i.e. oci://labs.etsi.org:5050/osl/code/addons/chronos/org.etsi.osl.chronos.deploy/chronos:X.Y.Z
#
# Uses the same group-level CI/CD variables as the image pipelines
# (HARBOR_REGISTRY, HARBOR_PROJECT, HARBOR_ROBOT_USER, HARBOR_ROBOT_TOKEN).
# Protect the "v*" tag pattern (Settings > Repository > Protected tags) so the
# Protected robot variables reach the tag pipeline.
#
# harbor.intranet.pnet serves plain HTTP only, hence --plain-http. The robot
# credentials cross the network unencrypted, which is acceptable only on the
# trusted intranet segment. Drop --plain-http once Harbor is behind TLS.
# Registry login uses GitLab's predefined CI_REGISTRY, CI_REGISTRY_USER and
# CI_REGISTRY_PASSWORD, so no CI/CD variables need to be configured. The
# project's Container registry must be enabled (Settings > General > Visibility).

stages:
  - lint
@@ -44,13 +41,10 @@ publish:
  script:
    # helm package rejects a non-SemVer version, which fails the job.
    - VERSION="${CI_COMMIT_TAG#v}"
    - echo "Publishing chart chronos:${VERSION}"
    # Same registry auth file as the Kaniko jobs; avoids `helm registry login` over plain HTTP.
    - export HELM_REGISTRY_CONFIG="${CI_PROJECT_DIR}/.helm-registry.json"
    - >-
      echo "{\"auths\":{\"${HARBOR_REGISTRY}\":{\"auth\":\"$(printf '%s:%s' "${HARBOR_ROBOT_USER}" "${HARBOR_ROBOT_TOKEN}" | base64 | tr -d '\n')\"}}}" > "$HELM_REGISTRY_CONFIG"
    - echo "Publishing chart chronos:${VERSION} to oci://${CI_REGISTRY_IMAGE}"
    - echo "${CI_REGISTRY_PASSWORD}" | helm registry login "${CI_REGISTRY}" -u "${CI_REGISTRY_USER}" --password-stdin
    - helm package "$CHART_DIR" --version "$VERSION" -d dist
    - helm push "dist/chronos-${VERSION}.tgz" "oci://${HARBOR_REGISTRY}/${HARBOR_PROJECT}" --plain-http
    - helm push "dist/chronos-${VERSION}.tgz" "oci://${CI_REGISTRY_IMAGE}"
  artifacts:
    paths:
      - dist/*.tgz
+18 −19
Changes for README.md: 18 added lines, 19 removed lines.
Original line number Diff line number Diff line
@@ -86,36 +86,37 @@ in another namespace, its listener must allow routes from Chronos's namespace

## Prerequisites

- Kubernetes 1.23+, Helm 3.13+ (for `--plain-http` with the Harbor registry),
- Kubernetes 1.23+, Helm 3.8+ (OCI registry support),
  ingress-nginx or a Gateway API implementation.
- An OpenSlice release (`org.etsi.osl.main/kubernetes/helm/openslice`) in the
  same namespace. The defaults assume it is named `openslice`; otherwise override
  `artemis.url`, `artemis.existingSecret`, `keycloak.internalUrl` and
  `keycloak.bootstrap.adminSecret`. For an install in **another namespace** see
  [Installing in its own namespace](#installing-in-its-own-namespace).
- The Chronos images. The GitLab CI of both repos pushes them to Harbor on every
  Git tag as `${HARBOR_REGISTRY}/${HARBOR_PROJECT}/org.etsi.osl.chronos[.ui]:<tag>`
  and `:latest`. The chart defaults to
  `harbor.intranet.pnet/osl-staging/...:latest`. Set `imagePullSecrets` if the
- The Chronos images. The GitLab CI of both repos pushes them on every Git tag to
  their project's container registry on labs.etsi.org, as
  `labs.etsi.org:5050/osl/code/addons/chronos/org.etsi.osl.chronos[.ui]:<tag>`
  and `:latest`. The chart defaults to `...:latest`. Set `imagePullSecrets` if the
  registry needs credentials.

## Install

### From Harbor (released chart)
### From the GitLab registry (released chart)

Each Git tag `vX.Y.Z` of this repo publishes the chart as an OCI artifact,
`oci://harbor.intranet.pnet/osl-staging/chronos:X.Y.Z` (see [Releasing](#releasing)).
Harbor serves plain HTTP, so every command needs `--plain-http`.
`oci://labs.etsi.org:5050/osl/code/addons/chronos/org.etsi.osl.chronos.deploy/chronos:X.Y.Z`
(see [Releasing](#releasing)).

```bash
# Only if the Harbor project is private:
helm registry login harbor.intranet.pnet --insecure -u <user>
CHART=oci://labs.etsi.org:5050/osl/code/addons/chronos/org.etsi.osl.chronos.deploy/chronos

helm show values oci://harbor.intranet.pnet/osl-staging/chronos --version 0.2.0 --plain-http > my-values.yaml
# Only if the project's registry is private (use a token with read_registry):
helm registry login labs.etsi.org:5050 -u <user>

helm show values "$CHART" --version 0.2.0 > my-values.yaml
# edit: global.rootUrl (same as OpenSlice's rooturl), image tags, MySQL passwords

helm install chronos oci://harbor.intranet.pnet/osl-staging/chronos --version 0.2.0 \
  --plain-http -n openslice -f my-values.yaml
helm install chronos "$CHART" --version 0.2.0 -n openslice -f my-values.yaml
```

Upgrade the same way with `helm upgrade`, using the new `--version`.
@@ -241,15 +242,13 @@ helm template chronos helm/chronos --set ingress.enabled=false --set httpRoute.e

The GitLab pipeline (`.gitlab-ci.yml`) lints the chart on every push. A Git tag
`vX.Y.Z` (or `X.Y.Z`) packages it as chart version `X.Y.Z` and pushes it to
`oci://${HARBOR_REGISTRY}/${HARBOR_PROJECT}/chronos`. The tag sets the version,
this project's container registry, `oci://${CI_REGISTRY_IMAGE}/chronos`. The tag sets the version,
so `Chart.yaml`'s `version` is only used for local builds.

1. Bump `appVersion` in `Chart.yaml` if the chart should now describe a newer
   Chronos release, and `version` to match the tag you are about to create.
2. `git tag v0.2.0 && git push origin v0.2.0`

The pipeline uses the `openslice` group variables `HARBOR_REGISTRY`,
`HARBOR_PROJECT`, `HARBOR_ROBOT_USER` and `HARBOR_ROBOT_TOKEN`, the same as the
image pipelines. The robot variables are Protected, so the `v*` tag pattern must be
protected in this project (Settings → Repository → Protected tags). Re-pushing
the same version overwrites the artifact in Harbor.
The pipeline logs in with GitLab's predefined `CI_REGISTRY_USER` /
`CI_REGISTRY_PASSWORD`, so no CI/CD variables are needed; the project's Container
registry must be enabled. Re-pushing the same version overwrites the artifact.
+3 −3
Changes for helm/chronos/values.yaml: 3 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -18,12 +18,12 @@ nameOverride: ""
fullnameOverride: ""

imagePullSecrets: []
#  - name: harbor-pull-secret
#  - name: registry-pull-secret

# ── Backend (Spring Boot, port 8888) ────────────────────────────────────────
backend:
  image:
    repository: harbor.intranet.pnet/osl-staging/org.etsi.osl.chronos
    repository: labs.etsi.org:5050/osl/code/addons/chronos/org.etsi.osl.chronos
    # Defaults to the chart appVersion when empty.
    tag: "latest"
    pullPolicy: Always
@@ -79,7 +79,7 @@ backend:
ui:
  enabled: true
  image:
    repository: harbor.intranet.pnet/osl-staging/org.etsi.osl.chronos.ui
    repository: labs.etsi.org:5050/osl/code/addons/chronos/org.etsi.osl.chronos.ui
    tag: "latest"
    pullPolicy: Always
  # Tenant time zone shown in the UI (IANA name).