Require ACI region/resource group only for non-AKS deployments

This commit is contained in:
Jacob LeGrone
2018-07-19 20:45:37 -04:00
parent 6d8493d9ec
commit 123a1b37c2
3 changed files with 12 additions and 9 deletions

View File

@@ -4,8 +4,6 @@ metadata:
name: {{ template "vk.fullname" . }}
{{ include "vk.labels" . | indent 2 }}
component: kubelet
annotations:
virtual-kubelet/provider: {{ required "provider is required" .Values.provider }}
spec:
replicas: 1
template:
@@ -32,10 +30,6 @@ spec:
fieldPath: status.podIP
{{- if eq .Values.provider "azure" }}
{{- with .Values.providers.azure }}
- name: ACI_RESOURCE_GROUP
value: {{ required "aciResourceGroup is required" .aciResourceGroup }}
- name: ACI_REGION
value: {{ required "aciRegion is required" .aciRegion }}
{{- if .loganalytics.enabled }}
- name: LOG_ANALYTICS_AUTH_LOCATION
value: /etc/virtual-kubelet/loganalytics.json
@@ -54,9 +48,17 @@ spec:
secretKeyRef:
name: {{ template "vk.fullname" $ }}
key: clientSecret
- name: ACI_RESOURCE_GROUP
value: {{ .aciResourceGroup }}
- name: ACI_REGION
value: {{ .aciRegion }}
{{- else }}
- name: AZURE_AUTH_LOCATION
value: /etc/virtual-kubelet/credentials.json
- name: ACI_RESOURCE_GROUP
value: {{ required "aciResourceGroup is required" .aciResourceGroup }}
- name: ACI_REGION
value: {{ required "aciRegion is required" .aciRegion }}
{{- end }}
{{- end }}
{{- end }}
@@ -71,7 +73,7 @@ spec:
{{- end }}
command: ["virtual-kubelet"]
args: [
"--provider", "{{ .Values.provider }}",
"--provider", "{{ required "provider is required" .Values.provider }}",
"--namespace", "{{ .Values.monitoredNamespace }}",
"--nodename", "{{ required "nodeName is required" .Values.nodeName }}",
"--os", "{{ .Values.nodeOsType }}",

View File

@@ -23,7 +23,7 @@ data:
loganalytics.json: {{ printf "{\"workspaceID\": \"%s\",\"workspaceKey\": \"%s\"}" (required "workspaceID is required for loganalytics" .loganalytics.workspaceID ) (required "workspaceKey is required for loganalytics" .loganalytics.workspaceKey ) }}
{{- end }}
{{- if .targetAKS }}
clientSecret: {{ required "clientKey is required" .clientKey | b64enc | quote }}
clientSecret: {{ default "" .clientKey | b64enc | quote }}
{{- else }}
credentials.json: {{ printf "{ \"clientId\": \"%s\", \"clientSecret\": \"%s\", \"subscriptionId\": \"%s\", \"tenantId\": \"%s\", \"activeDirectoryEndpointUrl\": \"https://login.microsoftonline.com/\", \"resourceManagerEndpointUrl\": \"https://management.azure.com/\", \"activeDirectoryGraphResourceId\": \"https://graph.windows.net/\", \"sqlManagementEndpointUrl\": \"database.windows.net\", \"galleryEndpointUrl\": \"https://gallery.azure.com/\", \"managementEndpointUrl\": \"https://management.core.windows.net/\" }" (default "MISSING" .clientId) (default "MISSING" .clientKey) (default "MISSING" .subscriptionId) (default "MISSING" .tenantId) | b64enc | quote }}
{{- end }}

View File

@@ -20,8 +20,9 @@ providers:
clientKey:
tenantId:
subscriptionId:
## `aciResourceGroup` and `aciRegion` are required only for non-AKS deployments
aciResourceGroup:
aciRegion: "westus"
aciRegion:
loganalytics:
enabled: false
workspaceID: