Skip to content

Validate: add support for kubernetes deployment validation with `src validate kube` subcommand

Erik Seliger requested to merge jdp/src-validate-kube into main

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.

Screenshot 2023-01-20 at 11 23 56 AM Screenshot 2023-01-20 at 11 25 44 AM Screenshot 2023-01-20 at 11 51 04 AM

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

Merge request reports

Loading