Skip to content

Commit

Permalink
Add plan to Inlets Operator Helm chart
Browse files Browse the repository at this point in the history
Signed-off-by: Engin Diri <engin.diri@mail.schwarz>
  • Loading branch information
Engin Diri authored and alexellis committed Sep 15, 2021
1 parent f123aff commit 3024d5e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 93 deletions.
1 change: 1 addition & 0 deletions chart/inlets-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,4 @@ Parameter | Description | Default
`tolerations` | Node tolerations | `[]`
`affinity` | Node affinity policy | `{}`
`secretKeyFile` | If we are using a provider that requires a secret key as well as an access key, set to `/var/secrets/inlets/secret/inlets-secret-key` | `""`
`plan` | The plan or size for your cloud instance | different defaults, depending of the infrastructure provider
3 changes: 3 additions & 0 deletions chart/inlets-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ spec:
{{- if .Values.secretKeyFile }}
- "-secret-key-file=/var/secrets/inlets/secret/inlets-secret-key"
{{- end }}
{{- if .Values.plan }}
- "-plan={{.Values.plan}}"
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
env:
Expand Down
2 changes: 2 additions & 0 deletions chart/inlets-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ inletsProLicense: ""
provider: "digitalocean"
region: "lon1"

#plan: <The plan or size for your cloud instance>

# provider: "gce"
# zone: "us-central1-a"
# projectID: "<Your GCP Project ID>"
Expand Down
13 changes: 5 additions & 8 deletions controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -551,23 +551,16 @@ func getHostConfig(c *Controller, tunnel *inletsv1alpha1.Tunnel, planOverride st

switch c.infraConfig.Provider {
case "equinix-metal":

plan := "c3.small.x86"
if len(planOverride) > 0 {
plan = planOverride
}

host = provision.BasicHost{
Name: tunnel.Name,
OS: "ubuntu_20_04",
Plan: plan,
Plan: "c3.small.x86",
Region: c.infraConfig.Region,
UserData: userData,
Additional: map[string]string{
"project_id": c.infraConfig.ProjectID,
},
}

case "digitalocean":
host = provision.BasicHost{
Name: tunnel.Name,
Expand Down Expand Up @@ -667,6 +660,10 @@ func getHostConfig(c *Controller, tunnel *inletsv1alpha1.Tunnel, planOverride st
Additional: map[string]string{},
}
}
// override default plan/size when provided
if len(c.infraConfig.Plan) > 0 {
host.Plan = c.infraConfig.Plan
}
return host
}

Expand Down
Loading

0 comments on commit 3024d5e

Please sign in to comment.