This guide documents all available Make targets for the Kubernetes Orchestrator Extension project.
| Category | Common Targets |
|---|---|
| Build | make build |
| Testing | make test-unit, make test-integration, make test |
| Coverage | make test-coverage-unit, make test-coverage-open |
| Debugging | make debug-loop, make debug-logs |
| OAuth | make token, make token-show |
| API | make api-list-stores, make api-list-certs |
Run make help to see all available targets with descriptions.
Display all available targets organized by category with descriptions.
Alias for make build.
Interactive setup wizard that creates environment configuration files:
- Creates
.test.envwith Azure-related environment variables - Creates
.envwith project configuration
Removes .env and test.env files to reset the development environment.
Creates a new xUnit test project linked to the main project.
Interactive helper to install a NuGet package into a selected project.
Run all unit tests (excludes integration tests).
make test-unitIntegration tests require:
- A Kubernetes cluster accessible via
~/.kube/config - Cluster permissions to create/delete namespaces and secrets
Run all integration tests on both frameworks (net8.0 and net10.0).
make test-integrationRun integration tests on net8.0 only (~50% faster).
make test-integration-fastRun integration tests on all frameworks (explicit target for clarity).
Run a subset of Inventory tests on net10.0 only for quick validation.
Run integration tests without cleaning up secrets afterward. Useful for manual inspection of created resources.
Run integration tests for a specific certificate store type:
| Target | Store Type | Description |
|---|---|---|
make test-store-jks |
K8SJKS | Java Keystores |
make test-store-pkcs12 |
K8SPKCS12 | PKCS12/PFX files |
make test-store-secret |
K8SSecret | Opaque secrets |
make test-store-tls |
K8STLSSecr | TLS secrets |
make test-store-cluster |
K8SCluster | Cluster-wide management |
make test-store-ns |
K8SNS | Namespace-level management |
make test-store-cert |
K8SCert | Certificate Signing Requests |
Run tests for a specific store type with cleanup:
make test-store-type STORE=K8SSecret
make test-store-type STORE=K8STLSSecrRun all tests (unit + integration).
Run all tests with cluster cleanup before and after.
CI-optimized test runner:
- On
mainbranch: runs full integration tests - On PR branches: runs fast tests + net10.0 smoke tests
Interactive single test selection using fzf. Select a test from the list to run it with detailed output.
Run tests in watch mode - automatically re-runs tests when files change.
Run all tests (unit + integration) with code coverage and generate an HTML report.
make test-coverage
# Report generated at ./coverage/html/index.htmlRun unit tests only with code coverage (faster, excludes integration tests).
make test-coverage-unit
# Report generated at ./coverage/unit/html/index.htmlDisplay coverage summary in the terminal (requires running coverage first).
make test-coverage-unit
make test-coverage-summaryOpen the HTML coverage report in your browser (macOS).
make test-coverage-openRemove all coverage reports and artifacts.
make test-coverage-cleanDisplay instructions for setting up the test Kubernetes cluster, including:
- Current kubectl context
- Available contexts
- Test namespace information
Clean up all test namespaces and CSRs from the cluster:
keyfactor-k8sjks-integration-testskeyfactor-k8spkcs12-integration-testskeyfactor-k8ssecret-integration-testskeyfactor-k8stlssecr-integration-testskeyfactor-k8scluster-test-ns1,keyfactor-k8scluster-test-ns2keyfactor-k8sns-integration-testskeyfactor-k8scert-integration-testskeyfactor-manual-test
OAuth tokens are cached to .oauth_token for 50 minutes (3000 seconds) to reduce authentication requests.
Get an OAuth token. Uses cached token if valid, otherwise fetches a new one.
make token
# Output: Using cached token (expires in 45 minutes)
# eyJhbGciOiJS...Force refresh the OAuth token and cache it.
Display cached token status without exposing the full token:
make token-show
# Token status: VALID
# Expires in: 45 minutes
# Token preview: eyJhbGciOiJSUzI1Ni...Clear the cached OAuth token.
Get token silently (for use in scripts). Returns just the token string.
These targets interact with the Keyfactor Command API using cached OAuth tokens.
List all certificate stores from Command:
make api-list-stores
# e523b800-fe18-4e68-b7be-8f2034ffdc16 | k8s-agent | manual-tlssecr
# 27b16153-742c-4b4c-9b2d-02ec9cc90fa5 | k8s-agent | manual-opaqueList first 20 certificates from Command:
make api-list-certs
# 43 | meow | F3127840482241A1251498545A598C6D765BA03E | HasKey=true
# 44 | ec-csr | FA3BFCD6966AC297B1A3AA9FA43EB1C55EE1048B | HasKey=falseGet detailed certificate information:
make api-get-cert CERT_ID=43
# {
# "Id": 43,
# "Thumbprint": "F3127840482241A1251498545A598C6D765BA03E",
# "IssuedCN": "meow",
# "HasPrivateKey": true,
# "IssuerDN": "CN=Sub-CA",
# "KeyType": "RSA"
# }List recent orchestrator jobs (last 10):
make api-get-jobs
# guid-1234 | Management | Completed | 2024-02-25T10:00:00ZThese targets facilitate debugging the orchestrator extension with a local Keyfactor Command container.
Override these with environment variables or on the command line:
| Variable | Default | Description |
|---|---|---|
DEBUG_ENV_FILE |
~/.env_ses2541 |
Environment file with Keyfactor credentials |
DEBUG_CONTAINER_DIR |
~/Desktop/Container |
Docker compose directory |
DEBUG_COMPOSE_FILE |
docker-compose-ses.yml |
Docker compose file |
DEBUG_SERVICE_NAME |
ses_2541_uo_25_4_oauth |
Container service name |
DEBUG_TLS_STORE_ID |
e523b800-... |
TLS secret store GUID |
DEBUG_OPAQUE_STORE_ID |
27b16153-... |
Opaque secret store GUID |
DEBUG_PFX_PASSWORD |
3ceZRxdQffny |
Default PFX password |
DEBUG_CERT_ID |
44 |
Default certificate ID |
Build the extension and verify the DLL is in the container folder.
Restart the orchestrator container (down + up).
Get the current container ID.
Show last 100 lines of container logs.
Follow container logs in real-time (Ctrl+C to stop).
Schedule a management job for the TLS secret store using the default certificate.
Schedule a management job for the Opaque secret store.
Schedule jobs for both TLS and Opaque stores.
Schedule a TLS job with a specific certificate:
make debug-schedule-tls-cert CERT_ID=43
make debug-schedule-tls-cert CERT_ID=43 PFX_PASSWORD=mypasswordCheck the TLS secret (manual-tlssecr) in Kubernetes.
Check the Opaque secret (manual-opaque) in Kubernetes.
Check both TLS and Opaque secrets.
Wait for jobs to complete (polls logs for completion message).
These targets run complete debug workflows: build, restart, schedule, wait, check logs and secrets.
Full debug loop for TLS store with default certificate.
Full debug loop for both TLS and Opaque stores.
Full debug loop with certificate 43 (has private key + chain).
Full debug loop with certificate 44 (no private key, DER format).
Get OAuth token (alias for make token-get).
Get certificate information from Command:
make debug-get-cert-info CERT_ID=43Build the entire solution:
make build
# Builds both net8.0 and net10.0 targets-
.env- Project configuration (created bymake setup)PROJECT_ROOT=/path/to/k8s-orchestrator PROJECT_FILE=kubernetes-orchestrator-extension/Keyfactor.Orchestrators.K8S.csproj PROJECT_NAME=kubernetes-orchestrator-extension -
.test.env- Test environment variables (created bymake setup)export AZURE_TENANT_ID=... export AZURE_CLIENT_SECRET=... export AZURE_CLIENT_ID=... export AZURE_APP_GATEWAY_RESOURCE_ID=...
-
~/.env_ses2541(or customDEBUG_ENV_FILE) - Keyfactor credentials for debuggingexport KEYFACTOR_HOSTNAME=my.keyfactor.kfdelivery.com export KEYFACTOR_API_PATH=KeyfactorAPI export KEYFACTOR_AUTH_TOKEN_URL=https://login.keyfactor.com/oauth/token export KEYFACTOR_AUTH_CLIENT_ID=... export KEYFACTOR_AUTH_CLIENT_SECRET=...
| File | Purpose | Gitignored |
|---|---|---|
.oauth_token |
Cached OAuth token | Yes |
.oauth_token_expiry |
Token expiry timestamp | Yes |
.env |
Project configuration | Yes |
.test.env |
Test environment variables | Yes |
These targets help create and manage Kubernetes Certificate Signing Requests for testing the K8SCert store type.
Create a single test CSR:
make csr-create # Creates test-csr-<timestamp>
make csr-create NAME=my-test-csr # Creates my-test-csr
make csr-create NAME=my-csr CN=myapp.example.comCreate a CSR and immediately approve it:
make csr-create-approved NAME=my-approved-csrCreate multiple test CSRs at once:
make csr-create-batch # Creates 10 pending CSRs
make csr-create-batch COUNT=5 # Creates 5 pending CSRs
make csr-create-batch APPROVE=true # Creates 10 approved CSRs
make csr-create-batch COUNT=3 APPROVE=trueApprove a pending CSR:
make csr-approve NAME=test-csr-123456Deny a pending CSR:
make csr-deny NAME=test-csr-123456Delete a specific CSR:
make csr-delete NAME=test-csr-123456List all CSRs in the cluster.
List only test CSRs (those prefixed with test-).
Show detailed information about a specific CSR.
Delete all test CSRs (those prefixed with test-).
# Quick unit test check
make test-unit
# Single store type integration test
make test-store-tls
# Full integration test (slower)
make test-integration# 1. Check token is valid
make token-show
# 2. Get certificate info
make api-get-cert CERT_ID=43
# 3. Run full debug loop
make debug-loop-cert43
# 4. Check logs if something went wrong
make debug-logs# Clean up any leftover resources
make test-cluster-cleanup
# Run integration tests
make test-integration
# Or run all tests with cleanup
make test-all-with-cleanup# Use optimized CI test target
make test-ci
# Or for full validation
make test-all-with-cleanup