Skip to content

Commit

Permalink
Add support to read lincence from secret
Browse files Browse the repository at this point in the history
This commit add support to take licence from a kubernetes secret.
A kubernetes secret can be created, which can be passed through helm chart.
Previous flag is still present to provide backward comptability.

Signed-off-by: Vivek Singh <[email protected]>
  • Loading branch information
viveksyngh committed Aug 29, 2021
1 parent f123aff commit d8388fb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
7 changes: 7 additions & 0 deletions chart/inlets-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ spec:
env:
- name: client_image
value: "{{.Values.clientImage}}"
{{- if and .Values.proLicenseSecret.name .Values.proLicenseSecret.key }}
- name: LICENSE
valueFrom:
secretKeyRef:
name: {{ .Values.proLicenseSecret.name }}
key: {{ .Values.proLicenseSecret.key }}
{{- end }}
volumeMounts:
- mountPath: /var/secrets/inlets/
name: inlets-access-key
Expand Down
4 changes: 4 additions & 0 deletions chart/inlets-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ vpcId: ""
subnetId: ""

# Only provide LoadBalancers for Services annotated with "dev.inlets.manage=true"
proLicenseSecret:
name: ""
key: ""

annotatedOnly: false

image: "ghcr.io/inlets/inlets-operator:0.14.1"
Expand Down
5 changes: 4 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,12 @@ func main() {
}

infra.InletsClientImage = os.Getenv("client_image")

log.Printf("Client image: %s\n", infra.GetInletsClientImage())

if len(infra.ProConfig.License) == 0 {
infra.ProConfig.License = os.Getenv("LICENSE")
}

if _, err := infra.ProConfig.GetLicenseKey(); err != nil {
fmt.Fprintf(os.Stderr, "%s\n", err.Error())
os.Exit(1)
Expand Down

0 comments on commit d8388fb

Please sign in to comment.