74 lines
2.4 KiB
Markdown
74 lines
2.4 KiB
Markdown
|
|
# Deploy guide (nelm + Jenkins, no werf)
|
|||
|
|
|
|||
|
|
Charts live under each Bitbucket repo’s `.helm/`. Jenkins **clones those repos on every job** — it does not deploy from a hand-copied folder on disk.
|
|||
|
|
|
|||
|
|
## Lab URLs
|
|||
|
|
|
|||
|
|
| What | URL / host | Creds |
|
|||
|
|
|------|------------|-------|
|
|||
|
|
| Bitbucket UI (Gitea) | https://bitbucket.valdemorte.online | `bbadmin` / `admin123` |
|
|||
|
|
| Jenkins | https://jenkins.valdemorte.online | `admin` / `admin123` |
|
|||
|
|
| Compose | `ubuntu@192.168.10.68:~/ci-stack` | — |
|
|||
|
|
|
|||
|
|
Repos: `bbadmin/{postgres,seaweedfs,ollama,keycloak,vllm}`. Job: **`nelm-deploy`**. Contexts: `lab-cluster-{dev,preprod,prod}`.
|
|||
|
|
|
|||
|
|
## How Jenkins gets the code
|
|||
|
|
|
|||
|
|
1. Parameters include `GIT_BASE_URL` (default `http://192.168.10.68:7990/bbadmin`) and `GIT_BRANCH` (`main`).
|
|||
|
|
2. Job runs `jenkins/checkout-repos.sh` → fresh clone into `$WORKSPACE/repos/<service>`.
|
|||
|
|
3. Build/deploy use **only** that checkout (`.helm/`, `Dockerfile`).
|
|||
|
|
|
|||
|
|
Agent still holds non-git secrets/tools only:
|
|||
|
|
|
|||
|
|
- `~/nelm-work/.nelm_secret_key`
|
|||
|
|
- `~/nelm-work/.git_user` + `.git_token`
|
|||
|
|
- `~/kube-deploy.config`
|
|||
|
|
- `~/nelm-work/jenkins/checkout-repos.sh` (CI helper; prefer keeping the same scripts in a `nelm-ci` Bitbucket repo in production)
|
|||
|
|
|
|||
|
|
See **`CLIENT-SETUP.ru.md`** for client rollout and **`NELM-CLOSED-LOOP.ru.md`** for closed-loop chart/Dockerfile changes.
|
|||
|
|
|
|||
|
|
## Tools on the agent
|
|||
|
|
|
|||
|
|
```bash
|
|||
|
|
export NELM_SECRET_KEY=$(cat ~/nelm-work/.nelm_secret_key)
|
|||
|
|
export PATH="$HOME/bin:$PATH"
|
|||
|
|
export KUBECONFIG=$HOME/kube-deploy.config
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
## Images
|
|||
|
|
|
|||
|
|
- Default `values.yaml` → internal registry (`192.168.10.68:5000/...` in lab).
|
|||
|
|
- Lab smoke test: job flag `USE_PUBLIC_IMAGES=true` → `values-public.yaml`.
|
|||
|
|
- Client closed loop: `USE_PUBLIC_IMAGES=false`.
|
|||
|
|
|
|||
|
|
## Deploy SA
|
|||
|
|
|
|||
|
|
```bash
|
|||
|
|
./create-deploy-sa.sh
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
## Manual deploy (after git clone)
|
|||
|
|
|
|||
|
|
```bash
|
|||
|
|
git clone http://192.168.10.68:7990/bbadmin/postgres.git
|
|||
|
|
export NELM_SECRET_KEY=$(cat .nelm_secret_key)
|
|||
|
|
nelm release install -n dev -r postgres-dev \
|
|||
|
|
--set env=dev --set global.cluster=dev \
|
|||
|
|
--values postgres/.helm/values-public.yaml \
|
|||
|
|
postgres/.helm
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
## Jenkins parameters
|
|||
|
|
|
|||
|
|
| Parameter | Meaning |
|
|||
|
|
|-----------|---------|
|
|||
|
|
| `SERVICE` | postgres … vllm / all |
|
|||
|
|
| `ENV` | dev / preprod / prod |
|
|||
|
|
| `ACTION` | build / deploy / build-and-deploy |
|
|||
|
|
| `USE_PUBLIC_IMAGES` | lab overlay |
|
|||
|
|
| `GIT_BASE_URL` | Bitbucket project base |
|
|||
|
|
| `GIT_BRANCH` | branch to deploy |
|
|||
|
|
| `REGISTRY` | push target for build |
|
|||
|
|
|
|||
|
|
Pipeline sources: root `Jenkinsfile` + `jenkins/*.groovy` + `jenkins/checkout-repos.sh`.
|