mirror of
https://github.com/lukaszraczylo/kubemirror.git
synced 2026-06-05 22:43:51 +00:00
096dca47d1
* feat(controller): add lazy watcher, improve resource usage and add pattern validation - [x] Add cache sync health check for readiness probe verification - [x] Create namespace lister with API reader support for fresh label queries - [x] Add pattern validation with warning logs for invalid glob patterns - [x] Implement lazy watcher initialization mode to scan for active resources - [x] Add requeue delay to namespace reconciler for cache settlement - [x] Replace custom containsString with slices.Contains from stdlib - [x] Add structured logging context to reconcilers (kind, group, version) - [x] Improve error variable naming for clarity in nested conditions - [x] Add nil-safe label access in namespace reconciler setup - [x] Add APIReader to namespace and source reconcilers for fresh data - [x] Improve type assertions with proper error handling in mirror operations - [x] Reorder struct fields for consistency and readability - [x] Add comprehensive pattern validation tests and validation API * feat(controller): add lazy watcher, improve resource usage and add pattern validation - [x] Add circuit breaker for reconciliation failure tracking and prevention - [x] Implement granular registration state tracking (not-registered, source-only, fully-registered) - [x] Add lazy controller initialization for active resource types only - [x] Consolidate namespace listing into single API call for efficiency - [x] Add mirror creation verification to catch webhook rejections - [x] Implement high-cardinality resource detection and warnings - [x] Add source deletion check in mirror reconciler to prevent races - [x] Preserve transformation annotations on errors in mirror reconciliation - [x] Expand constants documentation with labels vs annotations design rationale - [x] Add comprehensive test coverage for circuit breaker and registration states - [x] Add mutation-safety tests for hash computation * fixup! feat(controller): add lazy watcher, improve resource usage and add pattern validation
178 lines
4.0 KiB
YAML
178 lines
4.0 KiB
YAML
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
|
|
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
|
|
|
|
version: 2
|
|
|
|
project_name: kubemirror
|
|
|
|
before:
|
|
hooks:
|
|
- go mod tidy
|
|
- go mod verify
|
|
# Note: Helm chart versioning is handled by the helm-charts repository
|
|
# triggered by the publish-helm-chart job in .github/workflows/release.yaml
|
|
|
|
builds:
|
|
- id: kubemirror
|
|
main: ./cmd/kubemirror
|
|
binary: kubemirror
|
|
env:
|
|
- CGO_ENABLED=0
|
|
flags:
|
|
- -trimpath
|
|
ldflags:
|
|
- -s -w
|
|
- -X main.Version={{.Version}}
|
|
- -X main.Commit={{.Commit}}
|
|
- -X main.Date={{.Date}}
|
|
goos:
|
|
- linux
|
|
- darwin
|
|
- windows
|
|
goarch:
|
|
- amd64
|
|
- arm64
|
|
ignore:
|
|
- goos: windows
|
|
goarch: arm64
|
|
|
|
archives:
|
|
- id: default
|
|
formats:
|
|
- tar.gz
|
|
name_template: >-
|
|
{{ .ProjectName }}_
|
|
{{- .Version }}_
|
|
{{- .Os }}_
|
|
{{- .Arch }}
|
|
files:
|
|
- README.md
|
|
- LICENSE
|
|
- examples/*
|
|
format_overrides:
|
|
- goos: windows
|
|
formats:
|
|
- zip
|
|
|
|
checksum:
|
|
name_template: 'checksums.txt'
|
|
algorithm: sha256
|
|
|
|
changelog:
|
|
sort: asc
|
|
use: github
|
|
filters:
|
|
exclude:
|
|
- '^docs:'
|
|
- '^test:'
|
|
- '^chore:'
|
|
- '^ci:'
|
|
- Merge pull request
|
|
- Merge branch
|
|
groups:
|
|
- title: Features
|
|
regexp: '^.*?feat(\([[:word:]]+\))??!?:.+$'
|
|
order: 0
|
|
- title: Bug Fixes
|
|
regexp: '^.*?fix(\([[:word:]]+\))??!?:.+$'
|
|
order: 1
|
|
- title: Performance Improvements
|
|
regexp: '^.*?perf(\([[:word:]]+\))??!?:.+$'
|
|
order: 2
|
|
- title: Others
|
|
order: 999
|
|
|
|
release:
|
|
github:
|
|
owner: lukaszraczylo
|
|
name: kubemirror
|
|
draft: false
|
|
prerelease: auto
|
|
name_template: "v{{.Version}}"
|
|
header: |
|
|
## KubeMirror v{{.Version}}
|
|
|
|
Kubernetes controller for mirroring resources (Secrets, ConfigMaps) across namespaces with automatic synchronization.
|
|
|
|
### Installation
|
|
|
|
**Helm (recommended):**
|
|
```bash
|
|
helm repo add kubemirror https://lukaszraczylo.github.io/helm-charts
|
|
helm repo update
|
|
helm install kubemirror kubemirror/kubemirror --version {{.Version}}
|
|
```
|
|
|
|
**Helm (from release asset):**
|
|
```bash
|
|
helm install kubemirror https://github.com/lukaszraczylo/kubemirror/releases/download/v{{.Version}}/kubemirror-{{.Version}}.tgz
|
|
```
|
|
|
|
**Docker:**
|
|
```bash
|
|
docker pull ghcr.io/lukaszraczylo/kubemirror:{{.Version}}
|
|
```
|
|
|
|
**Binary (Linux/macOS/Windows):**
|
|
Download the archive for your platform from the assets below, extract, and run:
|
|
```bash
|
|
./kubemirror --help
|
|
```
|
|
|
|
### Usage
|
|
|
|
Apply labels and annotations to resources you want to mirror:
|
|
```yaml
|
|
apiVersion: v1
|
|
kind: Secret
|
|
metadata:
|
|
name: my-secret
|
|
namespace: default
|
|
labels:
|
|
kubemirror.raczylo.com/enabled: "true"
|
|
annotations:
|
|
kubemirror.raczylo.com/sync: "true"
|
|
kubemirror.raczylo.com/target-namespaces: "app1,app2,app-*"
|
|
```
|
|
|
|
See [examples/](https://github.com/lukaszraczylo/kubemirror/tree/main/examples) for more usage patterns.
|
|
|
|
dockers_v2:
|
|
- ids:
|
|
- kubemirror
|
|
images:
|
|
- "ghcr.io/lukaszraczylo/kubemirror"
|
|
tags:
|
|
- "{{ .Version }}"
|
|
- "latest"
|
|
platforms:
|
|
- linux/amd64
|
|
- linux/arm64
|
|
dockerfile: Dockerfile.goreleaser
|
|
labels:
|
|
"org.opencontainers.image.title": "{{ .ProjectName }}"
|
|
"org.opencontainers.image.version": "{{ .Version }}"
|
|
"org.opencontainers.image.source": "https://github.com/lukaszraczylo/kubemirror"
|
|
"org.opencontainers.image.description": "Kubernetes controller for mirroring resources across namespaces"
|
|
"org.opencontainers.image.licenses": "MIT"
|
|
|
|
signs:
|
|
- cmd: cosign
|
|
signature: "${artifact}.sigstore.json"
|
|
args:
|
|
- sign-blob
|
|
- "--bundle=${signature}"
|
|
- "${artifact}"
|
|
- "--yes"
|
|
artifacts: checksum
|
|
output: true
|
|
|
|
docker_signs:
|
|
- cmd: cosign
|
|
artifacts: images
|
|
output: true
|
|
args:
|
|
- sign
|
|
- "${artifact}@${digest}"
|
|
- "--yes"
|