diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 07f7337d..b8d9ee27 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -87,7 +87,7 @@ jobs: owner: context.repo.owner, repo: context.repo.repo, tag_name: `ngrok-ingress-controller-${tag}`, - name: tag, + name: `ngrok-ingress-controller-${tag}`, body: `${tag}`, draft: false, prerelease: false diff --git a/Makefile b/Makefile index 47068c90..6aab0199 100644 --- a/Makefile +++ b/Makefile @@ -25,6 +25,8 @@ KUSTOMIZE = go run sigs.k8s.io/kustomize/kustomize/v3 ENVTEST = go run sigs.k8s.io/controller-runtime/tools/setup-envtest +HELM_CHART_DIR = ./helm/ingress-controller + # Targets .PHONY: all @@ -107,7 +109,7 @@ uninstall: manifests ## Uninstall CRDs from the K8s cluster specified in ~/.kube .PHONY: deploy deploy: docker-build manifests ## Deploy controller to the K8s cluster specified in ~/.kube/config. - helm upgrade ngrok-ingress-controller helm/ingress-controller --install \ + helm upgrade ngrok-ingress-controller $(HELM_CHART_DIR) --install \ --namespace ngrok-ingress-controller \ --create-namespace \ --set podAnnotations."k8s\.ngrok\.com/test"="\{\"env\": \"local\"\}" \ @@ -121,9 +123,14 @@ undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/confi .PHONY: helm-lint helm-lint: ## Lint the helm chart - helm lint helm/ingress-controller + helm lint $(HELM_CHART_DIR) .PHONY: helm-test helm-test: ## Run helm unittest plugin ./scripts/helm-setup.sh - cd helm/ingress-controller && helm unittest --helm3 . + helm unittest --helm3 $(HELM_CHART_DIR) + +.PHONY: helm-update-snapshots +helm-update-snapshots: ## Update helm unittest snapshots + ./scripts/helm-setup.sh + helm unittest --helm3 -u $(HELM_CHART_DIR) diff --git a/README.md b/README.md index 362e224b..44774dc8 100644 --- a/README.md +++ b/README.md @@ -126,7 +126,7 @@ data: ## How to Configure the Agent > Warning: This will be deprecated soon when moving to the new lib-ngrok library -* assumes configs will be in a config map named `ngrok-ingress-controller-agent-cm` in the same namespace +* assumes configs will be in a config map named `{{ include "ngrok-ingress-controller.fullname" . }}-agent-cm` in the same namespace * setup automatically via helm. Values and config map name can be configured in the future via helm * subset of these that should be configurable https://ngrok.com/docs/ngrok-agent/config#config-full-example * example config map showing all optional values with their defaults. @@ -135,7 +135,7 @@ data: apiVersion: v1 kind: ConfigMap metadata: - name: ngrok-ingress-controller-agent-cm + name: {{ include "ngrok-ingress-controller.fullname" . }}-agent-cm namespace: ngrok-ingress-controller data: LOG: stdout diff --git a/cmd/manager/main.go b/cmd/manager/main.go index 33d04adc..b96ff4d9 100644 --- a/cmd/manager/main.go +++ b/cmd/manager/main.go @@ -54,10 +54,10 @@ func main() { type managerOpts struct { // flags - metricsAddr string - enableLeaderElection bool - probeAddr string - zapOpts *zap.Options + metricsAddr string + electionID string + probeAddr string + zapOpts *zap.Options // env vars namespace string @@ -77,7 +77,7 @@ func cmd() *cobra.Command { c.Flags().StringVar(&opts.metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to") c.Flags().StringVar(&opts.probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.") - c.Flags().BoolVar(&opts.enableLeaderElection, "leader-elect", false, "Enable leader election for controller manager. Enabling this will ensure there is only one active controller manager.") + c.Flags().StringVar(&opts.electionID, "election-id", "ngrok-ingress-controller-leader", "The name of the configmap that is used for holding the leader lock") c.Flags().StringVar(&opts.region, "region", "us", "The region to use for ngrok tunnels") opts.zapOpts = &zap.Options{Development: true} goFlagSet := flag.NewFlagSet("manager", flag.ContinueOnError) @@ -111,8 +111,8 @@ func runController(ctx context.Context, opts managerOpts) error { MetricsBindAddress: opts.metricsAddr, Port: 9443, HealthProbeBindAddress: opts.probeAddr, - LeaderElection: true, - LeaderElectionID: "ngrok-ingress-controller-leader", + LeaderElection: opts.electionID != "", + LeaderElectionID: opts.electionID, }) if err != nil { return fmt.Errorf("unable to start manager: %w", err) diff --git a/helm/ingress-controller/CHANGELOG.md b/helm/ingress-controller/CHANGELOG.md index 62afa541..ddd37db2 100644 --- a/helm/ingress-controller/CHANGELOG.md +++ b/helm/ingress-controller/CHANGELOG.md @@ -1,3 +1,15 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## 0.2.0 +### Added + +- Support for different values commonly found in helm charts + # 0.1.0 -TODO \ No newline at end of file +TODO diff --git a/helm/ingress-controller/Chart.yaml b/helm/ingress-controller/Chart.yaml index a1320750..ddb6a713 100644 --- a/helm/ingress-controller/Chart.yaml +++ b/helm/ingress-controller/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: ngrok-ingress-controller description: A Kubernetes ingress controller built using ngrok. -version: 0.1.2 +version: 0.2.0 appVersion: 0.1.0 keywords: - ngrok diff --git a/helm/ingress-controller/README.md b/helm/ingress-controller/README.md index a7245a75..a5c75f78 100644 --- a/helm/ingress-controller/README.md +++ b/helm/ingress-controller/README.md @@ -33,21 +33,38 @@ To uninstall the chart: ## Parameters +### Common parameters + +| Name | Description | Value | +| ------------------- | ----------------------------------------------------- | ----- | +| `nameOverride` | String to partially override generated resource names | `""` | +| `fullnameOverride` | String to fully override generated resource names | `""` | +| `commonLabels` | Labels to add to all deployed objects | `{}` | +| `commonAnnotations` | Annotations to add to all deployed objects | `{}` | + + ### Controller parameters -| Name | Description | Value | -| ------------------------ | ----------------------------------------------- | -------------------------------------- | -| `podAnnotations` | Used to inject custom annotations directly into | `{}` | -| `replicaCount` | The number of controllers and agents to run. | `2` | -| `image.repository` | The ngrok ingress controller image repository. | `ngrok/ngrok-ingress-controller` | -| `image.tag` | The ngrok ingress controller image tag. | `latest` | -| `image.pullPolicy` | The ngrok ingress controller image pull policy. | `IfNotPresent` | -| `ingressClass` | The ingress class this controller will satisfy. | `ngrok` | -| `log` | Agent log destination. | `stdout` | -| `region` | ngrok region to create tunnels in. | `us` | -| `credentialsSecret.name` | The name of the K8S secret that contains the | `ngrok-ingress-controller-credentials` | -| `apiKey` | The ngrok API key to use | `""` | -| `authtoken` | The ngrok auth token to use | `""` | -| `resources.limits` | The resources limits for the container | `{}` | -| `resources.requests` | The requested resources for the container | `{}` | +| Name | Description | Value | +| ---------------------------- | --------------------------------------------------------------- | -------------------------------------- | +| `podAnnotations` | Used to inject custom annotations directly into | `{}` | +| `replicaCount` | The number of controllers and agents to run. | `2` | +| `image.registry` | The ngrok ingress controller image registry. | `docker.io` | +| `image.repository` | The ngrok ingress controller image repository. | `ngrok/ngrok-ingress-controller` | +| `image.tag` | The ngrok ingress controller image tag. | `latest` | +| `image.pullPolicy` | The ngrok ingress controller image pull policy. | `IfNotPresent` | +| `image.pullSecrets` | An array of imagePullSecrets to be used when pulling the image. | `[]` | +| `ingressClass.name` | The name of the ingress class to use. | `ngrok` | +| `ingressClass.create` | Whether to create the ingress class. | `true` | +| `ingressClass.default` | Whether to set the ingress class as default. | `true` | +| `log` | Agent log destination. | `stdout` | +| `region` | ngrok region to create tunnels in. | `us` | +| `credentialsSecret.name` | The name of the K8S secret that contains the | `ngrok-ingress-controller-credentials` | +| `apiKey` | The ngrok API key to use | `""` | +| `authtoken` | The ngrok auth token to use | `""` | +| `resources.limits` | The resources limits for the container | `{}` | +| `resources.requests` | The requested resources for the container | `{}` | +| `serviceAccount.create` | Specifies whether a ServiceAccount should be created | `true` | +| `serviceAccount.name` | The name of the ServiceAccount to use. | `""` | +| `serviceAccount.annotations` | Additional annotations to add to the ServiceAccount | `{}` | diff --git a/helm/ingress-controller/templates/_helpers.tpl b/helm/ingress-controller/templates/_helpers.tpl new file mode 100644 index 00000000..86399a09 --- /dev/null +++ b/helm/ingress-controller/templates/_helpers.tpl @@ -0,0 +1,76 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "ngrok-ingress-controller.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "ngrok-ingress-controller.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +*/}} +{{- define "ngrok-ingress-controller.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Common labels +*/}} +{{- define "ngrok-ingress-controller.labels" -}} +helm.sh/chart: {{ include "ngrok-ingress-controller.chart" . }} +{{ include "ngrok-ingress-controller.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/part-of: {{ template "ngrok-ingress-controller.name" . }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- if .Values.commonLabels}} +{{ toYaml .Values.commonLabels }} +{{- end }} +{{- end -}} + +{{/* +Selector labels +*/}} +{{- define "ngrok-ingress-controller.selectorLabels" -}} +app.kubernetes.io/name: {{ include "ngrok-ingress-controller.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end -}} + +{{/* +Create the name of the controller service account to use +*/}} +{{- define "ngrok-ingress-controller.serviceAccountName" -}} +{{- if .Values.serviceAccount.create -}} + {{ default (include "ngrok-ingress-controller.fullname" .) .Values.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} + +{{/* +Return the ngrok/ingress-controller image name +*/}} +{{- define "ngrok-ingress-controller.image" -}} +{{- $registryName := .Values.image.registry -}} +{{- $repositoryName := .Values.image.repository -}} +{{- $tag := .Values.image.tag | toString -}} +{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} diff --git a/helm/ingress-controller/templates/agent-config-cm.yaml b/helm/ingress-controller/templates/agent-config-cm.yaml index 95c660db..526f17d6 100644 --- a/helm/ingress-controller/templates/agent-config-cm.yaml +++ b/helm/ingress-controller/templates/agent-config-cm.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: ConfigMap metadata: - name: ngrok-ingress-controller-agent-cm + name: {{ include "ngrok-ingress-controller.fullname" . }}-agent-cm namespace: {{ .Release.Namespace }} data: LOG: "{{ .Values.log }}" diff --git a/helm/ingress-controller/templates/controller-cm.yaml b/helm/ingress-controller/templates/controller-cm.yaml index 2e1408bd..385b8ed5 100644 --- a/helm/ingress-controller/templates/controller-cm.yaml +++ b/helm/ingress-controller/templates/controller-cm.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: ConfigMap metadata: - name: ngrok-ingress-controller-manager-config + name: {{ include "ngrok-ingress-controller.fullname" . }}-manager-config namespace: {{ .Release.Namespace }} data: controller_manager_config.yaml: | @@ -13,5 +13,4 @@ data: bindAddress: 127.0.0.1:8080 leaderElection: leaderElect: true - resourceName: ngrok-ingress-controller-leader - + resourceName: {{ include "ngrok-ingress-controller.fullname" . }}-leader diff --git a/helm/ingress-controller/templates/controller-deployment.yaml b/helm/ingress-controller/templates/controller-deployment.yaml index 2682b4b5..35086a77 100644 --- a/helm/ingress-controller/templates/controller-deployment.yaml +++ b/helm/ingress-controller/templates/controller-deployment.yaml @@ -2,8 +2,9 @@ apiVersion: apps/v1 kind: Deployment metadata: labels: - app: ngrok-ingress-controller - name: ngrok-ingress-controller-manager + {{- include "ngrok-ingress-controller.labels" . | nindent 4 }} + app.kubernetes.io/component: controller + name: {{ include "ngrok-ingress-controller.fullname" . }}-manager namespace: {{ .Release.Namespace }} annotations: checksum/agent-config: {{ include (print $.Template.BasePath "/agent-config-cm.yaml") . | sha256sum }} @@ -13,7 +14,8 @@ spec: replicas: {{.Values.replicaCount}} selector: matchLabels: - app: ngrok-ingress-controller + {{- include "ngrok-ingress-controller.selectorLabels" . | nindent 6 }} + app.kubernetes.io/component: controller template: metadata: annotations: @@ -25,9 +27,14 @@ spec: prometheus.io/port: '8080' prometheus.io/scrape: 'true' labels: - app: ngrok-ingress-controller + {{- include "ngrok-ingress-controller.selectorLabels" . | nindent 8 }} + app.kubernetes.io/component: controller spec: - serviceAccountName: ngrok-ingress-controller-manager + serviceAccountName: {{ template "ngrok-ingress-controller.serviceAccountName" . }} + {{- if .Values.image.pullSecrets }} + imagePullSecrets: + {{- toYaml .Values.image.pullSecrets | nindent 8 }} + {{- end }} volumes: - name: scripts configMap: @@ -35,14 +42,14 @@ spec: defaultMode: 0755 containers: - name: ngrok-ingress-controller - image: {{ .Values.image.repository }}:{{ .Values.image.tag }} + image: {{ include "ngrok-ingress-controller.image" . }} imagePullPolicy: {{ .Values.image.pullPolicy }} command: - /manager args: - --health-probe-bind-address=:8081 - --metrics-bind-address=:8080 - - --leader-elect + - --election-id={{ include "ngrok-ingress-controller.fullname" . }}-leader {{- if .Values.region }} - --region={{ .Values.region}} {{- end }} @@ -78,7 +85,7 @@ spec: - ./scripts/gen-agent-config.sh envFrom: - configMapRef: - name: ngrok-ingress-controller-agent-cm + name: {{ include "ngrok-ingress-controller.fullname" . }}-agent-cm optional: true env: - name: NGROK_AUTHTOKEN diff --git a/helm/ingress-controller/templates/controller-rbac.yaml b/helm/ingress-controller/templates/controller-rbac.yaml index 37d3225f..17503733 100644 --- a/helm/ingress-controller/templates/controller-rbac.yaml +++ b/helm/ingress-controller/templates/controller-rbac.yaml @@ -1,10 +1,4 @@ --- -apiVersion: v1 -kind: ServiceAccount -metadata: - name: ngrok-ingress-controller-manager - namespace: {{ .Release.Namespace }} ---- apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: @@ -72,7 +66,7 @@ roleRef: name: ngrok-ingress-controller-leader-election-role subjects: - kind: ServiceAccount - name: ngrok-ingress-controller-manager + name: {{ template "ngrok-ingress-controller.serviceAccountName" . }} namespace: {{ .Release.Namespace }} --- apiVersion: rbac.authorization.k8s.io/v1 @@ -85,7 +79,7 @@ roleRef: name: ngrok-ingress-controller-manager-role subjects: - kind: ServiceAccount - name: ngrok-ingress-controller-manager + name: {{ template "ngrok-ingress-controller.serviceAccountName" . }} namespace: {{ .Release.Namespace }} --- apiVersion: rbac.authorization.k8s.io/v1 @@ -98,5 +92,5 @@ roleRef: name: ngrok-ingress-controller-proxy-role subjects: - kind: ServiceAccount - name: ngrok-ingress-controller-manager + name: {{ template "ngrok-ingress-controller.serviceAccountName" . }} namespace: {{ .Release.Namespace }} diff --git a/helm/ingress-controller/templates/controller-serviceaccount.yaml b/helm/ingress-controller/templates/controller-serviceaccount.yaml new file mode 100644 index 00000000..efc1e395 --- /dev/null +++ b/helm/ingress-controller/templates/controller-serviceaccount.yaml @@ -0,0 +1,15 @@ +{{- if .Values.serviceAccount.create -}} +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ template "ngrok-ingress-controller.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "ngrok-ingress-controller.labels" . | nindent 4 }} + app.kubernetes.io/component: controller + {{- if .Values.serviceAccount.annotations }} + annotations: + {{- toYaml .Values.serviceAccount.annotations | nindent 4 }} + {{- end }} +{{- end }} diff --git a/helm/ingress-controller/templates/ingress-class.yaml b/helm/ingress-controller/templates/ingress-class.yaml index 353013f6..e202c516 100644 --- a/helm/ingress-controller/templates/ingress-class.yaml +++ b/helm/ingress-controller/templates/ingress-class.yaml @@ -1,6 +1,15 @@ +{{- if .Values.ingressClass.create -}} apiVersion: networking.k8s.io/v1 kind: IngressClass metadata: - name: {{ .Values.ingressClass}} + labels: + {{- include "ngrok-ingress-controller.labels" . | nindent 4 }} + app.kubernetes.io/component: controller + name: {{ .Values.ingressClass.name }} + {{- if .Values.ingressClass.default }} + annotations: + ingressclass.kubernetes.io/is-default-class: "true" + {{- end }} spec: controller: k8s.ngrok.com/ingress-controller +{{- end}} diff --git a/helm/ingress-controller/tests/__snapshot__/agent-config-cm_test.yaml.snap b/helm/ingress-controller/tests/__snapshot__/agent-config-cm_test.yaml.snap new file mode 100644 index 00000000..4429e961 --- /dev/null +++ b/helm/ingress-controller/tests/__snapshot__/agent-config-cm_test.yaml.snap @@ -0,0 +1,12 @@ +Should match snapshot: + 1: | + apiVersion: v1 + data: + LOG: stdout + METADATA: "" + REGION: us + REMOTE_MANAGEMENT: "" + kind: ConfigMap + metadata: + name: RELEASE-NAME-ngrok-ingress-controller-agent-cm + namespace: NAMESPACE diff --git a/helm/ingress-controller/tests/__snapshot__/controller-cm_test.yaml.snap b/helm/ingress-controller/tests/__snapshot__/controller-cm_test.yaml.snap new file mode 100644 index 00000000..b87adbfa --- /dev/null +++ b/helm/ingress-controller/tests/__snapshot__/controller-cm_test.yaml.snap @@ -0,0 +1,18 @@ +should match snapshot: + 1: | + apiVersion: v1 + data: + controller_manager_config.yaml: | + apiVersion: controller-runtime.sigs.k8s.io/v1alpha1 + kind: ControllerManagerConfig + health: + healthProbeBindAddress: :8081 + metrics: + bindAddress: 127.0.0.1:8080 + leaderElection: + leaderElect: true + resourceName: test-release-ngrok-ingress-controller-leader + kind: ConfigMap + metadata: + name: test-release-ngrok-ingress-controller-manager-config + namespace: test-namespace diff --git a/helm/ingress-controller/tests/__snapshot__/controller-deployment_test.yaml.snap b/helm/ingress-controller/tests/__snapshot__/controller-deployment_test.yaml.snap new file mode 100644 index 00000000..d29d296e --- /dev/null +++ b/helm/ingress-controller/tests/__snapshot__/controller-deployment_test.yaml.snap @@ -0,0 +1,293 @@ +Should match snapshot: + 1: | + apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + checksum/agent-config: c477ecc68a20d5571a24a33342f62893ed4c1d89ecb80cc7cf97b58b290e2891 + checksum/controller-role: 4c8da8ec4e728eb7bbf0e2f88f5ad55781f988247737d6f1c889c736aa909c60 + checksum/rbac: d65fd1d397f0da2dc2888c7af42265b5a47272fbbf56a0c3331023d949f3c58b + labels: + app.kubernetes.io/component: controller + app.kubernetes.io/instance: RELEASE-NAME + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/name: ngrok-ingress-controller + app.kubernetes.io/part-of: ngrok-ingress-controller + app.kubernetes.io/version: 0.1.0 + helm.sh/chart: ngrok-ingress-controller-0.2.0 + name: RELEASE-NAME-ngrok-ingress-controller-manager + namespace: NAMESPACE + spec: + replicas: 2 + selector: + matchLabels: + app.kubernetes.io/component: controller + app.kubernetes.io/instance: RELEASE-NAME + app.kubernetes.io/name: ngrok-ingress-controller + template: + metadata: + annotations: + kubectl.kubernetes.io/default-container: manager + prometheus.io/path: /metrics + prometheus.io/port: "8080" + prometheus.io/scrape: "true" + labels: + app.kubernetes.io/component: controller + app.kubernetes.io/instance: RELEASE-NAME + app.kubernetes.io/name: ngrok-ingress-controller + spec: + containers: + - args: + - --health-probe-bind-address=:8081 + - --metrics-bind-address=:8080 + - --election-id=RELEASE-NAME-ngrok-ingress-controller-leader + - --region=us + command: + - /manager + env: + - name: NGROK_API_KEY + valueFrom: + secretKeyRef: + key: API_KEY + name: ngrok-ingress-controller-credentials + - name: POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + image: docker.io/ngrok/ngrok-ingress-controller:latest + imagePullPolicy: IfNotPresent + livenessProbe: + httpGet: + path: /healthz + port: 8081 + initialDelaySeconds: 15 + periodSeconds: 20 + name: ngrok-ingress-controller + readinessProbe: + httpGet: + path: /readyz + port: 8081 + initialDelaySeconds: 5 + periodSeconds: 10 + resources: + limits: {} + requests: {} + securityContext: + allowPrivilegeEscalation: false + - command: + - ./scripts/gen-agent-config.sh + env: + - name: NGROK_AUTHTOKEN + valueFrom: + secretKeyRef: + key: AUTHTOKEN + name: ngrok-ingress-controller-credentials + - name: NGROK_REGION + value: us + envFrom: + - configMapRef: + name: RELEASE-NAME-ngrok-ingress-controller-agent-cm + optional: true + image: ngrok/ngrok:3 + name: ngrok-cli + volumeMounts: + - mountPath: /scripts + name: scripts + readOnly: true + serviceAccountName: RELEASE-NAME-ngrok-ingress-controller + volumes: + - configMap: + defaultMode: 493 + name: scripts + name: scripts + 2: | + apiVersion: v1 + data: + gen-agent-config.sh: | + #!/bin/bash + + NGROK_LOG="${NGROK_LOG:-stdout}" + NGROK_REGION="${NGROK_REGION:-us}" + NGROK_REMOTE_MANAGEMENT="${NGROK_REMOTE_MANAGEMENT:-true}" + + cat > /var/lib/ngrok/agent-template.yaml <