Compare commits

...

8 Commits

Author SHA1 Message Date
Kit Ewbank
8f6b4b9e20 Fix 'make clean'. (#191) 2018-05-10 10:54:24 -07:00
Kit Ewbank
fc22300b71 [AWS Fargate] Execution role required if CloudWatch log group is specified (#194)
Execution role required if CloudWatch log group is specified.
2018-05-10 10:37:28 -07:00
Robbie Zhang
f3ebde2533 Add the kubernete.io/hostname label to the VK node (#188) 2018-05-08 12:13:05 -07:00
Robbie Zhang
acf2871edd Update the ACI README.md about Tolerations
Add notice about adding tolerations to the pod which desires to be scheduled to the VK nodes.
2018-05-08 11:32:19 -07:00
Robbie Zhang
28f555e9ba Fix the anchors in the ACI README.md
Use lower-cases in the hash (#)
2018-05-08 11:25:56 -07:00
Onur Filiz
b96181afa8 Fargate: Handle describe failure and log failure reason 2018-05-03 14:22:42 -07:00
Onur Filiz
18adde2aca Merge pull request #181 from ewbankkit/issue-180
Make Fargate provider available in 3 additional AWS regions
2018-05-01 07:53:37 -07:00
Kit Ewbank
23a9d9954f Make Fargate provider in 3 additional AWS regions. 2018-05-01 09:02:32 -04:00
7 changed files with 32 additions and 10 deletions

View File

@@ -54,7 +54,7 @@ docker:
@echo "Docker Build..."
$Q docker build -t $(DOCKER_IMAGE) .
clean: clean-build
clean:
@echo "Clean..."
$Q rm -rf bin

View File

@@ -102,6 +102,9 @@ func (p *FargateProvider) loadConfig(r io.Reader) error {
if config.OperatingSystem != providers.OperatingSystemLinux {
return fmt.Errorf("Fargate does not support operating system %v", config.OperatingSystem)
}
if config.CloudWatchLogGroupName != "" && config.ExecutionRoleArn == "" {
return fmt.Errorf("Execution role required if CloudWatch log group is specified")
}
// Validate advertised capacity.
if q, err = resource.ParseQuantity(config.CPU); err != nil {

View File

@@ -32,6 +32,7 @@ ExecutionRoleArn = ""
# Amazon CloudWatch log group name used to store container logs. Optional.
# If omitted, container logs will not be available.
# If specified, an execution role with access to CloudWatch logs is required.
CloudWatchLogGroupName = ""
# AWS Fargate platform version. Optional. Defaults to "LATEST".

View File

@@ -195,6 +195,9 @@ func (pod *Pod) Start() error {
runTaskOutput, err := api.RunTask(runTaskInput)
log.Printf("RunTask err:%+v output:%+v", err, runTaskOutput)
if err != nil || len(runTaskOutput.Tasks) == 0 {
if len(runTaskOutput.Failures) != 0 {
err = fmt.Errorf("reason: %s", *runTaskOutput.Failures[0].Reason)
}
err = fmt.Errorf("failed to run task: %v", err)
return err
}
@@ -332,7 +335,11 @@ func (pod *Pod) describe() (*ecs.Task, error) {
}
describeTasksOutput, err := api.DescribeTasks(describeTasksInput)
if err != nil {
if err != nil || len(describeTasksOutput.Tasks) == 0 {
if len(describeTasksOutput.Failures) != 0 {
err = fmt.Errorf("reason: %s", *describeTasksOutput.Failures[0].Reason)
}
err = fmt.Errorf("failed to describe task: %v", err)
return nil, err
}

View File

@@ -12,6 +12,9 @@ var (
// FargateRegions are AWS regions where Fargate is available.
FargateRegions = Regions{
"us-east-1",
"us-east-2",
"us-west-2",
"eu-west-1",
}
)

View File

@@ -7,13 +7,13 @@ The Azure Container Instances provider for the Virtual Kubelet configures an ACI
This document details configuring the Virtual Kubelet ACI provider.
#### Table of Contents
* [Prerequiste](#Prerequisite)
* [Quick set-up with the ACI Connector](#Quick-set-up-with-the-ACI-Connector)
* [Manual set-up](#Manual-set-up)
* [Validate the Virtual Kubelet ACI provider](#Validate-the-Virtual-Kubelet-ACI-provider)
* [Schedule a pod in ACI](#Schedule-a-pod-in-ACI)
* [Upgrade the ACI Connector ](#Upgrade-the-ACI-Connector)
* [Remove the Virtual Kubelet](#Remove-the-Virtual-Kubelet)
* [Prerequiste](#prerequisite)
* [Quick set-up with the ACI Connector](#quick-set-up-with-the-aci-connector)
* [Manual set-up](#manual-set-up)
* [Validate the Virtual Kubelet ACI provider](#validate-the-virtual-kubelet-aci-provider)
* [Schedule a pod in ACI](#schedule-a-pod-in-aci)
* [Upgrade the ACI Connector ](#upgrade-the-aci-connector)
* [Remove the Virtual Kubelet](#remove-the-virtual-kubelet)
## Prerequisite
This guide assumes that you have a Kubernetes cluster up and running (can be `minikube`) and that `kubectl` is already configured to talk to it.
@@ -299,6 +299,14 @@ spec:
effect: NoSchedule
```
Notice that Virtual-Kubelet nodes are tainted by default to avoid unexpected pods running on them, i.e. kube-proxy, other virtual-kubelet pods, etc. To schedule a pod to them, you need to add the tolerations to your pod spec:
```
tolerations:
- key: azure.com/aci
effect: NoSchedule
```
Run the application with the [kubectl create][kubectl-create] command.
```cli

View File

@@ -147,7 +147,7 @@ func (s *Server) registerNode() error {
"type": "virtual-kubelet",
"kubernetes.io/role": "agent",
"beta.kubernetes.io/os": strings.ToLower(s.provider.OperatingSystem()),
"kubernetes.io/hostname": s.nodeName,
"alpha.service-controller.kubernetes.io/exclude-balancer": "true",
},
},