Commit Graph

391 Commits (2b26234003ea3ec35a3aeae21a8c78835fa21327)

Author SHA1 Message Date
Unknown be42a972f4 Use RFC1918 addresses in tests 2017-10-19 19:03:09 +00:00
Unknown 1397235ffa Restrict Azure NSG rules to allow external access only to load balancer IP 2017-10-18 22:51:03 +00:00
Kubernetes Submit Queue 6118a4b9af Merge pull request #53694 from andyzhangx/azure-avset-nil-fix
Automatic merge from submit-queue (batch tested with PRs 53694, 53919). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix controller manager crash issue on a manually created k8s cluster

**What this PR does / why we need it**:
fix controller manager crash issue on a manually created k8s cluster, it's due to availability set nil issue in azure loadbalancer

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #
In the testing of a manually created k8s cluster, I found controller manager on master would crash in current scenario:
1. Use acs-engine to set up k8s 1.7.7 cluster (it's with an availability set)
2. Manually add a node to the k8s cluster (without an availibity set in this VM)
3. Set up a service and schedule the pod onto this newly added node
4. controller manager would crash on master because although this k8s cluster has an availability set, the newly added node's `machine.AvailabilitySet` is nil which would cause controller manager crash

**Special notes for your reviewer**:
@brendanburns @karataliu @JiangtianLi 

**Release note**:

```
fix controller manager crash issue on a manually created k8s cluster
```
/sig azure
2017-10-16 10:58:27 -07:00
Jeff Grafton aee5f457db update BUILD files 2017-10-15 18:18:13 -07:00
Kubernetes Submit Queue 40e6a6b7ad Merge pull request #51677 from itowlson/azure-cloud-provider-vet
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix format specifiers in Azure cloud provider

**What this PR does / why we need it**: Fixes invalid/mismatched format specifiers in Azure cloud provider logging statements (`glog...Infof(...)`) that would cause information to be lost in logging output, as flagged by `go vet`.

**Which issue this PR fixes**: None

**Special notes for your reviewer**: None

**Release note**:

```release-note
NONE
```
2017-10-11 08:41:07 -07:00
andyzhangx 6920141e4f fix avset nil issue in azure loadbalancer 2017-10-11 03:10:55 +00:00
Kubernetes Submit Queue 299beb228e Merge pull request #53182 from itowlson/azure-blobdiskcontroller-retry-logic
Automatic merge from submit-queue (batch tested with PRs 53444, 52067, 53571, 53182). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Retry when checking  Azure storage account readiness

**What this PR does / why we need it**: When the Azure cloud provider ensures that a default storage container exists, if the storage account exists but is still provisioning, it exits without retrying.  This is a bug as the code is wrapped in a backoff policy but never signals the policy to retry.  This PR fixes this behaviour by returning values which allow the backoff policy to operate.

**Which issue this PR fixes**: fixes #53052

**Special notes for your reviewer**: Not sure how to test this - I have done a deployment using acs-engine and it seems to work but I am not sure of the best way to exercise the failure path.

**Release note**:

```release-note
NONE
```
2017-10-10 00:33:29 -07:00
Unknown 5f088973ce Retry when checking Azure storage account readiness 2017-09-28 02:48:20 +00:00
Henrik Schmidt 1339e4cffc Use custom error for "unimplemented" 2017-09-26 09:21:53 +02:00
Tomer Froumin 188db6f844 Added service annotation to set Azure DNS label for public IP 2017-09-24 11:46:24 +03:00
Kubernetes Submit Queue 4e64a3b5c3 Merge pull request #50673 from clement-buchart/patch-1
Automatic merge from submit-queue (batch tested with PRs 52355, 52537, 52551, 52403, 50673). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>..

Azure - Use cloud environment to instantiate storage client

**What this PR does / why we need it**:
Since 1.7 and managed disk for azure, blob storage on Azure cloud other than the default public one is broken, because kubernetes expect blob ressources URI to end with `.blob.core.windows.net ` (ignoring storageEndpointSuffix).
This include the chinese Cloud, for which storageEndpointSuffix is `blob.core.chinacloudapi.cn` for example.

See : https://github.com/Azure/azure-storage-go/blob/master/client.go#L194

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-09-23 15:27:03 -07:00
Kubernetes Submit Queue 8a638c6b55 Merge pull request #51757 from itowlson/azure-load-balancer-subnet-redux
Automatic merge from submit-queue (batch tested with PRs 50294, 50422, 51757, 52379, 52014). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>..

Azure cloud provider: expose services on non-default subnets

**What this PR does / why we need it**: The Azure cloud provider allows users to specify that a service should be exposed on an internal load balancer instead of the default external load balancer.  However, in a VNet environment, such services are currently always exposed on the master subnet.  Where there are multiple subnets in the VNet, it's desirable to be able to expose an internal service on any subnet.  This PR allows this via a new annotation, `service.beta.kubernetes.io/azure-load-balancer-internal-subnet`.

**Which issue this PR fixes**: fixes https://github.com/Azure/acs-engine/issues/1296 (no corresponding issue has been raised in the k8s core repo)

**Special notes for your reviewer**: None

**Release note**:

```release-note
A new service annotation has been added for services of type LoadBalancer on Azure, 
to specify the subnet on which the service's front end IP should be provisioned. The 
annotation is service.beta.kubernetes.io/azure-load-balancer-internal-subnet and its 
value is the subnet name (not the subnet ARM ID).  If omitted, the default is the 
master subnet.  It is ignored if the service is not on Azure, if the type is not 
LoadBalancer, or if the load balancer is not internal.
```
2017-09-23 11:40:49 -07:00
Kubernetes Submit Queue a5f766063d Merge pull request #51588 from karataliu/accm
Automatic merge from submit-queue

Fix splitProviderID for Azure

**What this PR does / why we need it**:
#46940 add 'splitProviderID' for Azure to get node name from provider, but it captures the resource id instead of node name.

Functions such as NodeAddresses are accepting node names:
84d9778f22/pkg/cloudprovider/providers/azure/azure_instances.go (L32)

With current implementation, it takes in a resource ID, and will result in following error
```
E0830 04:15:09.877143   10427 azure_instances.go:63] error: az.NodeAddresses, az.getIPForMachine(/subscriptions/{id}/resourceGroups/{id}/providers/Microsoft.Compute/virtualMachines/k8s-master-0), err=instance not found
```

This fix makes is return node names instead.


**Which issue this PR fixes**

**Special notes for your reviewer**:

**Release note**:
`NONE`


@brendandburns  @realfake @wlan0
2017-09-08 16:49:18 -07:00
Kubernetes Submit Queue a5b3e50eac Merge pull request #51528 from yastij/azure-zone-byProviderID-nodeName
Automatic merge from submit-queue (batch tested with PRs 52047, 52063, 51528)

implementation of GetZoneByProviderID and GetZoneByNodeName for azure

This is part of the #50926 effort

cc @luxas 

**Release note**:

```release-note
None
```
2017-09-08 16:07:00 -07:00
Unknown 125a054790 Fixes issues noted in review 2017-09-08 12:03:17 +12:00
Yassine TIJANI 144bd102c0 implementation of GetZoneByProviderID and GetZoneByNodeName for azure 2017-09-04 10:43:19 +02:00
Ivan Towlson 37c42b10dd Azure: expose services on non-default subnets 2017-09-01 14:33:41 +12:00
Unknown faecedb174 Fix format specifiers in Azure cloud provider 2017-08-31 15:54:36 +12:00
Dong Liu 09f0850da3 Fix InstanceTypeByProviderID for Azure 2017-08-30 13:00:21 +08:00
Dong Liu 623d32a637 Fix splitProviderID for Azure 2017-08-30 12:30:34 +08:00
Kubernetes Submit Queue 27fbb68f18 Merge pull request #51087 from oracle/for/upstream/master/ccm-instance-exists
Automatic merge from submit-queue (batch tested with PRs 51174, 51363, 51087, 51382, 51388)

Add InstanceExistsByProviderID to cloud provider interface for CCM

**What this PR does / why we need it**:

Currently, [`MonitorNode()`](02b520f0a4/pkg/controller/cloud/nodecontroller.go (L240)) in the node controller checks with the CCM if a node still exists by calling `ExternalID(nodeName)`. `ExternalID` is supposed to return the provider id of a node which is not supported on every cloud. This means that any clouds who cannot infer the provider id by the node name from a remote location will never remove nodes that no longer exist. 


**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #50985

**Special notes for your reviewer**:

We'll want to create a subsequent issue to track the implementation of these two new methods in the cloud providers.

**Release note**:

```release-note
Adds `InstanceExists` and `InstanceExistsByProviderID` to cloud provider interface for the cloud controller manager
```

/cc @wlan0 @thockin @andrewsykim @luxas @jhorwit2

/area cloudprovider
/sig cluster-lifecycle
2017-08-26 06:43:30 -07:00
Josh Horwitz cf75c49883 change godoc based on feedback from luxas 2017-08-25 18:04:10 -04:00
Josh Horwitz 3528ceb27f address test & doc comments 2017-08-25 16:15:55 -04:00
andrewsykim bd3cc83110 cloudprovider.Zones should support external cloud providers 2017-08-24 21:05:49 -04:00
Josh Horwitz 2f1ea47c83 Add InstanceExists* methods to cloud provider interface for CCM 2017-08-24 20:41:28 -04:00
clement-buchart 1586823c94 Variable mismatch 2017-08-15 17:58:18 +08:00
clement-buchart 45b07b253e Use cloud environment to instantiate client 2017-08-15 17:42:21 +08:00
Ivan Towlson 0035b40f27 Log name if Azure file share cannot be created 2017-08-15 14:01:53 +12:00
Kubernetes Submit Queue 92d9e44269 Merge pull request #50535 from jdumars/azure-owners
Automatic merge from submit-queue

Added jdumars to OWNERS file for Azure cloud provider

**What this PR does / why we need it**:

This PR adds GitHub user jdumars as an approver to pkg/cloudprovider/providers/azure 

Jaice Singer DuMars (me) is the program manager at Microsoft tasked with shepherding all upstream contributions from Microsoft into Kubernetes.  With the volume of work, and the impending breakout of cloud provider code, this helps distribute the review and approval load more evenly.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

N/A

**Special notes for your reviewer**:

This was discussed with Brendan Burns prior to submitting the pre-approval.

**Release note**:
none
2017-08-11 15:52:55 -07:00
Jason Singer DuMars 8516e9ff18 Added jdumars to OWNERS file for Azure cloud provider 2017-08-11 15:47:54 -04:00
Jeff Grafton a7f49c906d Use buildozer to delete licenses() rules except under third_party/ 2017-08-11 09:32:39 -07:00
Jeff Grafton 33276f06be Use buildozer to remove deprecated automanaged tags 2017-08-11 09:31:50 -07:00
Robert Rati 926f070719 Make ClusterID required for AWS. #48954 2017-08-07 15:47:00 -04:00
Kubernetes Submit Queue 5a25527b9b Merge pull request #49725 from sylr/vnet
Automatic merge from submit-queue

Azure: Allow VNet to be in a separate Resource Group

**What this PR does / why we need it**: 

This PR allows Kubernetes in an Azure context to use a VNet which is not in the same Resource Group as Kubernetes.

We need this because currently Azure Cloud Provider driver assumes that it should have a VNet for himself but if there is one thing that should be shared amongst Azure resources it's a VNet cause, well, things might want to talk to each other in a private network, don't you think ?

I guess this should we backported down to 1.6 branch.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: 

fixes #49577

**Release note**:

```release-note
NONE
```

@kubernetes/sig-azure
@kubernetes/sig-azure-pr-reviews
2017-08-10 01:41:15 -07:00
Kubernetes Submit Queue 031a83082b Merge pull request #49283 from dixudx/fix_cloudprovider_azure_config
Automatic merge from submit-queue (batch tested with PRs 49642, 50335, 50390, 49283, 46582)

fix bug when azure cloud provider configuration file is not specified

**What this PR does / why we need it**:

Current [Azure cloud provider](https://github.com/kubernetes/kubernetes/blob/master/pkg/cloudprovider/providers/azure/azure.go#L203) failed to [parse empty config file](https://github.com/kubernetes/kubernetes/blob/master/pkg/cloudprovider/plugins.go#L110-L124) when `--cloud-config` is not specified.

[GetServicePrincipalToken](https://github.com/kubernetes/kubernetes/blob/master/pkg/cloudprovider/providers/azure/azure.go#L157-L199) will raise an error if no valid secrets/tokens are found. So we just need to return empty config obj if `--cloud-config` is not set.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #49228

**Special notes for your reviewer**:
@githubvick 

**Release note**:

```release-note
fix bug when azure cloud provider configuration file is not specified
```
2017-08-10 00:53:24 -07:00
Brendan Burns e03f02a575 metadata improvements. 2017-07-31 23:54:22 +00:00
Kubernetes Submit Queue 9b8bc25838 Merge pull request #49081 from brendandburns/imds
Automatic merge from submit-queue (batch tested with PRs 49081, 49318, 49219, 48989, 48486)

Fix instance metadata service URL.

Small fix @colemickens @jackfrancis
2017-07-28 04:03:36 -07:00
Sylvain Rabot 499d6c3473 Azure: Allow VNet to be in a separate Resource Group
Define a new config VnetResourceGroup in order to be able to use a VNet
which is not in the same resource group as kubernetes.

Signed-off-by: Sylvain Rabot <s.rabot@lectra.com>
2017-07-27 18:41:09 +02:00
Di Xu 2cddfd0db9 fix bug when azure cloud provider configuration file is not specified 2017-07-20 17:29:09 +08:00
Kubernetes Submit Queue ea18935670 Merge pull request #45540 from edevil/azure_extra_logging
Automatic merge from submit-queue (batch tested with PRs 49083, 45540, 46862)

Add extra logging to azure API get calls

**What this PR does / why we need it**:

This PR adds extra logging for external calls to the Azure API, specifically get calls.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

This will help troubleshoot problems arising from the usage of this cloudprovider. For example, it looks like #43516 is caused by a call to the cloudprovider taking too much time.
2017-07-19 21:18:25 -07:00
Kubernetes Submit Queue ecadada7ef Merge pull request #48967 from jackfrancis/azure-lb-backoff
Automatic merge from submit-queue (batch tested with PRs 49218, 48253, 48967, 48460, 49230)

additional backoff in azure cloudprovider

Fixes #48971

**What this PR does / why we need it**:

We want to be able to opt in to backoff retry logic for kubelet-originating request behavior: node IP address resolution and node load balancer pool membership enforcement.

**Special notes for your reviewer**:

The use-case for this is azure cloudprovider clusters with large node counts, especially during cluster installation, or other scenarios when lots of nodes come online at once and attempt to register all resources with the backend API. To allow clusters at scale more control over the API request rate in-cluster, backoff config has the ability to meaningful slow down this rate, when appropriate.

**Release note**:

```additional backoff in azure cloudprovider
```
2017-07-19 20:05:34 -07:00
Brendan Burns 38b1b74f82 Fix up imds, also refactor for better testing. 2017-07-19 12:53:08 -07:00
André Cruz 4071a36c12 Add extra logging to azure API calls 2017-07-18 14:40:28 +01:00
Jack Francis f76ef29512 backing off az.getIPForMachine in az.NodeAddresses
also rate limiting the call to az.getVirtualMachine inside az.getIPForMachine
2017-07-14 17:13:40 -07:00
Jack Francis 2525ef9983 VirtualMachinesClient.Get backoff in lb pool logic
EnsureHostInPool() submits a GET to azure API for VM info. We’re seeing this on agent node kubelets and would like to enable configurable backoff engagement for 4xx responses to be able to slow down the rate of reconciliation, when appropriate.
2017-07-14 15:16:47 -07:00
Kubernetes Submit Queue df47592d5a Merge pull request #48854 from colemickens/msi
Automatic merge from submit-queue (batch tested with PRs 47066, 48892, 48933, 48854, 48894)

azure: msi: add managed identity field, logic

**What this PR does / why we need it**: Enables managed service identity support for the Azure cloudprovider. "Managed Service Identity" allows us to ask the Azure Compute infra to provision an identity for the VM. Users can then retrieve the identity and assign it RBAC permissions to talk to Azure ARM APIs for the purpose of the cloudprovider needs.

Per the commit text:
```
The azure cloudprovider will now use the Managed Service Identity
to retrieve access tokens for the Azure ARM APIs, rather than
requiring hard-coded, user-specified credentials.
```

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: n/a 

**Special notes for your reviewer**: none

**Release note**:

```release-note
azure: support retrieving access tokens via managed identity extension
```

cc: @brendandburns @jdumars @anhowe
2017-07-14 12:50:55 -07:00
Khaled Henidak & Andy Zhang 677e593d86 Add Azure managed disk support 2017-07-14 14:09:44 +08:00
Cole Mickens 8f55afd0cb azure: refactor azure.go to make auth reusable 2017-07-13 14:27:37 -07:00
Cole Mickens 4521c2312c azure: msi: add managed identity field, logic
The azure cloudprovider will now use the Managed Service Identity
to retrieve access tokens for the Azure ARM APIs, rather than
requiring hard-coded, user-specified credentials.
2017-07-13 14:27:37 -07:00
Kubernetes Submit Queue d230956280 Merge pull request #48243 from brendandburns/imds
Automatic merge from submit-queue (batch tested with PRs 48594, 47042, 48801, 48641, 48243)

Add initial support for the Azure instance metadata service.

Part of fixing #46632

@colemickens @rootfs @jdumars @kris-nova
2017-07-12 14:08:13 -07:00
Brendan Burns 29a0c6f56a Code updates for new SDK. 2017-07-12 06:09:31 -07:00
Brendan Burns 7644c6afc6 Add initial support for the Azure instance metadata service. 2017-07-06 06:56:39 -07:00
Cosmin Cojocar afafb3f231 Use the azure certificate password when decoding the certificate 2017-07-04 08:56:40 +02:00
Cosmin Cojocar 0235cb9e3c Fix dependencies order after rebase 2017-06-23 13:20:10 +02:00
Cosmin Cojocar fcdceb2e50 Add the pcks12 package to the build of Azure cloud provider 2017-06-23 12:19:56 +02:00
Cosmin Cojocar 2c8ec115db Fix tests after rebasing 2017-06-23 12:17:17 +02:00
Cosmin Cojocar 5462d06ce3 Add client cert authentication for Azure cloud provider 2017-06-23 12:17:17 +02:00
Chao Xu 60604f8818 run hack/update-all 2017-06-22 11:31:03 -07:00
Chao Xu f4989a45a5 run root-rewrite-v1-..., compile 2017-06-22 10:25:57 -07:00
Kubernetes Submit Queue 0f0e017ade Merge pull request #45473 from karataliu/AzureInternalLoadBalancerE2E
Automatic merge from submit-queue

Add E2E tests for Azure internal loadbalancer support, fix an issue for public IP resource deletion.

**What this PR does / why we need it**:

- Add E2E tests for Azure internal loadbalancer support: https://github.com/kubernetes/kubernetes/pull/43510
- Fix an issue that public IP resource not get deleted when switching from external loadbalancer to internal static loadbalancer.

**Special notes for your reviewer**:

1.  Add new Azure resource tag to Public IP resources to indicate kubernetes managed resources.
   Currently we determine whether the public IP resource should be deleted by looking at LoadBalancerIp property on spec. In the scenario 'Switching from external loadbalancer to internal loadbalancer with static IP', that value might have been updated for internal loadbalancer. So here we're to add an explicit tag for kubernetes managed resources.

2. Merge cleanupPublicIP logic into cleanupLoadBalancer

**Release note**:
NONE

CC @brendandburns @colemickens
2017-06-21 11:41:22 -07:00
Brendan Burns f07ac3efc6 Change Container permissions to Private. 2017-06-16 01:40:10 +00:00
Dong Liu f8ae27db57 Add E2E tests for Azure internal loadbalancer support, fix an issue for public IP resource deletion. 2017-06-15 10:52:18 +08:00
Kubernetes Submit Queue 67730881a6 Merge pull request #46940 from realfake/azure-cloud-controller-manager
Automatic merge from submit-queue

Azure for cloud-controller-manager

**What this PR does / why we need it**:
This implements the NodeAddressesByProviderID and InstanceTypeByProviderID methods used by the cloud-controller-manager to the Azure provider.

**Release note**:

```release-note
NONE
```
Addresses #47257
2017-06-10 17:28:44 -07:00
Jack Francis acb65170f3 preferring float32 for rate limit QPS param 2017-06-06 22:21:14 -07:00
Jack Francis 2accbbd618 go vet errata 2017-06-06 22:12:49 -07:00
Jack Francis 6d73a09dcc rate limiting everywhere
not waiting to rate limit until we get an error response from the API, doing so on initial request for all API requests
2017-06-06 22:09:57 -07:00
Jack Francis 148e923f65 az.getVirtualMachine already rate-limited
we don’t need to rate limit the calls _to_ it
2017-06-06 14:55:07 -07:00
Jack Francis ac931aa1e0 rate limiting on all azure sdk GET requests 2017-06-06 11:19:29 -07:00
Jack Francis af5ce2fcc5 test coverage
We want to ensure that backoff and rate limit configuration is opt-in
2017-06-06 09:50:28 -07:00
Jack Francis 3f3aa279b9 configurable backoff
- leveraging Config struct (—cloud-config) to store backoff and rate limit on/off and performance configuration
- added add’l error logging
- enabled backoff for vm GET requests
2017-06-05 16:06:50 -07:00
realfake 7bc205fc59 Implement *ByProviderID methods 2017-06-05 22:56:09 +02:00
realfake fc748662ef Add splitProviderID for azure 2017-06-05 22:56:09 +02:00
Jack Francis 7e6c689e58 backoff logging, error handling, wait.ConditionFunc
- added info and error logs for appropriate backoff conditions/states
- rationalized log idioms across all resource requests that are backoff-enabled
- processRetryResponse as a wait.ConditionFunc needs to supress errors if it wants the caller to continue backing off
2017-06-02 15:35:20 -07:00
Jack Francis c5dd95fc22 update-bazel.sh mods 2017-06-02 09:59:07 -07:00
Jack Francis 17f8dc53af two optimizations
- removed unnecessary return statements
- optimized HTTP response code evaluations as numeric comparisons
2017-06-01 13:58:11 -07:00
Jack Francis c95af06154 errata
arg cruft in CreateOrUpdateSGWithRetry function declaration
2017-05-31 12:03:22 -07:00
Jack Francis c6c6cc790e errata, wait.ExponentialBackoff, regex HTTP codes
- corrected Copyright copy/paste
- now actually implementing exponential backoff instead of regular interval retries
- using more general HTTP response code success/failure determination (e.g., 5xx for retry)
- net/http constants ftw
2017-05-31 11:53:02 -07:00
Jack Francis f200f9a1e8 Azure cloudprovider retry using flowcontrol
An initial attempt at engaging exponential backoff for API error responses.

Uses k8s.io/client-go/util/flowcontrol; implementation inspired by GCE
cloudprovider backoff.
2017-05-30 14:50:31 -07:00
Nick Sardo 87a5edd2cd Initialize cloud providers with a K8s clientBuilder 2017-05-17 14:38:25 -07:00
Zihong Zheng 7ed716a997 Change to use ESIPP first class fields and update comments 2017-05-12 10:59:00 -07:00
Kubernetes Submit Queue a86392a326 Merge pull request #45333 from colemickens/cmpr-cpfix
Automatic merge from submit-queue (batch tested with PRs 45382, 45384, 44781, 45333, 45543)

azure: improve user agent string

**What this PR does / why we need it**: the UA string doesn't actually contain "kubernetes" in it

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**: none 

**Release note**:

```release-note
NONE
```

cc: @brendandburns
2017-05-10 17:47:45 -07:00
Cole Mickens 3fc0c05d83 azure: instances: remove dead code 2017-05-09 00:00:12 -07:00
Cole Mickens c349d36da3 azure: loadbalancer: fix sourceAddrPrefix support
Fixes support for multiple instances of loadBalancerSourceRanges.
Previously, the names of the rules for each address range conflicted
causing only one to be applied. Now each gets a unique name.
2017-05-08 23:58:29 -07:00
Cole Mickens 355c2be7a0 azure: loadbalancer: support UDP svc ports+rules 2017-05-08 23:58:25 -07:00
Cole Mickens 8b50b83067 azure: loadbalancer: respect svc sessionaffinity
If the Service spec sets sessionAffinity, reflects that in the
configuration specified for the Azure loadbalancer.
2017-05-08 20:08:05 -07:00
Cole Mickens b224e85ebd azure: improve user agent string 2017-05-04 01:10:13 -07:00
Chris Hoffman 04e2deeb28
Prevent deadlock on azure zone fetch in presence of failure 2017-05-01 17:12:12 -05:00
Kubernetes Submit Queue d2060ade08 Merge pull request #43510 from karataliu/azurelb
Automatic merge from submit-queue (batch tested with PRs 44645, 44639, 43510)

Add support for Azure internal load balancer

**Which issue this PR fixes**
Fixes https://github.com/kubernetes/kubernetes/issues/38901

**What this PR does / why we need it**:
This PR is to add support for Azure internal load balancer

Currently when exposing a serivce with LoadBalancer type, Azure provider would assume that it requires a public load balancer.
Thus it will request a public IP address resource, and expose the service via that public IP.
In this case we're not able to apply private IP addresses (within the cluster virtual network) for the service.

**Special notes for your reviewer**:
1. Clarification:
a. 'LoadBalancer' refers to an option for 'type' field under ServiceSpec. See https://kubernetes.io/docs/resources-reference/v1.5/#servicespec-v1
b. 'Azure LoadBalancer' refers a type of Azure resource. See https://docs.microsoft.com/en-us/azure/load-balancer/load-balancer-overview

2. For a single Azure LoadBalancer, all frontend ip should reference either a subnet or publicIpAddress, which means that it could be either an Internet facing load balancer or an internal one.
For current provider, it would create an Azure LoadBalancer with generated '${loadBalancerName}' for all services with 'LoadBalancer' type.
This PR introduces name '${loadBalancerName}-internal' for a separate Azure Load Balancer resource, used by all the service that requires internal load balancers.

3. This PR introduces a new annotation for the internal load balancer type behaviour:
a. When the annotaion value is set to 'false' or not set, it falls back to the original behaviour, assuming that user is requesting a public load balancer;
b. When the annotaion value is set to 'true', the following rule applies depending on 'loadBalancerIP' field on ServiceSpec:
   - If 'loadBalancerIP' is not set, it will create a load balancer rule with dynamic assigned frontend IP under the cluster subnet;
   - If 'loadBalancerIP' is set, it will create a load balancer rule with the frontend IP set to the given value. If the given value is not valid, that is, it does not falls into the cluster subnet range, then the creation will fail.

4. Users may change the load balancer type by applying the annotation to the service at runtime.
In this case, the load balancer rule would need to be 'switched' between the internal one and external one.
For example, it we have a service with internal load balancer, and then user removes the annotation, making it to a public one. Before we creating rules in the public Azure LoadBalancer, we'll need to clean up rules in the internal Azure LoadBalancer.

**Release note**:
2017-04-18 23:22:04 -07:00
Mike Danese a05c3c0efd autogenerated 2017-04-14 10:40:57 -07:00
Dong Liu f20e9bf66d Update message log level for azure_loadbalancer. 2017-04-07 14:32:29 +08:00
Cole Mickens 21250f1748 azure: reduce poll delay for all clients to 5 sec 2017-03-28 18:18:36 -07:00
Cole Mickens 5c21498dbf run update-bazel.sh 2017-03-28 18:08:22 -07:00
Cole Mickens 6eb7a1a366 azure: add k8s info to user-agent string 2017-03-28 15:17:03 -07:00
wlan0 a68c783dc8 Use ProviderID to address nodes in the cloudprovider
The cloudprovider is being refactored out of kubernetes core. This is being
done by moving all the cloud-specific calls from kube-apiserver, kubelet and
kube-controller-manager into a separately maintained binary(by vendors) called
cloud-controller-manager. The Kubelet relies on the cloudprovider to detect information
about the node that it is running on. Some of the cloudproviders worked by
querying local information to obtain this information. In the new world of things,
local information cannot be relied on, since cloud-controller-manager will not
run on every node. Only one active instance of it will be run in the cluster.

Today, all calls to the cloudprovider are based on the nodename. Nodenames are
unqiue within the kubernetes cluster, but generally not unique within the cloud.
This model of addressing nodes by nodename will not work in the future because
local services cannot be queried to uniquely identify a node in the cloud. Therefore,
I propose that we perform all cloudprovider calls based on ProviderID. This ID is
a unique identifier for identifying a node on an external database (such as
the instanceID in aws cloud).
2017-03-27 23:13:13 -07:00
Dong Liu ed36aba8ba Add separate func 'cleanupLoadBalancer' and 'cleanupPublicIP' for Azure. 2017-03-27 15:19:16 +08:00
Dong Liu 54664d08dd Update reconcileSecurityGroup logic for Azure, add tests. 2017-03-27 12:52:21 +08:00
Dong Liu 4f44bf5e5a Update EnsureLoadBalancer, EnsureLoadBalancerDeleted for azure. 2017-03-27 12:51:56 +08:00
Dong Liu 7bf15f66fe Add annotation for internal load balancer type in Azure. 2017-03-27 12:39:29 +08:00
Kubernetes Submit Queue 3fcb7cb377 Merge pull request #42170 from rootfs/azure-file-prv
Automatic merge from submit-queue (batch tested with PRs 43642, 43170, 41813, 42170, 41581)

Enable storage class support in Azure File volume

**What this PR does / why we need it**:
Support StorageClass in Azure file volume

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
Support StorageClass in Azure file volume

```
2017-03-24 19:04:28 -07:00
Kubernetes Submit Queue 264c8b4340 Merge pull request #42034 from brendandburns/azure
Automatic merge from submit-queue (batch tested with PRs 41139, 41186, 38882, 37698, 42034)

Add support for bring-your-own ip address for Services on Azure

@colemickens @codablock
2017-03-24 12:33:29 -07:00
Brendan Burns ea23cabfa0 Add support for bring-your-own ip address. 2017-03-14 20:36:55 -07:00
Huamin Chen 6782a48dfa Enable storage class support in Azure File volume
Signed-off-by: Huamin Chen <hchen@redhat.com>
2017-02-27 15:34:37 -05:00
Cole Mickens af1389e232 fixup: clarify what's optional and why 2017-02-23 11:46:16 -08:00
Cole Mickens 3b7ad5c7f6 azure: document config file 2017-02-23 10:59:04 -08:00
Alexander Block bf28a9be09 Set NetworkInterfaces and Subnets to nil before updating Azure security groups 2017-01-25 09:01:11 +01:00
Kubernetes Submit Queue 5356a16f01 Merge pull request #40066 from vwfs/reduce_azure_polling_time
Automatic merge from submit-queue

Set custom PollingDelay of 5 seconds for Azure VirtualMachinesClient

The default polling delay of 1 minute results in very long delays when
an Azure Disk is attached to a node. It gets worse as go-autorest
doubles the default delay to 2 minutes.

Please see: https://github.com/kubernetes/kubernetes/issues/35180#issuecomment-273085063

Only the PollingDelay for VirtualMachinesClient is modified here to
avoid too much pressure on Azure quotas.

Release Nodes:
```release-note
Reduce time needed to attach Azure disks
```
2017-01-23 01:16:25 -08:00
Alexander Block ff38ac2689 Set custom PollingDelay of 5 seconds for Azure VirtualMachinesClient
The default polling delay of 1 minute results in very long delays when
an Azure Disk is attached to a node. It gets worse as go-autorest
doubles the default delay to 2 minutes.

Please see: https://github.com/kubernetes/kubernetes/issues/35180#issuecomment-273085063

Only the PollingDelay for VirtualMachinesClient is modified here to
avoid too much pressure on Azure quotas.
2017-01-18 09:24:28 +01:00
Antoine Pelisse ca964a1872 Update OWNERS approvers and reviewers: pkg/cloudprovider 2017-01-17 13:42:07 -08:00
deads2k 6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00
Huamin Chen 3a2b9721e3 fix #38362: create blob vhds container if not exists
Signed-off-by: Huamin Chen <hchen@redhat.com>
2017-01-06 15:50:14 +00:00
Huamin Chen 307de20753 Azure disk volume: Do not report error when deleting an attached volume 2017-01-06 15:37:59 +00:00
Jeff Grafton 20d221f75c Enable auto-generating sources rules 2017-01-05 14:14:13 -08:00
Mike Danese 161c391f44 autogenerated 2016-12-29 13:04:10 -08:00
Kubernetes Submit Queue 0cd3cb7598 Merge pull request #38334 from mogthesprog/morganj/remove-azure-subnet-routetable-check
Automatic merge from submit-queue (batch tested with PRs 38638, 38334)

Remove Azure Subnet RouteTable check

**What this PR does / why we need it**:

PR Removes the subnet configuration check for Azure cloudprovider. The subnet check ensures that the subnet is associated with the Route Table. However if the VNET is in a different Azure Resource Group then the check fails, even if the subnet is already valid. This a stop gap fix, to allow Kubernetes to be deployed to Custom VNETs in Azure, that may reside in a different resource group to the cluster.

fixes #38134 

@colemickens
2016-12-13 22:36:36 -08:00
Mike Danese c87de85347 autoupdate BUILD files 2016-12-12 13:30:07 -08:00
Morgan Jones f82e872a25 Remove Azure Subnet RouteTable check 2016-12-10 21:26:15 +00:00
Angus Lees 8a7e103191 providers: Remove long-deprecated Instances.List()
This method has been unused by k8s for some time, and yet is the last
piece of the cloud provider API that encourages provider names to be
human-friendly strings (this method applies a regex to instance names).

Actually removing this deprecated method is part of a long effort to
migrate from instance names to instance IDs in at least the OpenStack
provider plugin.
2016-12-10 22:36:12 +11:00
Brendan Burns 91f19e3dfc Add an azure container registry credential provider. 2016-12-08 21:38:11 -08:00
Brendan Burns a8c5c8123e Update azure cloud provider for new azure SDK 2016-12-08 21:36:00 -08:00
Kubernetes Submit Queue cffaf1b71b Merge pull request #31321 from anguslees/lb-nodes
Automatic merge from submit-queue (batch tested with PRs 37328, 38102, 37261, 31321, 38146)

Pass full Node objects to provider LoadBalancer methods
2016-12-05 20:16:53 -08:00
Kubernetes Submit Queue f7352aeb61 Merge pull request #36882 from vwfs/azure_lb_backendpool
Automatic merge from submit-queue (batch tested with PRs 38076, 38137, 36882, 37634, 37558)

Allow backendpools in Azure Load Balancers which are not owned by cloud provider

**What this PR does / why we need it**: It fixes #36880

**Which issue this PR fixes**: fixes #36880

**Special notes for your reviewer**:

**Release note**:
```release-note
Allow backendpools in Azure Load Balancers which are not owned by cloud provider
```

Instead of bailing out when we find another backend pool, we just ignore
other backend pools and add ours to the list of existing.

Fixes #36880
2016-12-05 19:25:53 -08:00
Angus Lees a718f78a5d azure: Update LB API hosts->nodes
Update EnsureLoadBalancer/UpdateLoadBalancer API to use node objects.
2016-12-01 09:53:54 +11:00
Chao Xu bcc783c594 run hack/update-all.sh 2016-11-23 15:53:09 -08:00
Chao Xu c962c2602a dependencies: pkg/cloudprovider 2016-11-23 15:53:09 -08:00
Alexander Block 2acc7d5894 Allow backendpools in Azure Load Balancers which are not owned by cloud provider
Instead of bailing out when we find another backend pool, we just ignore
other backend pools and add ours to the list of existing.

Fixes #36880
2016-11-21 22:36:27 +01:00
Cole Mickens 6357c391f9 azure: support nics with multiple ipconfigs 2016-11-15 13:25:58 -08:00
Brendan Burns 610f38cb4a Add support for service address ranges to Azure load balancers. 2016-11-12 20:59:45 -08:00
Brendan Burns 8b9348e176 Add support for SourceIP preservation in Azure LBs 2016-11-10 10:03:04 -08:00
Cole Mickens 23454c1774 azure: loadbalancer rules use DSR 2016-11-05 20:33:37 -07:00
Kubernetes Submit Queue 3d33b45e43 Merge pull request #30091 from rootfs/azure-storage
Automatic merge from submit-queue

support Azure disk dynamic provisioning

azure disk dynamic provisioning

A screen shot 

``` console
$ kubectl create -f examples/experimental/persistent-volume-provisioning/azure-dd.yaml
storageclass "slow" created
$ kubectl create -f examples/experimental/persistent-volume-provisioning/claim1.json
persistentvolumeclaim "claim1" created
$ kubectl describe pvc
Name:       claim1
Namespace:  default
Status:     Bound
Volume:     pvc-de7150d1-6a37-11e6-aec9-000d3a12e034
Labels:     <none>
Capacity:   3Gi
Access Modes:   RWO
$ kubectl create -f pod.yaml
replicationcontroller "nfs-server" created
$ kubectl describe pod
Name:       nfs-server-b9w6x
Namespace:  default
Node:       rootfs-dev/172.24.0.4
Start Time: Wed, 24 Aug 2016 19:46:21 +0000
Labels:     role=nfs-server
Status:     Running
IP:     172.17.0.2
Controllers:    ReplicationController/nfs-server
Containers:
  nfs-server:
    Container ID:   docker://be6f8c0e26dc896d4c53ef0d21c9414982f0b39a10facd6b93a255f9e1c3806c
    Image:      nginx
    Image ID:       docker://bfdd4ced794ed276a28cf56b233ea58dec544e9ca329d796cf30b8bcf6d39b3f
    Port:       
    State:      Running
      Started:      Wed, 24 Aug 2016 19:49:19 +0000
    Ready:      True
    Restart Count:  0
    Volume Mounts:
      /exports from mypvc (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-9o0fj (ro)
    Environment Variables:  <none>
Conditions:
  Type      Status
  Initialized   True 
  Ready     True 
  PodScheduled  True 
Volumes:
  mypvc:
    Type:   PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  claim1
    ReadOnly:   false
  default-token-9o0fj:
    Type:   Secret (a volume populated by a Secret)
    SecretName: default-token-9o0fj
QoS Class:  BestEffort
Tolerations:    <none>
Events:
  FirstSeen LastSeen    Count   From            SubobjectPath           Type        Reason      Message
  --------- --------    -----   ----            -------------           --------    ------      -------
  11m       11m     1   {default-scheduler }                    Normal      Scheduled   Successfully assigned nfs-server-b9w6x to rootfs-dev
  9m        9m      1   {kubelet rootfs-dev}                    Warning     FailedMount Unable to mount volumes for pod "nfs-server-b9w6x_default(6eb7fd98-6a33-11e6-aec9-000d3a12e034)": timeout expired waiting for volumes to attach/mount for pod "nfs-server-b9w6x"/"default". list of unattached/unmounted volumes=[mypvc]
  9m        9m      1   {kubelet rootfs-dev}                    Warning     FailedSync  Error syncing pod, skipping: timeout expired waiting for volumes to attach/mount for pod "nfs-server-b9w6x"/"default". list of unattached/unmounted volumes=[mypvc]
  8m        8m      1   {kubelet rootfs-dev}    spec.containers{nfs-server} Normal      Pulling     pulling image "nginx"
  8m        8m      1   {kubelet rootfs-dev}    spec.containers{nfs-server} Normal      Pulled      Successfully pulled image "nginx"
  8m        8m      1   {kubelet rootfs-dev}    spec.containers{nfs-server} Normal      Created     Created container with docker id be6f8c0e26dc
  8m        8m      1   {kubelet rootfs-dev}    spec.containers{nfs-server} Normal      Started     Started container with docker id be6f8c0e26dc

```

@colemickens @brendandburns
2016-11-01 17:27:14 -07:00
Jing Xu abbde43374 Add sync state loop in master's volume reconciler
At master volume reconciler, the information about which volumes are
attached to nodes is cached in actual state of world. However, this
information might be out of date in case that node is terminated (volume
is detached automatically). In this situation, reconciler assume volume
is still attached and will not issue attach operation when node comes
back. Pods created on those nodes will fail to mount.

This PR adds the logic to periodically sync up the truth for attached volumes kept in the actual state cache. If the volume is no longer attached to the node, the actual state will be updated to reflect the truth. In turn, reconciler will take actions if needed.

To avoid issuing many concurrent operations on cloud provider, this PR
tries to add batch operation to check whether a list of volumes are
attached to the node instead of one request per volume.

More details are explained in PR #33760
2016-10-28 09:24:53 -07:00
Huamin Chen 1d52719465 azure disk volume: support storage class and dynamic provisioning
Signed-off-by: Huamin Chen <hchen@redhat.com>
2016-10-28 13:31:47 +00:00
Huamin Chen fd56cc1adb add Azure storage and blob service API to support Azure disk dynamic provisioning
Signed-off-by: Huamin Chen <hchen@redhat.com>
2016-10-27 17:42:44 +00:00
Mike Danese 3b6a067afc autogenerated 2016-10-21 17:32:32 -07:00
Kubernetes Submit Queue cd44cec587 Merge pull request #34765 from ivan4th/fix-more-typos
Automatic merge from submit-queue

Fix typos
2016-10-19 00:21:11 -07:00
Ivan Shvedunov 2b427f7d59 Fix typos 2016-10-14 00:29:50 +03:00
Cole Mickens c7237c8624 azure: lower log priority for skipped nic update message 2016-10-13 08:35:12 -07:00
Cole Mickens 113c5e3475 azure: filter load balancer backend nodes to PrimaryAvailabilitySet if set 2016-10-12 15:01:17 -07:00
Justin Santa Barbara 54195d590f Use strongly-typed types.NodeName for a node name
We had another bug where we confused the hostname with the NodeName.

To avoid this happening again, and to make the code more
self-documenting, we use types.NodeName (a typedef alias for string)
whenever we are referring to the Node.Name.

A tedious but mechanical commit therefore, to change all uses of the
node name to use types.NodeName

Also clean up some of the (many) places where the NodeName is referred
to as a hostname (not true on AWS), or an instanceID (not true on GCE),
etc.
2016-09-27 10:47:31 -04:00
Huamin Chen dea4b0226d support Azure data disk volume
Signed-off-by: Huamin Chen <hchen@redhat.com>
2016-08-23 13:23:07 +00:00
Cole Mickens 2ebffb431d implement azure cloudprovider 2016-07-26 14:50:33 -07:00