Thank you for your interest in contributing to Push-to-K8s! This guide will help you set up your development environment and understand the contribution workflow.
- Go: 1.21 or higher
- kubectl: Configured with access to a Kubernetes cluster (local or remote)
- Docker: For building container images (optional)
- Git: For version control
git clone https://github.com/supporttools/push-to-k8s.git
cd push-to-k8spush-to-k8s/
├── main.go # Application entry point
├── deploy.yaml # Kubernetes deployment manifest
├── Dockerfile # Container image build
├── pkg/
│ ├── config/ # Configuration management
│ ├── k8s/ # Kubernetes operations
│ ├── logging/ # Logging setup
│ ├── metrics/ # Prometheus metrics
│ └── version/ # Version information
└── docs/ # Documentation & press kit
└── press-kit/logos/ # Brand assets (SVG)
# Simple build
go build -o push-to-k8s main.go
# Build with version information
VERSION=v1.0.0
GIT_COMMIT=$(git rev-parse HEAD)
BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
go build -ldflags "\
-X github.com/supporttools/push-to-k8s/pkg/version.Version=${VERSION} \
-X github.com/supporttools/push-to-k8s/pkg/version.GitCommit=${GIT_COMMIT} \
-X github.com/supporttools/push-to-k8s/pkg/version.BuildTime=${BUILD_DATE}" \
-o push-to-k8s main.godocker build -t push-to-k8s:dev .
# With build args
docker build \
--build-arg VERSION=dev \
--build-arg GIT_COMMIT=$(git rev-parse HEAD) \
--build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \
-t push-to-k8s:dev .export NAMESPACE=push-to-k8s
export DEBUG=true
export KUBECONFIG=~/.kube/config
export METRICS_PORT=9090
export SYNC_INTERVAL=1 # Short interval for testinggo run main.goThe controller will connect to your cluster and start syncing secrets.
# Create local cluster
kind create cluster --name push-to-k8s-dev
# Deploy test version (faster sync, debug enabled)
kubectl apply -f examples/deploy-testing.yaml
# View logs
kubectl logs -n push-to-k8s deployment/push-to-k8s -fThe examples/deploy-testing.yaml manifest is optimized for development:
- Debug logging enabled
- 5-minute sync interval (vs 15-minute production default)
- Uses
:testimage tag IfNotPresentpull policy for local images
# Run all tests
go test ./...
# Run with coverage
go test -cover ./...
# Generate coverage report
go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.out# Test config package
go test ./pkg/config -v
# Test Kubernetes operations
go test ./pkg/k8s -v# Requires access to a Kubernetes cluster
go test ./pkg/k8s/... -tags=integration -v# Format code
go fmt ./...
# Run linter
golangci-lint run- Standard library
- External dependencies
- Internal packages
Example:
import (
"context"
"fmt"
"time"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"github.com/supporttools/push-to-k8s/pkg/config"
"github.com/supporttools/push-to-k8s/pkg/logging"
)git checkout -b feature/my-new-featureBranch naming conventions:
feature/- New featuresfix/- Bug fixesdocs/- Documentation updatesrefactor/- Code refactoring
- Write clean, documented code
- Add tests for new functionality
- Update documentation as needed
- Follow existing code style
# Run tests
go test ./...
# Build to ensure no compilation errors
go build -o push-to-k8s main.go
# Test in local cluster
kubectl apply -f deploy.yamlgit add .
git commit -m "Add feature: description of change
Detailed explanation if needed.
Fixes #123"Commit message format:
- First line: Brief description (50 chars or less)
- Body: Detailed explanation (optional)
- Footer: Issue references (e.g., "Fixes #123")
git push origin feature/my-new-featureThen create a pull request on GitHub with:
- Clear description of changes
- Link to related issues
- Screenshots/examples if applicable
- Test results
Enable detailed logging:
export DEBUG=true
go run main.goAccess metrics locally:
kubectl port-forward -n push-to-k8s deployment/push-to-k8s 9090:9090
# View metrics
curl http://localhost:9090/metricskubectl logs -n push-to-k8s deployment/push-to-k8s -f --tail=50# Create test secret
kubectl create secret generic test -n push-to-k8s \
--from-literal=key=value
# Label it
kubectl label secret test push-to-k8s=source -n push-to-k8s
# Verify sync
kubectl get secrets test --all-namespacesSee CLAUDE.md for a detailed list of known issues and planned fixes, including:
- Deadlock in WatchNamespaces function
- No initial sync on startup
- Inefficient namespace watch handler
- Inconsistent namespace exclusion logic
- Missing /readyz endpoint
Contributors are welcome to tackle any of these issues!
Before submitting a PR, ensure:
- Code compiles without errors
- All tests pass (
go test ./...) - New code has test coverage
- Documentation updated (if applicable)
- Commit messages follow conventions
- PR description explains changes
- No sensitive data in commits
- Questions: GitHub Discussions
- Bugs: GitHub Issues
- Chat: Check README for community channels
Please read and follow our Code of Conduct to keep our community welcoming and inclusive.
By contributing to Push-to-K8s, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing to Push-to-K8s! 🙏