This is the Experimental version (Latest). It is under active development and may change. For the most reliable documentation, use the version selector in the top-right to switch to Stable, or click here to go to the Stable version's homepage.
Opstella Core (Back-end) Additional Resources Installation
Last updated:
There’re resources used by Opstella that will be stored in Kubernetes ConfigMap which managable by you (intentionally) and often requires customisation from you.
Opstella-managed GitLab Runner Deployment Template Customization
Section titled “Opstella-managed GitLab Runner Deployment Template Customization”Opstella will deploy and register GitLab Runner for you on 🟢 Management Kubernetes Cluster once Opstella is fully configured.
This deployment template is stored as Kuberntes ConfigMap and allow for customisation and flexibility on any envionment that YOU may want to add or adjust.
-
Create a copy of GitLab Deployment Template from
assetsdirectory.Terminal window cp $BASE_WORKING_DIR/assets/kubernetes-manifests/opstella-core-gitlab-runner.go.tpl.yaml \$BASE_WORKING_DIR/opstella-configs/opstella-core-gitlab-runner.go.tpl.yaml -
You MAY EDIT the copied GitLab Deployment Template. (You may use Text Editor of your choice.)
Terminal window vim $BASE_WORKING_DIR/opstella-configs/opstella-core-gitlab-runner.go.tpl.yamlOR Follow along if you decided using Text Editor is too hard for you.
GitLab Runner use S3 API-compatible Object Storage as its Runner Caches
Section titled “GitLab Runner use S3 API-compatible Object Storage as its Runner Caches”Prerequisites
- 🔑 Credentials to Access S3 Bucket: Access Key, Secret Key
- These credentials should be from the ones you defined in the SeaweedFS (HA) Installation guide (specifically
SEAWEEDFS_HA_S3_GITLAB_CI_PASSWORDas the secret andgitlab-cias the access key).
- These credentials should be from the ones you defined in the SeaweedFS (HA) Installation guide (specifically
-
Set S3(-compatible) Storage Connection
- S3 Domain:
${SEAWEEDFS_HA_API_DOMAIN} - S3 Bucket Name:
gitlab-ci-caches - S3 Bucket Region:
us-east-1 - S3 Access Key:
gitlab-ci - S3 Secret Key:
CHANGEME; Use the value ofSEAWEEDFS_HA_S3_GITLAB_CI_PASSWORD
(Ensure these S3 GitLab Runners variables are exported from your shell values)
- S3 Domain:
-
Create Kubernetes Secret named
gitlab-runners-s3-accessthat store Credentials for GitLab Runner to Access S3 Bucket onopstella-shared-runnerNamespaceConnect to
🟢 ManagementKubernetes Cluster ; i.e w/ Kubeconfig FileEnsure you have defined and loaded your Global Shell Variables as described in Shell Variables.
Terminal window source $BASE_WORKING_DIR/shell-values/kubernetes/management_cluster.vars.shEnsure
BASE_DOMAIN,HARBOR_DOMAIN,MIRROR_REGISTRY_PATHare defined as per the Shell Variables guide.Terminal window kubectl create secret generic gitlab-runners-s3-access \--namespace opstella-shared-runner \--from-literal=accesskey=gitlab-ci \--from-literal=secretkey=${SEAWEEDFS_HA_S3_GITLAB_CI_PASSWORD} -
Edit GitLab Deployment Template, Go to
ConfigMapsection... (deducted)apiVersion: v1kind: ConfigMapmetadata:name: {{ .Name }}labels:app: {{ .Name }}... (deducted)data:config.template.toml: |[[runners]]clone_url = "{{ .GitlabServer }}"[runners.cache]Type = "s3"Shared = true[runners.cache.s3]ServerAddress = "${SEAWEEDFS_HA_API_DOMAIN}"BucketName = "gitlab-ci-caches"BucketLocation = "us-east-1"AuthenticationType = "access-key"... (deducted)Edit the file by the following
[runners.cache.s3]section, to configure Runners to use S3 API-compatible Object Storage.- Edit
ServerAddressfor SeaweedFS API Domain${SEAWEEDFS_HA_API_DOMAIN} - Edit
BucketNamefor Bucket Namegitlab-ci-caches; Leave Default - Edit
BucketLocationfor Bucket Regionus-east-1; Leave Default
- Edit
Or Simply run this.
Terminal window sed -i "s@\${OPSTELLA_MANAGED_GITLAB_RUNNERS_S3_DOMAIN}@$SEAWEEDFS_HA_API_DOMAIN@g" \$BASE_WORKING_DIR/opstella-configs/opstella-core-gitlab-runner.go.tpl.yamlTerminal window sed -i "s@\${OPSTELLA_MANAGED_GITLAB_RUNNERS_S3_BUCKET_NAME}@gitlab-ci-caches@g" \$BASE_WORKING_DIR/opstella-configs/opstella-core-gitlab-runner.go.tpl.yamlTerminal window sed -i "s@\${OPSTELLA_MANAGED_GITLAB_RUNNERS_S3_BUCKET_REGION}@us-east-1@g" \$BASE_WORKING_DIR/opstella-configs/opstella-core-gitlab-runner.go.tpl.yaml -
Go to
Deploymentsection, Add extra volume from Kubernetes Secretgitlab-runners-s3-accessto existingprojected-secretsvolume.... (deducted)apiVersion: apps/v1kind: Deploymentmetadata:... (deducted)spec:... (deducted)template:... (deducted)volumes:... (deducted)- name: projected-secretsprojected:sources:### ADD THIS IF NOT EXIST ###- secret:name: gitlab-runners-s3-accessoptional: true### ADD THIS IF NOT EXIST ###- secret:... (deducted)
GitLab Runner with imagePullSecrets to Pull Artifacts from a Registry
Section titled “GitLab Runner with imagePullSecrets to Pull Artifacts from a Registry”Prerequisites
- 🔑 Credentials to Access Registry: Harbor Robot Account
- Harbor Domain: Use
HARBOR_DOMAINfrom the Shell Variables guide. - Username:
robot$opstella-gitlab-runners - Password:
CHANGEME; Change to the one you retrieved once you created Robot Account
- Harbor Domain: Use
-
Store Pull Credentials as Kubernetes Secret
Replace
HARBOR_ROBOT_GITLAB_USERandHARBOR_ROBOT_GITLAB_PASSWORDwith your Harbor Robot Account username and password.Terminal window # Create .dockerconfig JSON filekubectl create secret docker-registry gitlab-runners-harbor-pullsecret -n opstella-shared-runner \--docker-server=${HARBOR_DOMAIN} \--docker-username=HARBOR_ROBOT_GITLAB_USER \--docker-password=HARBOR_ROBOT_GITLAB_PASSWORD -
Edit GitLab Deployment Template, Go to
ConfigMapsection... (deducted)apiVersion: v1kind: ConfigMapmetadata:name: {{ .Name }}labels:app: {{ .Name }}... (deducted)data:config.template.toml: |[[runners]]clone_url = "{{ .GitlabServer }}"[runners.cache]Type = "s3"Shared = true[runners.cache.s3]... (deducted)[runners.kubernetes]namespace = "{{ .Namespace }}"image = "ubuntu:24.04"### ADD THIS ###image_pull_secrets = ['gitlab-runners-harbor-pullsecret']### ADD THIS ###... (deducted)Edit the file by the following
[runners.kubernetes]section- Add
image_pull_secrets = ['gitlab-runners-harbor-pullsecret']for the imagePullSecrets that you have created.
- Add
Or Simply run this.
Terminal window sed -i "s#\${OPSTELLA_MANAGED_GITLAB_RUNNERS_IMAGEPULLSECRET_TOML}#image_pull_secrets = ['gitlab-runners-harbor-pullsecret']#g" \$BASE_WORKING_DIR/opstella-configs/opstella-core-gitlab-runner.go.tpl.yaml
Extra Opstella-managed GitLab CI/CD Variables
Section titled “Extra Opstella-managed GitLab CI/CD Variables”Opstella will managed certain pre-defined CI/CD Variables and Extra CI/CD Variables are needed to be create once you start using Opstella.
- Mirrored Container Image Registry Path
- On Harbor, you have been setup Proxy Cache Project for mirroring Container Images.
- This CI/CD variable will allow to patch in CI/CD Runtime.
cat $BASE_WORKING_DIR/assets/kubernetes-manifests/opstella-core-gitlab-variables.tpl.yaml \ | sed "s@\${MIRROR_REGISTRY_PATH}@$HARBOR_DOMAIN/mirror-@g" \ > $BASE_WORKING_DIR/opstella-configs/opstella-core-gitlab-variables.yamlCreate Kubernetes ConfigMap
Section titled “Create Kubernetes ConfigMap”-
Connect to
🟢 ManagementKubernetes Cluster ; i.e w/ Kubeconfig FileEnsure you have defined and loaded your Global Shell Variables as described in Shell Variables.
Terminal window source $BASE_WORKING_DIR/shell-values/kubernetes/management_cluster.vars.shEnsure
BASE_DOMAINis defined as per the Shell Variables guide. -
Create Kubernetes ConfigMap named
opstella-core-gitlab-configsinopstella-systemNamespaceTerminal window kubectl create configmap opstella-core-gitlab-configs --namespace opstella-system \--from-file=gitlab-runner-template.yaml=$BASE_WORKING_DIR/opstella-configs/opstella-core-gitlab-runner.go.tpl.yaml \--from-file=variables.yaml=$BASE_WORKING_DIR/opstella-configs/opstella-core-gitlab-variables.yaml
Finished?
Use the below navigation to proceed