Add Helm chart build and publishing to Gitea workflows

- Added Helm chart build job to main CI/CD workflow
- Created dedicated helm-release workflow for version tags
- Integrated Helm packaging with Gitea package registry
- Added automatic chart versioning and publishing
- Updated README with Helm deployment instructions
- Configured chart linting and validation steps
- Added release automation for tagged versions
This commit is contained in:
d.viti
2025-10-03 01:56:36 +02:00
parent ceee0dcff8
commit d818ee6600
3 changed files with 273 additions and 4 deletions

View File

@@ -93,18 +93,24 @@ The `.gitea/workflows/build.yml` pipeline automatically:
1. Builds Docker images for both applications
2. Pushes to Gitea container registry
3. Tags images with branch name
4. Implements layer caching for faster builds
4. Packages and publishes Helm chart
5. Implements layer caching for faster builds
**Triggers:**
- Any branch push
- Any branch push (Docker images)
- Push to main branch (Helm chart)
- Version tags (Helm releases)
- Manual dispatch
**Registry:** `git.commandware.com/demos/api7-demo`
**Images:**
**Docker Images:**
- `git.commandware.com/demos/api7-demo/web:<branch-name>`
- `git.commandware.com/demos/api7-demo/api:<branch-name>`
**Helm Repository:**
- `https://git.commandware.com/api/packages/$OWNER/helm`
### Setup
1. **Create `GITEA_TOKEN` secret:**
@@ -123,10 +129,62 @@ The `.gitea/workflows/build.yml` pipeline automatically:
### Prerequisites
- Kubernetes cluster (v1.19+)
- Helm 3.8.0+
- API7 Enterprise Gateway installed
- Namespace: `api7ee`
### Deployment Manifest
### Deploy with Helm
The project includes a complete Helm chart for easy deployment of both web and API components.
#### Add Helm Repository
```bash
# Add the Gitea Helm repository
helm repo add api7ee https://git.commandware.com/api/packages/$OWNER/helm
helm repo update
```
#### Install the Chart
```bash
# Install with default values
helm install my-api7ee api7ee/api7ee --namespace api7ee --create-namespace
# Install with custom values
helm install my-api7ee api7ee/api7ee -f custom-values.yaml --namespace api7ee
# Install with specific image tags
helm install my-api7ee api7ee/api7ee \
--set web.image.tag=v1.0.0 \
--set api.image.tag=v1.0.0 \
--namespace api7ee
```
#### Configuration Options
Key Helm values:
| Parameter | Description | Default |
|-----------|-------------|---------|
| `web.enabled` | Enable Web component | `true` |
| `web.replicaCount` | Number of Web replicas | `2` |
| `api.enabled` | Enable API component | `true` |
| `api.replicaCount` | Number of API replicas | `3` |
| `ingress.enabled` | Enable ingress | `true` |
| `ingress.hosts[0].host` | Ingress hostname | `demo.commandware.it` |
#### Upgrade/Uninstall
```bash
# Upgrade the release
helm upgrade my-api7ee api7ee/api7ee --namespace api7ee
# Uninstall
helm uninstall my-api7ee --namespace api7ee
```
### Manual Deployment (Alternative)
**k8s-deployments.yaml:**
```yaml