Deploy RPM Packages
KubeRocketCI can use two types of deployment packages: Helm chart and RPM packages. While the Helm chart is the default deployment package in KubeRocketCI, using RPM packages is beneficial for specific Linux distributions, such as Oracle, Fedora, openSUSE, and others where these packages are supported and widespread. To learn more about RPM packages, refer to the official documentation.
In KubeRocketCI, RPM support allows to collect applications, store them as Nexus artifacts, and deploy them using the Ansible tool. KubeRocketCI is support two approach to work with RPM packages:
- Default approach: This approach involves configuring deployments using a GitOps repository and Kubernetes secrets.
- AWX approach: This approach involves deploying applications using the AWX tool.
Features of Each Approachβ
Built-in Pipelineβ
- Full GitOps Configuration: All resources, including roles, inventories, hosts, tasks, and instance keys, are fully managed via GitOps.
- Quick Start: Enables a fast setup process without the need for third-party utilities.
- Scalable: Easily scales to accommodate an increasing number of tasks.
- Customizable Task Execution: Offers flexible configuration of task execution sequences.
- No UI: Operates entirely without a graphical user interface, relying on code-based configurations.
AWX Operatorβ
- User-Friendly Interface: Features a convenient UI for managing configurations and tasks.
- Partial Code-Based Configurations: Retrieves some configurations (such as Ansible tasks) directly from the repository.
- UI-Based Configuration: All configurations are performed within the graphical user interface.
Default Approachβ
The first method to delivery RPM packages is using KubeRocketCI RPM deploy pipeline.
Integration Flowβ
Default approach involves the following steps:
Here is a breakdown of the scheme above:
- Onboard GitOps repository: GitOps repository is used to store pre-deploy information (such as dependencies) and Ansible configuration.
- Create secret for GitOps repository: A secret providing access to the GitOps repository.
- Create secret for Ansible host's: This is a secret used by Ansible to manage the instances where the application will be deployed.
- Create application: Add application to KubeRocketCI as an RPM package.
- Select deploy pipeline: Choose a specific deploy pipeline when creating/editing an environment to deploy RPM packages.
By completing these steps, will be able to add, build, and deploy RPM applications.
To set up RPM integration, follow the steps below:
- Open the KubeRocketCI portal. Navigate to Configuration -> Deployment -> GitOps:
- Specify the GitOps repository in the
username/repository_name
format:
- Create and apply the secret for the GitOps repository by running the command below. Specify SSH key path, Git account, and repository name:
kubectl apply -f - <<EOF
apiVersion: v1
kind: Secret
metadata:
name: cd-ansible-gitops-key
namespace: <krci>
data:
id_rsa: $(cat /path/to/repo_id_rsa | base64 | tr -d '\n')
url: $(echo -n "git@github.com:edp-robot/ansible-gitops.git" | base64 | tr -d '\n')
type: Opaque
EOF
- Create and apply the secret for the hosts by running the command below. Don't forget to specify SSH key path:
kubectl apply -f - <<EOF
apiVersion: v1
kind: Secret
metadata:
name: cd-ansible-ssh-key
namespace: <krci>
data:
id_rsa: $(cat /path/to/instance_id_rsa | base64 | tr -d '\n')
type: Opaque
EOF
- When creating codebases, in the Deployment option field, select the rpm-package option:
- When creating or editing environments, in the Deploy pipeline template field, select deploy-ansible:
The pre-deploy.yml file will take affect only if the Values override option is enabled when deploying application.
GitOps Repository Structureβ
Below is a structure of a GitOps repository designed for deploying RPM packages:
View: repository structure
nexus.repo
inventory.ini
pre-deploy.yml
βββ web
β βββ dev
β β βββ nano
β β β βββ 01_playbook.yml
β β β βββ 02_playbook.yml
β β βββ atop
β β βββ 01_playbook.yml
β β βββ 02_playbook.yml
β βββ qa
β β βββ nano
β β β βββ 01_playbook.yml
β β β βββ 02_playbook.yml
β β βββ atop