Azure readme work arounds (#346)

* workarounds for errors

* cleaned up
This commit is contained in:
Ria Bhatia
2018-09-18 16:03:30 -07:00
committed by GitHub
parent 1aa2f0ccce
commit b8d0b6eb03

View File

@@ -12,6 +12,7 @@ This document details configuring the Virtual Kubelet ACI provider.
* [Manual set-up](#manual-set-up) * [Manual set-up](#manual-set-up)
* [Validate the Virtual Kubelet ACI provider](#validate-the-virtual-kubelet-aci-provider) * [Validate the Virtual Kubelet ACI provider](#validate-the-virtual-kubelet-aci-provider)
* [Schedule a pod in ACI](#schedule-a-pod-in-aci) * [Schedule a pod in ACI](#schedule-a-pod-in-aci)
* [Work arounds](#work-arounds-for-the-aci-connector)
* [Upgrade the ACI Connector ](#upgrade-the-aci-connector) * [Upgrade the ACI Connector ](#upgrade-the-aci-connector)
* [Remove the Virtual Kubelet](#remove-the-virtual-kubelet) * [Remove the Virtual Kubelet](#remove-the-virtual-kubelet)
## Prerequisite ## Prerequisite
@@ -126,27 +127,27 @@ that you've created an [AKS cluster](https://docs.microsoft.com/en-us/azure/aks/
To install the ACI Connector use the az cli and the aks namespace. Make sure to use the resource group of the aks cluster you've created and the name of the aks cluster you've created. You can choose the connector name to be anything. Choose any command below to install the Linux, Windows, or both the Windows and Linux Connector. To install the ACI Connector use the az cli and the aks namespace. Make sure to use the resource group of the aks cluster you've created and the name of the aks cluster you've created. You can choose the connector name to be anything. Choose any command below to install the Linux, Windows, or both the Windows and Linux Connector.
Note: You need to specify the --aci-resource-group, due to a bug in the az cli. The resource group is then auto-generated. To find the name navigate to the Azure Portal resource groups, scroll down and find the name that matches MC_aks cluster name_aks rg_location. Note: You might need to specify the --aci-resource-group, due to a bug in the az cli. The resource group is then auto-generated. To find the name navigate to the Azure Portal resource groups, scroll down and find the name that matches MC_aks cluster name_aks rg_location.
1. Install the Linux ACI Connector 1. Install the Linux ACI Connector
**Bash** **Bash**
```cli ```cli
az aks install-connector --resource-group <aks cluster rg> --name <aks cluster name> --os-type linux --connector-name myaciconnector --aci-resource-group <auto-generated aks cluster rg> az aks install-connector --resource-group <aks cluster rg> --name <aks cluster name>
``` ```
2. Install the Windows ACI Connector 2. Install the Windows ACI Connector
**Bash** **Bash**
```cli ```cli
az aks install-connector --resource-group <aks cluster rg> --name <aks cluster name> --os-type windows --connector-name myaciconnector --aci-resource-group <auto-generated aks cluster rg> az aks install-connector --resource-group <aks cluster rg> --name <aks cluster name> --os-type windows
``` ```
3. Install both the Windows and Linux ACI Connectors 3. Install both the Windows and Linux ACI Connectors
**Bash** **Bash**
```cli ```cli
az aks install-connector --resource-group <aks cluster rg> --name <aks cluster name> --os-type both --connector-name myaciconnector --aci-resource-group <auto-generated aks cluster rg> az aks install-connector --resource-group <aks cluster rg> --name <aks cluster name> --os-type both
``` ```
Now you are ready to deploy a pod to the connector so skip to the "Schedule a pod in ACI" section. Now you are ready to deploy a pod to the connector so skip to the "Schedule a pod in ACI" section.
@@ -285,7 +286,7 @@ Output:
```console ```console
NAME STATUS ROLES AGE VERSION NAME STATUS ROLES AGE VERSION
virtual-kubelet-myconnector-linux Ready <none> 2m v1.8.3 virtual-kubelet-virtual-kubelet Ready <none> 2m v1.8.3
aks-nodepool1-39289454-0 Ready agent 22h v1.7.7 aks-nodepool1-39289454-0 Ready agent 22h v1.7.7
aks-nodepool1-39289454-1 Ready agent 22h v1.7.7 aks-nodepool1-39289454-1 Ready agent 22h v1.7.7
aks-nodepool1-39289454-2 Ready agent 22h v1.7.7 aks-nodepool1-39289454-2 Ready agent 22h v1.7.7
@@ -316,6 +317,10 @@ spec:
- containerPort: 443 - containerPort: 443
name: https name: https
dnsPolicy: ClusterFirst dnsPolicy: ClusterFirst
nodeSelector:
kubernetes.io/role: agent
beta.kubernetes.io/os: linux
type: virtual-kubelet
tolerations: tolerations:
- key: virtual-kubelet.io/provider - key: virtual-kubelet.io/provider
operator: Exists operator: Exists
@@ -333,6 +338,15 @@ Notice that Virtual-Kubelet nodes are tainted by default to avoid unexpected pod
effect: NoSchedule effect: NoSchedule
``` ```
Also, specify a nodeSelector so the pods will be forced onto the Virtual-Kubelet node.
```
nodeSelector:
kubernetes.io/role: agent
beta.kubernetes.io/os: linux
type: virtual-kubelet
```
Run the application with the [kubectl create][kubectl-create] command. Run the application with the [kubectl create][kubectl-create] command.
```cli ```cli
@@ -415,6 +429,105 @@ Output:
"helloworld-aci.westus.azurecontainer.io" "helloworld-aci.westus.azurecontainer.io"
``` ```
--> -->
## Work arounds for the ACI Connector
If your pod that's scheduled onto the Virtual Kubelet node is in a pending state please add these workarounds to your Virtual Kubelet pod spec.
First, grab the logs from your ACI Connector pod, with the following command.
```cli
kubectl logs virtual-kubelet-virtual-kubelet-7bcf5dc749-6mvgp
```
### Stream or pod watcher errors
If you see the following errors in the logs:
```console
ERROR: logging before flag.Parse: E0914 00:02:01.546132 1 streamwatcher.go:109] Unable to decode an event from the watch stream: stream error: stream ID 181; INTERNAL_ERROR
time="2018-09-14T00:02:01Z" level=error msg="Pod watcher connection is closed unexpectedly" namespace= node=virtual-kubelet-myconnector-linux operatingSystem=Linux provider=azure
```
Then copy the master URL with cluster-info.
```cli
kubectl cluster-info
```
Output:
```console
Kubernetes master is running at https://aksxxxx-xxxxx-xxxx-xxxxxxx.hcp.uksouth.azmk8s.io:443
```
Edit your aci-connector deployment by first getting the deployment name.
```cli
kubectl get deploy
```
Output:
```console
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
virtual-kubelet-virtual-kubelet 1 1 1 1 5d
aci-helloworld 1 1 1 0 12m
```
Edit the deployment.
```cli
kubectl edit deploy virtual-kubelet-virtual-kubelet
```
Add the following name and value to the deployment in the enviorment section. Use your copied master URL.
```yaml
--name: MASTER_URI
value: https://aksxxxx-xxxxx-xxxx-xxxxxxx.hcp.uksouth.azmk8s.io:443
```
### Taint deprecated errors
If you see the following errors in the logs:
```console
Flag --taint has been deprecated, Taint key should now be configured using the VK_TAINT_KEY environment variable
```
Then edit your aci-connector deployment by first grabbing the deployment name.
```cli
kubectl get deploy
```
Output:
```console
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
virtual-kubelet-virtual-kubelet 1 1 1 1 5d
aci-helloworld 1 1 1 0 12m
```
Edit the connector deployment.
```cli
kubectl edit deploy virtual-kubelet-virtual-kubelet
```
Add the following as an enviorment variable within the deployment.
```yaml
--name: VK_TAINT_KEY
value: azure.com/aci
```
Also, delete the following argument in your pod spec:
```yaml
- --taint
- azure.com/aci
```
## Upgrade the ACI Connector ## Upgrade the ACI Connector