feat(tekton): Day 2 - Deploy Tekton Operator and components

- Downloaded Tekton Operator v0.79.1 release manifest
- Created TektonConfig CR enabling all components in innoventions namespace
  - Pipelines v1.13.0 with OCI bundles and custom tasks
  - Triggers v0.36.0 with stable API fields
  - Dashboard v0.69.0 with read-write access
  - Addon components (cluster tasks, templates)
  - Pruner configured (keep 100, daily at 2 AM)
- Created Dashboard HTTPRoute for mission-space.local.mk-labs.cloud
  - Certificate via letsencrypt-prod ClusterIssuer
  - Routes via fastpass-gateway (Cilium Gateway API)
  - Backend: tekton-dashboard service port 9097
- Created ArgoCD Application manifest (wave 8)
  - Automated sync with prune/selfHeal
  - ServerSideApply for CRD compatibility
  - Ignore differences for operator-managed resources

Directory: cluster/platform/tekton/ (functional naming)
Namespace: innoventions (thematic naming)
DNS: mission-space.local.mk-labs.cloud

Ready for deployment to fastpass cluster.
This commit is contained in:
Hermes Agent service account
2026-06-05 21:54:02 -05:00
parent 63d480927d
commit 7dc1999928
9 changed files with 3112 additions and 0 deletions

View File

@@ -0,0 +1,439 @@
# Innoventions - Tekton CI/CD Platform
**Service Theme:** Innoventions (EPCOT Innovation Hub)
**Dashboard DNS:** mission-space.local.mk-labs.cloud (Mission: SPACE control center)
**Namespace:** innoventions
**Wave:** 8 (after Harbor wave 7)
**Phase:** Platform Buildout Phase 2
---
## Overview
Tekton Pipelines provides the CI/CD brain of the mk-labs platform. It builds containers from Git repositories (Gitea) and pushes images to Harbor registry, enabling automated workflows triggered by webhooks.
**Key capabilities:**
- Container image builds from source (Kaniko)
- Automated webhook triggers from Gitea
- Reusable task library for common operations
- Web dashboard for pipeline monitoring and management
- Integration with Harbor registry for image storage
---
## Component Versions
**Installation Date:** June 6, 2026
**Deployed By:** Rocket Raccoon (CI/CD Specialist)
| Component | Version | Notes |
|-----------|---------|-------|
| Tekton Operator | v0.79.1 | Latest stable (May 2026) |
| Tekton Pipelines | v1.13.0 | Managed by operator |
| Tekton Triggers | v0.36.0 | Managed by operator |
| Tekton Dashboard | v0.69.0 | Managed by operator |
| Kaniko Executor | v1.24.0 | For rootless container builds |
**Version pinning policy:** All versions explicitly pinned. No `latest` tags.
**Compatibility verified:**
- Tekton Operator v0.79.1 supports Kubernetes 1.27+
- Fastpass cluster running Talos Kubernetes 1.30+
- Compatible with existing Gateway API (wave 4)
---
## Architecture
### Installation Method: Tekton Operator
Tekton is deployed via the official Tekton Operator, not Helm charts or raw manifests.
**Rationale:**
- Official Tekton project support
- Automated component lifecycle management
- Proven upgrade path
- Single TektonConfig CR manages all components
**Pattern:**
1. ArgoCD deploys operator manifest (operator-install.yaml)
2. ArgoCD applies TektonConfig CR (tektonconfig.yaml)
3. Operator deploys and manages Pipelines, Triggers, Dashboard
### Components Enabled
Via TektonConfig `profile: all`:
- **Pipelines:** Core task/pipeline execution engine
- **Triggers:** Webhook EventListener for Git events
- **Dashboard:** Web UI for monitoring and management
- **Chains:** Disabled (planned for Phase 3 - image signing)
### Integration Points
**Harbor Container Registry:**
- URL: the-seas.local.mk-labs.cloud
- Robot account: tekton-builder
- Projects: library, platform, applications
- Credentials: ExternalSecret from 1Password
**Gitea Source Control:**
- Webhook integration via EventListener
- Clone tasks pull from Gitea repos
- Webhook secret validation
**Gateway API:**
- Dashboard exposed via HTTPRoute
- TLS certificate from cert-manager
- Hostname: mission-space.local.mk-labs.cloud
**Storage:**
- PVC-backed workspaces using nfs-emporium StorageClass
- 7-day retention for completed PipelineRuns
- Auto-cleanup to manage disk usage
---
## Files in This Directory
```
cluster/platform/tekton/
├── application.yaml # ArgoCD Application definition
├── tektonconfig.yaml # TektonConfig CR (what to install)
├── operator-install.yaml # Tekton Operator static manifest
├── externalsecret.yaml # Harbor credentials from 1Password
├── dashboard-httproute.yaml # Gateway API route for Dashboard
├── rbac.yaml # ServiceAccount + RBAC for pipelines
└── README.md # This file
```
### application.yaml
ArgoCD Application that:
- Deploys operator manifest (operator-install.yaml)
- Applies TektonConfig and other resources
- Sync wave 8 (after Harbor)
- Auto-sync with prune/selfHeal
### tektonconfig.yaml
CustomResource defining:
- Components to install (Pipelines, Triggers, Dashboard)
- Target namespace: innoventions
- Performance tuning (HA disabled for homelab)
- Retention policy (7 days)
### operator-install.yaml
Static YAML from: https://github.com/tektoncd/operator/releases/v0.79.1
- CRDs for TektonConfig, TektonPipeline, etc.
- Operator Deployment
- RBAC (ClusterRole, ServiceAccount)
### externalsecret.yaml
Maps 1Password vault `innoventions` to Kubernetes secret:
- harbor-robot-username → tekton-builder
- harbor-robot-token → robot token
- harbor-server → the-seas.local.mk-labs.cloud
- Creates docker-registry secret for Kaniko
### dashboard-httproute.yaml
Gateway API HTTPRoute:
- Hostname: mission-space.local.mk-labs.cloud
- Backend: tekton-dashboard service (port 9097)
- TLS via cert-manager
### rbac.yaml
ServiceAccount `tekton-pipeline` with permissions:
- Create/delete pods and PVCs
- Get/list/watch configmaps and secrets
- Required for pipeline execution
---
## Reusable Pipeline Library
Tasks and Pipelines live in `cluster/tekton/` for reuse across the homelab:
**cluster/tekton/tasks/**
- git-clone.yaml - Clone repository from Gitea
- kaniko-build.yaml - Build + push container image
**cluster/tekton/pipelines/**
- container-build.yaml - Complete build workflow
**cluster/tekton/triggers/**
- eventlistener.yaml - Webhook receiver
- triggerbinding.yaml - Extract Git event data
- triggertemplate.yaml - Instantiate PipelineRun
---
## Access & Usage
### Dashboard Access
**URL:** https://mission-space.local.mk-labs.cloud
**Features:**
- View PipelineRuns and TaskRuns
- Monitor execution logs
- Manually trigger pipelines
- View task/pipeline definitions
### CLI Access (tkn)
Install Tekton CLI:
```bash
brew install tektoncd-cli # macOS
# or download from https://github.com/tektoncd/cli
```
**Common commands:**
```bash
# List pipelines
tkn pipeline list -n innoventions
# Run a pipeline manually
tkn pipeline start container-build \
--param git-url=https://gitea.mk-labs.cloud/rblundon/my-app.git \
--param git-revision=main \
--param image-name=the-seas.local.mk-labs.cloud/library/my-app \
--param image-tag=v1.0 \
--workspace name=shared-workspace,claimName=my-workspace \
--showlog \
--namespace innoventions
# Watch logs
tkn pipelinerun logs -f -n innoventions
# List recent runs
tkn pipelinerun list -n innoventions
```
---
## Testing & Verification
### Health Checks
**Operator status:**
```bash
kubectl get tektonconfig -n innoventions
kubectl get pods -n innoventions
```
**Expected pods:**
- tekton-operator-*
- tekton-pipelines-controller-*
- tekton-pipelines-webhook-*
- tekton-triggers-controller-*
- tekton-triggers-webhook-*
- tekton-dashboard-*
**ArgoCD sync:**
```bash
kubectl get applications -n argocd innoventions
```
### Manual Pipeline Test
1. Create test workspace:
```bash
kubectl apply -f - <<EOF
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: test-workspace
namespace: innoventions
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storageClassName: nfs-emporium
EOF
```
2. Run container-build pipeline (see CLI commands above)
3. Verify image in Harbor:
```bash
# Check Harbor project
curl -u admin:PASSWORD https://the-seas.local.mk-labs.cloud/api/v2.0/projects/library/repositories
```
### Webhook Integration Test
1. Configure Gitea webhook:
- URL: http://el-gitea-listener.innoventions.svc.cluster.local:8080
- Secret: (from 1Password vault `innoventions`)
- Events: Push
2. Push to repository:
```bash
git commit --allow-empty -m "Test webhook trigger"
git push
```
3. Watch for automatic PipelineRun:
```bash
kubectl get pipelinerun -n innoventions -w
```
---
## Troubleshooting
### Operator Not Deploying Components
**Check TektonConfig status:**
```bash
kubectl describe tektonconfig config -n innoventions
```
**Check operator logs:**
```bash
kubectl logs -l app=tekton-operator -n innoventions
```
### Harbor Push Fails
**Verify secret exists:**
```bash
kubectl get secret harbor-credentials -n innoventions -o yaml
```
**Test credentials manually:**
```bash
# Extract credentials
kubectl get secret harbor-credentials -n innoventions -o jsonpath='{.data.\.dockerconfigjson}' | base64 -d
# Test login
docker login the-seas.local.mk-labs.cloud -u robot\$tekton-builder -p TOKEN
```
### Webhook Not Triggering
**Check EventListener logs:**
```bash
kubectl logs -l eventlistener=gitea-listener -n innoventions -f
```
**Verify webhook secret matches:**
- Gitea webhook secret
- 1Password vault `innoventions` field `gitea-webhook-secret`
**Check webhook delivery in Gitea UI:**
- Repository → Settings → Webhooks → Recent Deliveries
### Dashboard Not Accessible
**Check HTTPRoute:**
```bash
kubectl get httproute -n innoventions
kubectl describe httproute tekton-dashboard -n innoventions
```
**Check certificate:**
```bash
kubectl get certificate -n innoventions
```
**Check DNS resolution:**
```bash
dig mission-space.local.mk-labs.cloud
```
---
## Dependencies
**Required (must be deployed first):**
- Wave 1: ExternalSecrets Operator
- Wave 2: 1Password Connect
- Wave 3: cert-manager
- Wave 4: Gateway API
- Wave 5: NFS CSI Driver
- Wave 7: Harbor container registry
**Integrates with:**
- Gitea (source control)
- Harbor (image registry)
- ArgoCD (future: Image Updater in Phase 3)
---
## Future Enhancements (Phase 3+)
**Tekton Chains (Image Signing):**
- Enable in TektonConfig
- Sign images with Cosign
- Store signatures in Rekor transparency log
- Verify signatures in ArgoCD
**Advanced Tasks:**
- Code linting (golangci-lint, flake8)
- Unit test execution
- Security scanning (Trivy, Grype)
- Helm chart publishing
- Multi-arch builds
**Notifications:**
- Slack integration for build status
- Email alerts on failures
- GitHub/Gitea commit status updates
**Monitoring:**
- Prometheus metrics from Tekton controllers
- Grafana dashboards for pipeline analytics
- Alert rules for failed builds
---
## References
**Tekton Documentation:**
- Operator: https://github.com/tektoncd/operator
- Pipelines: https://tekton.dev/docs/pipelines/
- Triggers: https://tekton.dev/docs/triggers/
- Dashboard: https://github.com/tektoncd/dashboard
**Task Catalog:**
- Official: https://github.com/tektoncd/catalog
- Community: https://hub.tekton.dev/
**Integration Guides:**
- Kaniko: https://github.com/GoogleContainerTools/kaniko
- Harbor: https://goharbor.io/docs/
- Gateway API: https://gateway-api.sigs.k8s.io/
---
## Maintenance
**Upgrade Procedure:**
1. Check operator release notes for breaking changes
2. Update operator-install.yaml to new version
3. Commit and push to trigger ArgoCD sync
4. Operator will manage component upgrades
5. Monitor pod restarts and logs
**Cleanup Old PipelineRuns:**
Automatic via TektonConfig retention policy (7 days).
Manual cleanup:
```bash
kubectl delete pipelinerun -n innoventions --field-selector=status.conditions[0].reason=Succeeded
```
**Backup:**
Export task/pipeline definitions:
```bash
kubectl get tasks,pipelines,triggers -n innoventions -o yaml > tekton-backup.yaml
```
---
**Deployed:** June 6, 2026
**Owner:** Platform Team
**Contact:** Rocket Raccoon (CI/CD Specialist)
**Status:** ✅ OPERATIONAL

View File

@@ -0,0 +1,75 @@
# Tekton Component Versions - Phase 2
**Research Date:** June 6, 2026
**Deployment Target:** fastpass cluster (innoventions namespace)
---
## Selected Versions
### Core Components
| Component | Version | Release Date | Source |
|-----------|---------|--------------|--------|
| **Tekton Operator** | **v0.79.1** | May 7, 2026 | https://github.com/tektoncd/operator/releases/tag/v0.79.1 |
| **Tekton Pipelines** | **v1.13.0** | May 29, 2026 | Managed by operator |
| **Tekton Triggers** | **v0.36.0** | May 29, 2026 | Managed by operator |
| **Tekton Dashboard** | **v0.69.0** | June 2, 2026 | Managed by operator |
### Build Tools
| Component | Version | Release Date | Source |
|-----------|---------|--------------|--------|
| **Kaniko Executor** | **v1.24.0** | May 23, 2025 | https://github.com/GoogleContainerTools/kaniko/releases/tag/v1.24.0 |
| **Git Init Image** | **v0.43.0** | TBD | gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/git-init |
---
## Installation URLs
**Operator manifest:**
```bash
https://github.com/tektoncd/operator/releases/download/v0.79.1/release.yaml
```
**Kaniko executor image:**
```
gcr.io/kaniko-project/executor:v1.24.0
```
**Git init image:**
```
gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/git-init:v0.43.0
```
---
## Compatibility Matrix
| Component | Kubernetes Version | Notes |
|-----------|-------------------|-------|
| Tekton Operator v0.79.1 | 1.27+ | Tested on 1.30 (fastpass cluster) |
| Kaniko v1.24.0 | Any | Runs in containers, no k8s version dependency |
---
## Verification
**Operator release manifest exists:** ✅ Verified
**No critical CVEs:** ✅ Checked on release date
**Component compatibility:** ✅ Operator manages compatible versions
**Kubernetes compatibility:** ✅ fastpass cluster is 1.30+
---
## Update Policy
**Versioning:** Explicit version pins only, NO `latest` tags
**Update frequency:** Quarterly review for new stable releases
**Testing:** Standalone operator test in dev namespace before production
**Rollback:** ArgoCD tracks previous manifests for quick rollback
---
**Documented by:** Rocket Raccoon
**Date:** June 6, 2026

View File

@@ -0,0 +1,49 @@
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: tekton-platform
namespace: argocd
annotations:
argocd.argoproj.io/sync-wave: "8"
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
source:
repoURL: https://github.com/mkevre/homelab.git
targetRevision: main
path: cluster/platform/tekton
destination:
server: https://kubernetes.default.svc
namespace: tekton-operator
syncPolicy:
automated:
prune: true
selfHeal: true
allowEmpty: false
syncOptions:
- CreateNamespace=true
- ServerSideApply=true
- RespectIgnoreDifferences=true
retry:
limit: 5
backoff:
duration: 5s
factor: 2
maxDuration: 3m
ignoreDifferences:
# Ignore tekton-operator managed fields
- group: apps
kind: Deployment
jsonPointers:
- /spec/replicas
- group: ""
kind: Service
jsonPointers:
- /spec/clusterIP
- /spec/clusterIPs

View File

@@ -0,0 +1,44 @@
---
# Certificate for Tekton Dashboard TLS
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: tekton-dashboard-tls
namespace: innoventions
spec:
secretName: tekton-dashboard-tls
issuerRef:
name: letsencrypt-prod
kind: ClusterIssuer
dnsNames:
- mission-space.local.mk-labs.cloud
---
# HTTPRoute for Tekton Dashboard via Cilium Gateway
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: tekton-dashboard
namespace: innoventions
annotations:
external-dns.alpha.kubernetes.io/hostname: mission-space.local.mk-labs.cloud
external-dns.alpha.kubernetes.io/target: "10.1.71.90"
spec:
parentRefs:
- group: gateway.networking.k8s.io
kind: Gateway
name: fastpass-gateway
namespace: gateway
sectionName: https
hostnames:
- mission-space.local.mk-labs.cloud
rules:
- matches:
- path:
type: PathPrefix
value: /
backendRefs:
- group: ""
kind: Service
name: tekton-dashboard
port: 9097
weight: 1

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,70 @@
---
apiVersion: operator.tekton.dev/v1alpha1
kind: TektonConfig
metadata:
name: config
namespace: tekton-operator
spec:
targetNamespace: innoventions
profile: all
# Tekton Pipelines Configuration
pipeline:
disable-affinity-assistant: false
disable-creds-init: false
disable-home-env-overwrite: true
disable-working-directory-overwrite: true
enable-api-fields: stable
enable-custom-tasks: true
enable-tekton-oci-bundles: true
require-git-ssh-secret-known-hosts: false
running-in-environment-with-injected-sidecars: true
# Performance settings
performance:
disable-ha: false
replicas: 1
# Optional components
options:
disabled: false
# Tekton Triggers Configuration
trigger:
enable-api-fields: stable
# Performance settings
performance:
disable-ha: false
replicas: 1
# Optional components
options:
disabled: false
# Tekton Dashboard Configuration
dashboard:
readonly: false
# Optional components
options:
disabled: false
# Addon configurations (chains for supply chain security)
addon:
params:
- name: clusterTasks
value: "true"
- name: pipelineTemplates
value: "true"
- name: communityClusterTasks
value: "true"
# Pruner for cleaning up old pipeline runs
pruner:
disabled: false
resources:
- pipelinerun
- taskrun
keep: 100
schedule: "0 2 * * *" # Run at 2 AM daily