Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

AKS updates and fixes #626

Merged
merged 4 commits into from
Jun 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/aks-production/cluster.lokocfg
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,5 @@ component "cert-manager" {
}

component "contour" {
service_monitor = true
enable_monitoring = true
}
2 changes: 1 addition & 1 deletion examples/aks-testing/cluster.lokocfg
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,5 @@ component "cert-manager" {
}

component "contour" {
service_monitor = true
enable_monitoring = true
}
5 changes: 5 additions & 0 deletions pkg/platform/aks/aks.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ type config struct {
ManageResourceGroup bool `hcl:"manage_resource_group,optional"`

WorkerPools []workerPool `hcl:"worker_pool,block"`

KubernetesVersion string
}

const (
Expand All @@ -73,13 +75,16 @@ const (
clientSecretEnv = "LOKOMOTIVE_AKS_CLIENT_SECRET" // #nosec G101
subscriptionIDEnv = "LOKOMOTIVE_AKS_SUBSCRIPTION_ID"
tenantIDEnv = "LOKOMOTIVE_AKS_TENANT_ID"

kubernetesVersion = "1.16.9"
)

// init registers AKS as a platform.
func init() { //nolint:gochecknoinits
c := &config{
Location: "West Europe",
ManageResourceGroup: true,
KubernetesVersion: kubernetesVersion,
}

platform.Register(name, c)
Expand Down
2 changes: 1 addition & 1 deletion pkg/platform/aks/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ locals {
application_name = "{{ .ApplicationName }}"
location = "{{ .Location }}"
resource_group_name = {{ template "resource_group_name" . }}
kubernetes_version = "1.16.7"
kubernetes_version = "{{ .KubernetesVersion }}"
cluster_name = "{{ .ClusterName }}"
default_node_pool_name = "{{ (index .WorkerPools 0).Name }}"
default_node_pool_vm_size = "{{ (index .WorkerPools 0).VMSize }}"
Expand Down
2 changes: 1 addition & 1 deletion pkg/platform/aws/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ module "worker-pool-{{ $index }}" {
spot_price = "{{ $pool.SpotPrice }}"
{{- end }}

{{- if $pool.TargetGroups }}
{{- if $pool.TargetGroups }}
target_groups = {{ (index $.WorkerpoolCfg $index "target_groups") }}
{{- end }}

Expand Down
2 changes: 1 addition & 1 deletion pkg/platform/baremetal/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ module "bare-metal-{{.ClusterName}}" {
{{- range $key, $value := .Labels}}
"{{$key}}" = "{{$value}}",
{{- end}}
}
}
{{- end}}
}

Expand Down
6 changes: 3 additions & 3 deletions pkg/platform/packet/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ module "packet-{{.Config.ClusterName}}" {

{{- if .Config.ControllerCLCSnippets}}
controller_clc_snippets = [
{{- range $clc_snippet := .Config.ControllerCLCSnippets}}
{{- range $clc_snippet := .Config.ControllerCLCSnippets}}
<<EOF
{{ $clc_snippet }}
EOF
Expand Down Expand Up @@ -137,7 +137,7 @@ module "worker-{{ $pool.Name }}" {

{{- if $pool.CLCSnippets}}
clc_snippets = [
{{- range $clc_snippet := $pool.CLCSnippets}}
{{- range $clc_snippet := $pool.CLCSnippets}}
<<EOF
{{ $clc_snippet }}
EOF
Expand All @@ -153,7 +153,7 @@ EOF
{{- range $key, $value := $pool.Tags }}
"{{ $key }}:{{ $value }}",
{{- end }}
]
]
{{- end }}

project_id = "{{$.Config.ProjectID}}"
Expand Down