Skip to content

Demo: Deploying application server with migration and sidekiq

Lucas Li requested to merge demo-migration-app-job into main

What does this MR do?

This MR demonstrates running database migration and deploying application server & job processor.

It defaults the instance name to operator-v2-dev-kit, and namespace to gitlab-operator-v2-system

Besides the dev kit scripts update, it contains following fixes:

  • fix job processor template
  • fix database migration secret reference
  • enable sidekiq liveness probe

Needs to be cherry-picked into the main branch:

Needs to be refactored:

To run the demo

Similar to !25 (closed)

Some prerequisite:

  • a k8s cluster
  • a default ingress class

Step 1 - Prepare stateful components and secrets

It will install stateful components and initialize secrets for later use.

No need to run the copy_secrets

# Checkout the source from this branch
git clone -b demo-migration-app-job https://gitlab.com/gitlab-org/cloud-native/operator.git

./scripts/development-kit/start.sh

Step 2 - Install CRD

# This is the image tag for the PoC
TAG='demo-migration-app-job'

make build \
  deploy \
  TAG="${TAG}"

# Check GitLab CRD and Operator's controller-manager logs
kubectl api-resources | grep gitlab

stern -n gitlab-operator-v2-system -c manager controller-manager

Step 3 - Install GitLab CR

Use the example CR.

kubectl apply -f scripts/development-kit/gitlab.yaml -n gitlab-operator-v2-system

# Check Operator's controller-manager logs
stern -n gitlab-operator-v2-system -c manager controller-manager

# wait a few minutes for the application server to get ready
kubectl rollout status deployments -n gitlab-operator-v2-system -l app.kubernetes.io/name=operator-v2-dev-kit --timeout=300s
# then it should be accessible from the ingress
kubectl get ingress -n gitlab-operator-v2-system

# or the service
kubectl port-forward services/operator-v2-dev-kit-application-server 8181:8181 -n gitlab-operator-v2-system

# use the initial root password to login
kubectl -n gitlab-operator-v2-system get secret operator-v2-dev-kit-initial-root-password -o jsonpath="{.data.password}" | base64 -d

Author's Checklist

For anything in this list which will not be completed, please provide a reason in the MR discussion.

Required

  • Ensure a release milestone is set.
  • MR title and description are up to date, accurate, and descriptive.
  • MR targeting the appropriate branch.
  • MR has a green pipeline on GitLab.com.
  • When ready for review, MR is labeled workflowready for review per the MR workflow.

Expected

  • Test plan indicating conditions for success has been posted and passes.
  • Documentation is created or updated.
  • Tests are added.

Related issues

Closes #10 (closed)

Edited by Hossein Pursultani

Merge request reports