Files
virtual-kubelet/charts/virtual-kubelet-for-aks/templates/deployment.yaml
Robbie Zhang f4ebbfc7a3 [Azure] Optimize VK Setup in ACS/AKS (#85)
* Read ACS Credentials for Azure Authentication

Supprt a new environment variable: ACS_CREDENTIAL_LOCATION
Expect the value to be the ACS credential filepath, which is the
/etc/kubernetes/azure.json file generated on the ACS nodes.

If the ACS_CREDENTIAL_LOCATION is specified and loaded,
create the Azure Authentication class from its values.

If the AZURE_AUTHENTICATION_LOCATION is specified and loaded,
its values will overwrite the value above.

Refactor the ACI provider and ACI client to be able to override the SPN by environment variable
2018-02-13 19:07:27 -08:00

58 lines
2.1 KiB
YAML

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: {{ template "fullname" . }}
spec:
replicas: 1
template:
metadata:
labels:
app: {{ template "fullname" . }}
spec:
containers:
- name: {{ template "fullname" . }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: KUBELET_PORT
value: "10250"
- name: ACS_CREDENTIAL_LOCATION
value: /etc/virtual-kubelet/acs.json
- name: AZURE_TENANT_ID
value: {{ .Values.env.azureTenantId }}
- name: AZURE_SUBSCRIPTION_ID
value: {{ .Values.env.azureSubscriptionId }}
- name: AZURE_CLIENT_ID
value: {{ .Values.env.azureClientId }}
- name: AZURE_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: {{ template "fullname" . }}
key: clientSecret
- name: ACI_RESOURCE_GROUP
value: {{ .Values.env.aciResourceGroup }}
- name: ACI_REGION
value: {{ default "westus" .Values.env.aciRegion }}
- name: APISERVER_CERT_LOCATION
value: /etc/virtual-kubelet/cert.pem
- name: APISERVER_KEY_LOCATION
value: /etc/virtual-kubelet/key.pem
- name: VKUBELET_POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
volumeMounts:
- name: credentials
mountPath: "/etc/virtual-kubelet"
- name: acs-credential
mountPath: "/etc/virtual-kubelet/acs.json"
command: ["virtual-kubelet"]
args: ["--provider", "azure", "--namespace", "default", "--nodename", {{ default "virtual-kubelet" .Values.env.nodeName | quote }} , "--os", {{ default "Linux" .Values.env.nodeOsType | quote }}, "--taint", {{ default "azure.com/aci" .Values.env.nodeTaint | quote }}]
volumes:
- name: credentials
secret:
secretName: {{ template "fullname" . }}
- name: acs-credential
hostPath:
path: /etc/kubernetes/azure.json