Validate: add support for kubernetes deployment validation with `src validate kube` subcommand
Created by: jdpleiness
This PR adds the src validate kube
subcommand for validating Sourcegraph deployments on Kubernetes.
Features include:
- pod validation
- service validation
- PVC validation
- network connection validation between Sourcegraph services
Validations can also include warnings for non-failure states that should be addressed.
Kubernetes cluster configuration is handled via standard kubeconfig file in users home directory or can be specified with --kubeconfig
flag. Users can also specify a specific namespace via --namespace
flag.
TODO:
-
Add --quiet
flag to silence command line output in CI/CD pipelines -
Update CHANGELOG.md
Test plan
- Locally tested changes using latest Sourcegraph Helm install.
- Added unit tests in
internal/validate/kube/kube_test.go
. - ran go test ./... - all tests passing
- ran staticcheck ./... - no issues found in new code