Local Podman
This method is supported by R2DevOps community.
This page describes how to quickly setup a self-managed instance of R2Devops for testing purposes using podman on your local computer. This is not suitable for production
See production ready methods on Home page
During the analysis, no data leaves your environment, ensuring the confidentiality and security of your information.
💻 Requirements
- GitLab instance version >=17.7
- Git
- podman
- Docker hub registry must be resolved by podman in file /etc/containers/registries.conf
unqualified-search-registries = ["docker.io"]
🦊 GitLab Application
- On your GitLab instance, open the
Applicationspage:Your picture > Preferences > Applications(example: gitlab.com) - Create an application with the following information :
- Name:
R2Devops self-managed - Redirect URI :
http://localhost:3001/api/auth/gitlab/callback - Confidential:
true(let the box checked) - Scopes:
api
- Name:
- Click on
Save Applicationand you should see the following screen:
- Keep this GitLab tab open, the
Application IDandSecretwill be used in the configuration step
📥 Setup your environment
- Clone the repository locally
git clone https://github.com/r2devops/self-managed.git r2devops
cd r2devops - Create your configuration file
cp .env.local.example .env
📚 Update the configuration
-
Edit the
.envfile:-
Copy/paste the
Application IDand theSecretfrom the GitLab application you just created.envGITLAB_OAUTH2_CLIENT_ID="<application-id>"
GITLAB_OAUTH2_CLIENT_SECRET="<application-secret>" -
Replace
<your-gitlab-url>by domain of your GitLab server.envJOBS_GITLAB_URL="https://<your-gitlab-url>" -
Only if you use a SaaS version of GitLab (like
gitlab.com): add the name of your top-level group inORGANIZATIONvariable (else, let it empty).envORGANIZATION="<top-level-group-path>"
-
-
Run the following commands to generate random secrets for all components:
sed -i "s/REPLACE_ME_BY_SECRET_KEY/$(openssl rand -hex 32)/g" .env
sed -i "s/REPLACE_ME_BY_JOBS_DB_PASSWORD/$(openssl rand -hex 16)/g" .env
sed -i "s/REPLACE_ME_BY_JOBS_REDIS_PASSWORD/$(openssl rand -hex 16)/g" .env
📄 Prepare podman for launch
Generate podman network:
podman network create intranet
Generate podman socket
systemctl --user start podman.socket
systemctl --user enable podman.socket
Generate podman config files:
set -a; source .env; set +a
export uid=$(id -u)
envsubst < podman.local.yml.example > podman.yml
envsubst < configmap.local.yml.example > configmap.yml
🚀 Launch R2Devops!
- Start R2Devops
podman play kube podman.yml --configmap configmap.yml --network intranet - Open your R2Devops test instance 👉 click here 🎉
⏫ Update R2Devops
Follow these steps to update your self-managed instance to a new version:
- Navigate to the location of your
self-managedgit repository - Update it
git pull - Open the
.env.local.examplefile and copy the values ofFRONTEND_IMAGE_TAGandBACKEND_IMAGE_TAGvariables - Edit the
.envfile by updating values ofFRONTEND_IMAGE_TAGandBACKEND_IMAGE_TAGvariables with the values previously copied.envFRONTEND_IMAGE_TAG="<new frontend version>"
BACKEND_IMAGE_TAG="<new backend version>" - Update local yaml files
set -a; source .env; set +a
export uid=$(id -u)
envsubst < podman.local.yml.example > podman.yml
envsubst < configmap.local.yml.example > configmap.yml - Restart your containers
podman play kube podman.yml --replace --configmap configmap.yml --network intranet - You have successfully updated R2Devops on your server 🎉