From 1c196688a45389b4e0e371a03d796371bb95fd8e Mon Sep 17 00:00:00 2001 From: Alex Bezek Date: Mon, 28 Oct 2024 19:45:25 -0500 Subject: [PATCH] Generate and commit values.schema.json file --- .gitattributes | 3 + .github/workflows/generate-chart-readme.yaml | 4 +- helm/ngrok-operator/Makefile | 2 +- helm/ngrok-operator/README.md | 12 +- .../tests/controller-pdb_test.yaml | 4 +- helm/ngrok-operator/values.schema.json | 425 ++++++++++++++++++ helm/ngrok-operator/values.yaml | 12 +- 7 files changed, 445 insertions(+), 17 deletions(-) create mode 100644 helm/ngrok-operator/values.schema.json diff --git a/.gitattributes b/.gitattributes index edcc8af2..82fa79dc 100644 --- a/.gitattributes +++ b/.gitattributes @@ -10,3 +10,6 @@ api/**/zz_generated*go linguist-generated=true helm/ngrok-operator/templates/crds/** linguist-generated=true helm/ngrok-operator/templates/rbac/role.yaml linguist-generated=true manifest-bundle.yaml linguist-generated=true + +# Generated by the helm readme-generator +helm/ngrok-operator/values.schema.json linguist-generated=true diff --git a/.github/workflows/generate-chart-readme.yaml b/.github/workflows/generate-chart-readme.yaml index 04c8245c..24fa41ef 100644 --- a/.github/workflows/generate-chart-readme.yaml +++ b/.github/workflows/generate-chart-readme.yaml @@ -25,8 +25,8 @@ jobs: - name: Execute readme-generator-for-helm working-directory: helm/ngrok-operator run: | - readme-generator --values "values.yaml" --readme "README.md" --schema "/tmp/schema.json" + make update-readme - name: Push changes uses: stefanzweifel/git-auto-commit-action@v4 with: - commit_message: Update README.md with readme-generator-for-helm + commit_message: Update README.md and values.schema.json with readme-generator-for-helm diff --git a/helm/ngrok-operator/Makefile b/helm/ngrok-operator/Makefile index fd3d0e63..cc1d2a3f 100644 --- a/helm/ngrok-operator/Makefile +++ b/helm/ngrok-operator/Makefile @@ -22,4 +22,4 @@ update-snapshots: ## Update helm unittest snapshots .PHONY: update-readme update-readme: ## Updates the README.md file with the chart values - readme-generator --values "values.yaml" --readme "README.md" --schema "/tmp/schema.json" + readme-generator --values "values.yaml" --readme "README.md" --schema "values.schema.json" diff --git a/helm/ngrok-operator/README.md b/helm/ngrok-operator/README.md index 6b76e41a..9a6a19dc 100644 --- a/helm/ngrok-operator/README.md +++ b/helm/ngrok-operator/README.md @@ -81,8 +81,8 @@ To uninstall the chart: | `priorityClassName` | Priority class for pod scheduling | `""` | | `lifecycle` | an object containing lifecycle configuration | `{}` | | `podDisruptionBudget.create` | Enable a Pod Disruption Budget creation | `false` | +| `podDisruptionBudget.maxUnavailable` | Maximum number/percentage of pods that may be made unavailable | `""` | | `podDisruptionBudget.minAvailable` | Minimum number/percentage of pods that should remain scheduled | `""` | -| `podDisruptionBudget.maxUnavailable` | Maximum number/percentage of pods that may be made unavailable | `1` | | `resources.limits` | The resources limits for the container | `{}` | | `resources.requests` | The requested resources for the container | `{}` | | `extraVolumes` | An array of extra volumes to add to the controller. | `[]` | @@ -102,11 +102,11 @@ To uninstall the chart: ### Credentials configuration -| Name | Description | Value | -| ------------------------- | --------------------------------------------------------------------------------------------------------------------- | ----- | -| `credentials.secret.name` | The name of the secret the credentials are in. If not provided, one will be generated using the helm release name. | `""` | -| `credentials.apiKey` | Your ngrok API key. If provided, it will be will be written to the secret and the authtoken must be provided as well. | `""` | -| `credentials.authtoken` | Your ngrok authtoken. If provided, it will be will be written to the secret and the apiKey must be provided as well. | `""` | +| Name | Description | Value | +| ------------------------- | ------------------------------------------------------------------------------------------------------------------ | ----- | +| `credentials.secret.name` | The name of the secret the credentials are in. If not provided, one will be generated using the helm release name. | `""` | +| `credentials.apiKey` | Your ngrok API key. If provided, it will be written to the secret and the authtoken must be provided as well. | `""` | +| `credentials.authtoken` | Your ngrok authtoken. If provided, it will be written to the secret and the apiKey must be provided as well. | `""` | ### Kubernetes Ingress feature configuration diff --git a/helm/ngrok-operator/tests/controller-pdb_test.yaml b/helm/ngrok-operator/tests/controller-pdb_test.yaml index 8f6bf8ee..49da949a 100644 --- a/helm/ngrok-operator/tests/controller-pdb_test.yaml +++ b/helm/ngrok-operator/tests/controller-pdb_test.yaml @@ -27,8 +27,8 @@ tests: set: podDisruptionBudget: create: true - minAvailable: 1 - maxUnavailable: "" + minAvailable: "1" + maxUnavailable: null asserts: - equal: path: spec.minAvailable diff --git a/helm/ngrok-operator/values.schema.json b/helm/ngrok-operator/values.schema.json new file mode 100644 index 00000000..8a5a8bdf --- /dev/null +++ b/helm/ngrok-operator/values.schema.json @@ -0,0 +1,425 @@ +{ + "title": "Chart Values", + "type": "object", + "properties": { + "nameOverride": { + "type": "string", + "description": "String to partially override generated resource names", + "default": "" + }, + "fullnameOverride": { + "type": "string", + "description": "String to fully override generated resource names", + "default": "" + }, + "description": { + "type": "string", + "description": "ngrok-operator description that will appear in the ngrok dashboard", + "default": "The official ngrok Kubernetes Operator." + }, + "commonLabels": { + "type": "object", + "description": "Labels to add to all deployed objects", + "default": {} + }, + "commonAnnotations": { + "type": "object", + "description": "Annotations to add to all deployed objects", + "default": {} + }, + "image": { + "type": "object", + "properties": { + "registry": { + "type": "string", + "description": "The ngrok operator image registry.", + "default": "docker.io" + }, + "repository": { + "type": "string", + "description": "The ngrok operator image repository.", + "default": "ngrok/ngrok-operator" + }, + "tag": { + "type": "string", + "description": "The ngrok operator image tag. Defaults to the chart's appVersion if not specified", + "default": "" + }, + "pullPolicy": { + "type": "string", + "description": "The ngrok operator image pull policy.", + "default": "IfNotPresent" + }, + "pullSecrets": { + "type": "array", + "description": "An array of imagePullSecrets to be used when pulling the image.", + "default": [], + "items": {} + } + } + }, + "region": { + "type": "string", + "description": "ngrok region to create tunnels in. Defaults to connect to the closest geographical region.", + "default": "" + }, + "rootCAs": { + "type": "string", + "description": "Set to \"trusted\" for the ngrok agent CA or \"host\" to trust the host's CA. Defaults to \"trusted\".", + "default": "" + }, + "serverAddr": { + "type": "string", + "description": "This is the address of the ngrok server to connect to. You should set this if you are using a custom ingress address.", + "default": "" + }, + "apiURL": { + "type": "string", + "description": "This is the URL of the ngrok API. You should set this if you are using a custom API URL.", + "default": "" + }, + "ngrokMetadata": { + "type": "object", + "description": "This is a map of key=value,key=value pairs that will be added as metadata to all ngrok api resources created", + "default": {} + }, + "clusterDomain": { + "type": "string", + "description": "Configure the default cluster base domain for your kubernetes cluster DNS resolution", + "default": "svc.cluster.local" + }, + "podAnnotations": { + "type": "object", + "description": "Used to apply custom annotations to the ingress pods.", + "default": {} + }, + "podLabels": { + "type": "object", + "description": "Used to apply custom labels to the ingress pods.", + "default": {} + }, + "replicaCount": { + "type": "number", + "description": "The number of controllers to run.", + "default": 1 + }, + "affinity": { + "type": "object", + "description": "Affinity for the controller pod assignment", + "default": {} + }, + "podAffinityPreset": { + "type": "string", + "description": "Pod affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard`", + "default": "" + }, + "podAntiAffinityPreset": { + "type": "string", + "description": "Pod anti-affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard`", + "default": "soft" + }, + "nodeAffinityPreset": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Node affinity preset type. Ignored if `affinity` is set. Allowed values: `soft` or `hard`", + "default": "" + }, + "key": { + "type": "string", + "description": "Node label key to match. Ignored if `affinity` is set.", + "default": "" + }, + "values": { + "type": "array", + "description": "Node label values to match. Ignored if `affinity` is set.", + "default": [], + "items": {} + } + } + }, + "priorityClassName": { + "type": "string", + "description": "Priority class for pod scheduling", + "default": "" + }, + "lifecycle": { + "type": "object", + "description": "an object containing lifecycle configuration", + "default": {} + }, + "podDisruptionBudget": { + "type": "object", + "properties": { + "create": { + "type": "boolean", + "description": "Enable a Pod Disruption Budget creation", + "default": false + }, + "maxUnavailable": { + "type": "string", + "description": "Maximum number/percentage of pods that may be made unavailable", + "default": "\"\"" + }, + "minAvailable": { + "type": "string", + "description": "Minimum number/percentage of pods that should remain scheduled", + "default": "\"\"" + } + } + }, + "resources": { + "type": "object", + "properties": { + "limits": { + "type": "object", + "description": "The resources limits for the container", + "default": {} + }, + "requests": { + "type": "object", + "description": "The requested resources for the container", + "default": {} + } + } + }, + "extraVolumes": { + "type": "array", + "description": "An array of extra volumes to add to the controller.", + "default": [], + "items": {} + }, + "extraVolumeMounts": { + "type": "array", + "description": "An array of extra volume mounts to add to the controller.", + "default": [], + "items": {} + }, + "extraEnv": { + "type": "object", + "description": "an object of extra environment variables to add to the controller.", + "default": {} + }, + "serviceAccount": { + "type": "object", + "properties": { + "create": { + "type": "boolean", + "description": "Specifies whether a ServiceAccount should be created", + "default": true + }, + "name": { + "type": "string", + "description": "The name of the ServiceAccount to use.", + "default": "" + }, + "annotations": { + "type": "object", + "description": "Additional annotations to add to the ServiceAccount", + "default": {} + } + } + }, + "log": { + "type": "object", + "properties": { + "level": { + "type": "string", + "description": "The level to log at. One of 'debug', 'info', or 'error'.", + "default": "info" + }, + "stacktraceLevel": { + "type": "string", + "description": "The level to report stacktrace logs one of 'info' or 'error'.", + "default": "error" + }, + "format": { + "type": "string", + "description": "The log format to use. One of console, json.", + "default": "json" + } + } + }, + "credentials": { + "type": "object", + "properties": { + "secret": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the secret the credentials are in. If not provided, one will be generated using the helm release name.", + "default": "" + } + } + }, + "apiKey": { + "type": "string", + "description": "Your ngrok API key. If provided, it will be written to the secret and the authtoken must be provided as well.", + "default": "" + }, + "authtoken": { + "type": "string", + "description": "Your ngrok authtoken. If provided, it will be written to the secret and the apiKey must be provided as well.", + "default": "" + } + } + }, + "ingress": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "When true, enable the Ingress controller features", + "default": true + }, + "ingressClass": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the ingress class to use.", + "default": "ngrok" + }, + "create": { + "type": "boolean", + "description": "Whether to create the ingress class.", + "default": true + }, + "default": { + "type": "boolean", + "description": "Whether to set the ingress class as default.", + "default": false + } + } + }, + "watchNamespace": { + "type": "string", + "description": "The namespace to watch for ingress resources (default all)", + "default": "" + }, + "controllerName": { + "type": "string", + "description": "The name of the controller to look for matching ingress classes", + "default": "k8s.ngrok.com/ingress-controller" + } + } + }, + "agent": { + "type": "object", + "properties": { + "priorityClassName": { + "type": "string", + "description": "Priority class for pod scheduling.", + "default": "" + }, + "replicaCount": { + "type": "number", + "description": "The number of agents to run.", + "default": 1 + }, + "serviceAccount": { + "type": "object", + "properties": { + "create": { + "type": "boolean", + "description": "Specifies whether a ServiceAccount should be created for the agent.", + "default": true + }, + "name": { + "type": "string", + "description": "The name of the ServiceAccount to use for the agent.", + "default": "" + }, + "annotations": { + "type": "object", + "description": "Additional annotations to add to the agent ServiceAccount", + "default": {} + } + } + } + } + }, + "gateway": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "When true, enable the Gateway controller", + "default": false + } + } + }, + "bindings": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "Whether to enable the Endpoint Bindings feature", + "default": false + }, + "name": { + "type": "string", + "description": "Unique name of this kubernetes binding in your ngrok account", + "default": "" + }, + "description": { + "type": "string", + "description": "Description of this kubernetes binding in your ngrok account", + "default": "Created by ngrok-operator" + }, + "allowedURLs": { + "type": "array", + "description": "List of allowed endpoint URL formats that this binding will project into the cluster", + "default": [ + "*" + ], + "items": { + "type": "string" + } + }, + "serviceAnnotations": { + "type": "object", + "description": "Annotations to add to projected services bound to an endpoint", + "default": {} + }, + "serviceLabels": { + "type": "object", + "description": "Labels to add to projected services bound to an endpoint", + "default": {} + }, + "forwarder": { + "type": "object", + "properties": { + "replicaCount": { + "type": "number", + "description": "The number of bindings forwarders to run.", + "default": 1 + }, + "serviceAccount": { + "type": "object", + "properties": { + "create": { + "type": "boolean", + "description": "Specifies whether a ServiceAccount should be created for the bindings forwarder pod(s).", + "default": true + }, + "name": { + "type": "string", + "description": "The name of the ServiceAccount to use for the bindings forwarder pod(s).", + "default": "" + }, + "annotations": { + "type": "object", + "description": "Additional annotations to add to the bindings-forwarder ServiceAccount", + "default": {} + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/helm/ngrok-operator/values.yaml b/helm/ngrok-operator/values.yaml index f9915a25..272cd448 100644 --- a/helm/ngrok-operator/values.yaml +++ b/helm/ngrok-operator/values.yaml @@ -120,13 +120,13 @@ lifecycle: {} ## Pod Disruption Budget configuration ## ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb/ ## @param podDisruptionBudget.create Enable a Pod Disruption Budget creation -## @param podDisruptionBudget.minAvailable Minimum number/percentage of pods that should remain scheduled -## @param podDisruptionBudget.maxUnavailable Maximum number/percentage of pods that may be made unavailable +## @param podDisruptionBudget.maxUnavailable [string] Maximum number/percentage of pods that may be made unavailable +## @param podDisruptionBudget.minAvailable [string] Minimum number/percentage of pods that should remain scheduled ## podDisruptionBudget: create: false - minAvailable: "" - maxUnavailable: 1 + maxUnavailable: "1" + # minAvailable: ## Controller container resource requests and limits ## ref: https://kubernetes.io/docs/user-guide/compute-resources/ @@ -204,8 +204,8 @@ log: ## @section Credentials configuration ## ## @param credentials.secret.name The name of the secret the credentials are in. If not provided, one will be generated using the helm release name. -## @param credentials.apiKey Your ngrok API key. If provided, it will be will be written to the secret and the authtoken must be provided as well. -## @param credentials.authtoken Your ngrok authtoken. If provided, it will be will be written to the secret and the apiKey must be provided as well. +## @param credentials.apiKey Your ngrok API key. If provided, it will be written to the secret and the authtoken must be provided as well. +## @param credentials.authtoken Your ngrok authtoken. If provided, it will be written to the secret and the apiKey must be provided as well. ## credentials: secret: