CloudOps for Kubernetes Extensions Framework Architecture
Architecture
ConfigMap Architecture
The main resource for the Extensions framework is a single Kubernetes ConfigMap. This extensions-config
ConfigMap in the default
Kubernetes namespace that contains all information required for CloudOps for Kubernetes consumes any properly configured Extensions repository.
An example of the extensions-config
ConfigMap:
apiVersion: v1
data:
extensions-config.json: '{"extensions_repos": {"monitoring-extras": {"extensions_name":
"monitoring-extras", "repo_url": "git@gitlab.elasticpath.com:commerce/cloud-ops-kubernetes-extras-monitoring.git",
"default_branch": "main", "bootstrap_dsl_groovy_path": "jenkins/jobs/bootstrap/bootstrap.groovy"}}}'
...
kind: ConfigMap
The following sections describe four configuration values for an extensions repository:
extensions_name
This is a string identifier that identifies the overall subject or topic that the jobs contained in the repository are focused on.
This field is derived from the extensionsName
file in the root directory of the Git repository.
repo_url
The URL to your Extensions Git repository.
default_branch
Use the branch of the Extensions Git repository while running the different jobs included in the repository. If you want to change the branch, this can be configured to a different branch after the ConfigMap is initially setup. For more information on the configuration of the data stored in the ConfigMap, see here
bootstrap_dsl_groovy_path
This is the path to the bootstrap.groovy
script in the Extensions Git repository that stores the Jenkins groovy setup operations for the different jobs written in the repository.
The default value is jenkins/jobs/bootstrap/bootstrap.groovy
.
Jenkins Layout
There is a central Extensions view in Jenkins for the Extensions framework that only contains two jobs. The following example shows an Extensions
view layout:
Extensions/
import-or-delete-extensions-repository
setup-known-extensions
For more information on the import-or-delete-extensions-repository
Jenkins job, see here.
The setup-known-extensions
Jenkins job executes the .groovy
files that are currently configured in the bootstrap_dsl_groovy_path
variables in the extensions-config
ConfigMap.
Run the setup-known-extensions
Jenkins job functionality each time when the import-or-delete-extensions-repository
Jenkins job runs, but it can also be separately triggered.
Once an Extensions repository is imported successfully, then a repository-specific view is created to store all of the jobs enabled for the extensions repository, as well as the setup and configuration jobs dedicated to the extensions repository.
For example, the Extensions repository contains an extensionsName
file with the string monitoring-extras
.
The following example shows an Extensions repository view layout:
monitoring-extras/
configure-monitoring-extras
monitoring-extras-job-1
setup-monitoring-extras
For information on the configure-monitoring-${extensionsName}
Jenkins job, see here.