Secret Receiver
This microservice was created to act as a CRUD for secret in Kubernetes. To be used to automated secret renew in Kubernetes.
Environment variables
ENCODING_REQUEST is used to accepted only encoded requests.
Others Environment variables
export PORT=8080
export APP_NAME=secretreceiver
export LOG_LEVEL=INFO
Deploy it in Kubernetes
Create Secret file:
kubectl create secret generic secretreceiver --from-literal=encodedrequest=LONGHASH --dry-run -o yaml > k8s-secret.yaml
Configure Ingress in k8s-deployment.yaml (line 62) change secretreceiver.example.local to use your own domain.
Deploy it:
kubectl apply -f k8s-secret.yaml
kubectl apply -f k8s-deployment.yaml
How to create secrets in Secret Receiver
Use secretpublisher command line tool to send encoded requests to Secret Receiver.
Development
Test and coverage
Run the tests
TESTRUN=true go test ./... -coverprofile=coverage.out
go tool cover -html=coverage.out
Install golangci-lint and run lint:
golangci-lint run
Docker Build
docker build .
References
Golang Spell
The project was initialized using Golang Spell.
Architectural Model
The Architectural Model adopted to structure the application is based on The Clean Architecture.
Further details can be found here: The Clean Architecture and in the Clean Architecture Book.