Commit Graph

1074 Commits (01bfbb5fa0462189932b704be32401822a991627)

Author SHA1 Message Date
Sebastian Scheele 0be5e6041b AWS: run k8s master in different account or on a provider Currently the master and the nodes must run in the same account. With this change the master can run in a different AWS account or somewhere else.
Set the vpcID when dummy is created (+1 squashed commit)
Squashed commits:
[0b1ac6e83e] Use the VPC flag and KubernetesClusterTag as identifier (+1 squashed commit)
Squashed commits:
[962bc56e38] Remove again availabilityZone and fix naming (+1 squashed commit)
Squashed commits:
[e3d1b41807] Use the VCID flag as identifier (+1 squashed commit)
Squashed commits:
[5b99fe6243] Add flag for external master
2017-03-01 08:46:46 -08:00
Kubernetes Submit Queue c6d11c778f Merge pull request #41695 from justinsb/shared_tag
Automatic merge from submit-queue (batch tested with PRs 41921, 41695, 42139, 42090, 41949)

AWS: Support shared tag `kubernetes.io/cluster/<clusterid>`

We recognize an additional cluster tag:

kubernetes.io/cluster/<clusterid>

This now allows us to share resources, in particular subnets.

In addition, the value is used to track ownership/lifecycle.  When we
create objects, we record the value as "owned".

We also refactor out tags into its own file & class, as we are touching
most of these functions anyway.

```release-note
AWS: Support shared tag `kubernetes.io/cluster/<clusterid>`
```
2017-03-01 04:10:01 -08:00
Kubernetes Submit Queue 7592564505 Merge pull request #41702 from justinsb/fix_34583
Automatic merge from submit-queue (batch tested with PRs 38676, 41765, 42103, 41833, 41702)

AWS: Skip instances that are taggged as a master

We recognize a few AWS tags, and skip over masters when finding zones
for dynamic volumes.  This will fix #34583.

This is not perfect, in that really the scheduler is the only component
that can correctly choose the zone, but should address the common
problem.

```release-note
AWS: Do not consider master instance zones for dynamic volume creation
```
2017-03-01 01:44:12 -08:00
Justin Santa Barbara 0b5ae5391e AWS: Support shared tag
We recognize an additional cluster tag:

kubernetes.io/cluster/<clusterid>

This now allows us to share resources, in particular subnets.

In addition, the value is used to track ownership/lifecycle.  When we
create objects, we record the value as "owned".

We also refactor out tags into its own file & class, as we are touching
most of these functions anyway.
2017-02-27 16:30:12 -05:00
Kubernetes Submit Queue 7224805c55 Merge pull request #41992 from colemickens/cmpr-azure-config-doc
Automatic merge from submit-queue (batch tested with PRs 35408, 41915, 41992, 41964, 41925)

azure: document config file (+ remove unused field)

**What this PR does / why we need it**:
* documents the config file used by the Azure cloudprovider
* removes an unused field that shouldn't have been added

```release-note
NONE
```
2017-02-26 18:07:57 -08:00
Kubernetes Submit Queue 9a218d406b Merge pull request #41309 from kars7e/add-cafile-openstack
Automatic merge from submit-queue (batch tested with PRs 40932, 41896, 41815, 41309, 41628)

Add custom CA file to openstack cloud provider config

**What this PR does / why we need it**: Adds ability to specify custom CA bundle file to verify OpenStack endpoint against. Useful in tests and PoC deployments. Similar to what https://github.com/kubernetes/kubernetes/pull/35488 did for authentication.  


**Which issue this PR fixes**: None

**Special notes for your reviewer**: Based on https://github.com/kubernetes/kubernetes/pull/35488 which added support for custom CA file for authentication.

**Release note**:
2017-02-26 08:10:00 -08:00
Kubernetes Submit Queue 3adc12c5f5 Merge pull request #41113 from vmware/AddDatastoreParamForDynamicProvisioning
Automatic merge from submit-queue

Fix for Support selection of datastore for dynamic provisioning in vS…

Fixes #40558

Current vSphere Cloud provider doesn't allow a user to select a datastore for dynamic provisioning. All the volumes are created in default datastore provided by the user in the global vsphere configuration file.

With this fix, the user will be able to provide the datastore in the storage class definition. This will allow the volumes to be created in the datastore specified by the user in the storage class definition. This field is optional. If no datastore is specified, the volume will be created in the default datastore specified in the global config file.

For example:

User creates a storage class with the datastore

kind: StorageClass
apiVersion: storage.k8s.io/v1beta1
metadata:
name: slow
provisioner: kubernetes.io/vsphere-volume
parameters:
diskformat: thin
datastore: VMFSDatastore
Now the volume will be created in the datastore - "VMFSDatastore" specified by the user.

If the user creates a storage class without any datastore

kind: StorageClass
apiVersion: storage.k8s.io/v1beta1
metadata:
name: slow
provisioner: kubernetes.io/vsphere-volume
parameters:
diskformat: thin
Now the volume will be created in the datastore which in the global configuration file (vsphere.conf)

@pdhamdhere @kerneltime
2017-02-23 22:10:42 -08: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
Kubernetes Submit Queue 616d929828 Merge pull request #38702 from jsafrane/gce-provisioning-existing
Automatic merge from submit-queue (batch tested with PRs 38702, 41810, 41778, 41858, 41872)

gce: Reuse unsuccessfully provisioned volumes.

GCE PD names generated by Kubernetes are guaranteed to be unique - they
contain name of the cluster and UID of the PVC that is behind it.
Presence of a GCE PD that has the same name as we want to provision
indicates that previous provisioning did not go well and most probably
the controller manager process was restarted in the meantime.

Kubernetes should reuse this volume and not provision a new one.

Fixes #38681
2017-02-23 07:54:33 -08:00
Balu Dontu 12f75f0b86 Fix for Support selection of datastore for dynamic provisioning in vSphere 2017-02-21 19:04:45 +00:00
Kubernetes Submit Queue 9c0e46bdff Merge pull request #40843 from luomiao/photon-cloud-provider-authentication-update
Automatic merge from submit-queue (batch tested with PRs 41756, 36344, 34259, 40843, 41526)

Update Photon Controller cloud provider for authentication support

Resolve Issue: [#40755](https://github.com/kubernetes/kubernetes/issues/40755)
1. Update the configuration file for Photon Controller cloud provider
2. Only master nodes can communicate with Photon Controller endpoint
3. Enable support for authentication-enabled Photon Controller endpoint
4. Update NodeAddresses function for query from local node

New format of photon controller config file:
```
[Global]
target = https://[LOAD_BALANCER_IP]:443
project = [PROJECT ID]
overrideIP = true
vmID = [LOCAL VM ID]
authentication = true
```
This config file will be automatically created by Photon Controller cluster management.

If authentication file is set to true, then a pc_login_info file should be placed under /etc/kubernetes with username and password.
This file can be created by user directly.
Or the user can choose to use kubernetes secret and a handling pod to avoid directly login to master nodes. This usage will be available with Photon Controller 1.2.
This is a temporary solution before metadata service becomes available in Photon Controller.
2017-02-20 13:39:39 -08:00
Kubernetes Submit Queue 8738e36c70 Merge pull request #34259 from liggitt/node-dns
Automatic merge from submit-queue (batch tested with PRs 41756, 36344, 34259, 40843, 41526)

add InternalDNS/ExternalDNS node address types

This PR adds internal/external DNS names to the types of NodeAddresses that can be reported by the kubelet.

will spawn follow up issues for cloud provider owners to include these when possible

```release-note
Nodes can now report two additional address types in their status: InternalDNS and ExternalDNS. The apiserver can use `--kubelet-preferred-address-types` to give priority to the type of address it uses to reach nodes.
```
2017-02-20 13:39:37 -08:00
Angus Lees c077c30004 Migrate rackspace/gophercloud -> gophercloud/gophercloud
This change migrates the 'openstack' provider and 'keystone'
authenticator plugin to the newer gophercloud/gophercloud library.

Note the 'rackspace' provider still uses rackspace/gophercloud.

Fixes #30404
2017-02-20 11:03:05 +11:00
Justin Santa Barbara b1079f8813 AWS: Skip instances that are taggged as a master
We recognize a few AWS tags, and skip over masters when finding zones
for dynamic volumes.  This will fix #34583.

This is not perfect, in that really the scheduler is the only component
that can correctly choose the zone, but should address the common
problem.
2017-02-19 01:45:20 -05:00
Kubernetes Submit Queue 6823803772 Merge pull request #41239 from vmware/e2eTestsUpdate-v2
Automatic merge from submit-queue (batch tested with PRs 37137, 41506, 41239, 41511, 37953)

e2e test for storage class diskformat verification for vsphere cloud provider

**What this PR does / why we need it**:
This PR adds a new e2e test for vsphere cloud provider.
Test is to verify diskformat specified in storage-class is being honored while volume creation.

Steps:

1. Create StorageClass with diskformat set to valid type (supported options are `eagerzeroedthick`, `zeroedthick` and `thin`)
2. Create PVC which uses the StorageClass created in step 1.
3. Wait for PV to be provisioned.
4. Wait for PVC's status to become Bound
5. Create POD using PVC on specific node.
6. Wait for Disk to be attached to the node.
7. Get node VM's devices and find PV's Volume Disk.
8. Get Backing Info of the Volume Disk and obtain Property of `VirtualDiskFlatVer2BackingInfo` - `EagerlyScrub` and `ThinProvisioned`
9. Based on the value of `EagerlyScrub` and `ThinProvisioned`, verify if diskformat is correct.
10. Delete POD and Wait for Volume Disk to be detached from the Node.
11. Delete PVC, PV and Storage Class



**Which issue this PR fixes** *
fixes #

**Special notes for your reviewer**:
Test is executed against v1.6.0-alpha.1
Test is failing on v1.4.8

**Release Note**
```release-note
NONE
```
@kerneltime @BaluDontu @abrarshivani please review this PR
2017-02-15 20:05:09 -08:00
Kubernetes Submit Queue 17e745631a Merge pull request #41455 from gnufied/fix-aws-device-allocator
Automatic merge from submit-queue

Fix AWS device allocator to only use valid device names

According to
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/device_naming.html
we can only use /dev/xvd[b-c][a-z] as device names - so we can only
allocate upto 52 ebs volumes on a node.

fixes #41453 

cc @justinsb  @kubernetes/sig-storage-pr-reviews
2017-02-15 06:47:07 -08:00
Kubernetes Submit Queue eab039d746 Merge pull request #39735 from NickrenREN/openstack-code-optimize
Automatic merge from submit-queue (batch tested with PRs 40297, 41285, 41211, 41243, 39735)

fix variables in openstack.go to keep camel casing and remove unused var
2017-02-15 03:25:16 -08:00
divyenpatel cdb48fb6a0 adding e2e test for storage class diskformat verification
adding govmomi dep to test/e2e/BUILD
adding golang.org/x/net/context to e2e deps
addressed review comments
addressed 2nd round of review comments

addressed review comments regarding KubeDescribe tagging
2017-02-14 21:08:53 -08:00
Hemant Kumar 73370239d2 Fix AWS device allocator to only use valid device names
According to
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/device_naming.html
we can only use /dev/xvd[b-c][a-z] as device names - so we can only
allocate upto 52 ebs volumes on a node.
2017-02-14 22:33:26 -05:00
Kubernetes Submit Queue 16a0a0b975 Merge pull request #41034 from rootfs/gce-instance
Automatic merge from submit-queue (batch tested with PRs 41337, 41375, 41363, 41034, 41350)

use instance's Name to attach gce disk

**What this PR does / why we need it**:
fix #40427
**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #40427

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-02-14 09:11:25 -08:00
Karol Stepniewski e3c8a0ceb6 Add custom CA file to openstack cloud provider config
In cases where insecure OpenStack endpoint is to be used
(e.g., when testing), gophercloud will fail to connect
to such endpoints. This patch adds support for custom CA
file configuration option, which, when provided, will
make gophercloud validate OpenStack endpoint against
certificate(s) read from file specified in that option.
2017-02-13 15:54:02 -08:00
Kubernetes Submit Queue 93bd6b3b9f Merge pull request #40892 from hpcloud/vsphere_findbyuuid
Automatic merge from submit-queue (batch tested with PRs 41223, 40892, 41220, 41207, 41242)

Fixes #40819 and Fixes #33114

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

Start looking up the virtual machine by it's UUID in vSphere again. Looking up by IP address is problematic and can either not return a VM entirely, or could return the wrong VM.

Retrieves the VM's UUID in one of two methods - either by a `vm-uuid` entry in the cloud config file on the VM, or via sysfs. The sysfs route requires root access, but restores the previous functionality.

Multiple VMs in a vCenter cluster can share an IP address - for example, if you have multiple VM networks, but they're all isolated and use the same address range. Additionally, flannel network address ranges can overlap.

vSphere seems to have a limitation of reporting no more than 16 interfaces from a virtual machine, so it's possible that the IP address list on a VM is completely untrustworthy anyhow - it can either be empty (because the 16 interfaces it found were veth interfaces with no IP address), or it can report the flannel IP.

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

Fixes #40819
Fixes #33114

**Special notes for your reviewer**:

**Release note**:

```release-note
Reverts to looking up the current VM in vSphere using the machine's UUID, either obtained via sysfs or via the `vm-uuid` parameter in the cloud configuration file.
```
2017-02-10 13:35:42 -08:00
Robert Roland 53a009302a Fixes #40819
Start looking up the virtual machine by it's UUID in vSphere again. Looking up by IP address is problematic and can either not return a VM entirely, or could return the wrong VM.

Retrieves the VM's UUID in one of two methods - either by a `vm-uuid` entry in the cloud config file on the VM, or via sysfs. The sysfs route requires root access, but restores the previous functionality.

Multiple VMs in a vCenter cluster can share an IP address - for example, if you have multiple VM networks, but they're all isolated and use the same address range. Additionally, flannel network address ranges can overlap.

vSphere seems to have a limitation of reporting no more than 16 interfaces from a virtual machine, so it's possible that the IP address list on a VM is completely untrustworthy anyhow - it can either be empty (because the 16 interfaces it found were veth interfaces with no IP address), or it can report the flannel IP.
2017-02-09 22:55:37 -08:00
Kubernetes Submit Queue 052f3b9d4c Merge pull request #40118 from vmware/FixdetachVolumeOnNodeOff
Automatic merge from submit-queue (batch tested with PRs 41037, 40118, 40959, 41084, 41092)

Fix for detach volume when node is not present/ powered off

Fixes #33061 
When a vm is reported as no longer present in cloud provider and is deleted by node controller, there are no attempts to detach respective volumes. For example, if a VM is powered off or paused, and pods are migrated to other nodes. In the case of vSphere, the VM cannot be started again because the VM still holds mount points to volumes that are now mounted to other VMs.

In order to re-join this node again, you will have to manually detach these volumes from the powered off vm before starting it.

The current fix will make sure the mount points are deleted when the VM is powered off. Since all the mount points are deleted, the VM can be powered on again.

This is a workaround proposal only. I still don't see the kubernetes issuing a detach request to the vsphere cloud provider which should be the case. (Details in original issue #33061 )

@luomiao @kerneltime @pdhamdhere @jingxu97 @saad-ali
2017-02-09 16:44:40 -08:00
Kubernetes Submit Queue 310b1e2e2c Merge pull request #41062 from jsafrane/gce-owners
Automatic merge from submit-queue

Add OWNERS file for GCE cloud provider

GCE cloud provider does not have OWNERS file and all PRs need to be approved by owner of pkg/cloudprovider, which is currently only @mikedanese. Adding more options would be helpful to speed up reviews.

Feel free to add/remove some names, this first version is just my qualified guess. It's hard to distinguish generic Kubernetes refactoring from real cloud provider work in git log.

```release-note
NONE
```
2017-02-09 11:20:21 -08:00
Balu Dontu 9fe3cf9ec3 Fix for detach volume when node is not present/ powered off 2017-02-07 13:36:36 -08:00
divyenpatel 7b17f91867 updating existing e2e tests and adding new e2e tests for vsphere cloud provider
addressed review comments

Addressed review comment for pv_reclaimpolicy.go to verify content of the volume

addressed 2nd round of review comments

addressed 3rd round of review comments from jeffvance
2017-02-07 10:36:39 -08:00
Jan Safranek d6e9803007 Add OWNERS file for GCE cloud provider 2017-02-07 10:35:14 +01:00
rootfs b36009be7f use instance's Name to attach gce disk
Signed-off-by: rootfs <hchen@redhat.com>
2017-02-06 14:45:41 -05:00
Miao Luo 1aa3bba72b Update Photon Controller cloud provider for authentication support
1. Update the configuration file for Photon Controller cloud provider
2. Only master nodes can communicate with Photon Controller endpoint
3. Enable support for authentication-enabled Photon Controller endpoint
4. Update NodeAddresses function for query from local node
2017-02-05 22:54:09 -08:00
NickrenREN 70ab5fc6b8 optimize duplicate openstack serverList judgement
if len(serverList) > 1, we will return err in pager.EachPage() function,so here we do not need to do the judgement again
2017-02-06 14:30:52 +08:00
Jordan Liggitt e4dc0a1da4
Populate internal/external DNS node addresses for AWS cloud provider 2017-02-01 23:10:32 -05:00
Kubernetes Submit Queue 9ae2dfacf1 Merge pull request #40763 from derekwaynecarr/log-noise-aws
Automatic merge from submit-queue (batch tested with PRs 40638, 40742, 40710, 40718, 40763)

Reduce log noise when aws cloud cannot find public-ip4 metadata

**What this PR does / why we need it**:
The PR removes excessive log spam produced by the aws cloud provider for normal operating conditions.

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

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```
2017-01-31 20:40:47 -08:00
Derek Carr 6d73112d5b Reduce log noise when aws cloud cannot find public-ip4 metadata 2017-01-31 17:28:49 -05:00
Kubernetes Submit Queue 90a382864e Merge pull request #40405 from vwfs/azure_lb_readonly_fix
Automatic merge from submit-queue

Set NetworkInterfaces and Subnets to nil before updating Azure security groups

**What this PR does / why we need it**: This is a workaround until we have an upstream fix in azure-sdk-for-go/go-autorest. Corresponding issues are https://github.com/kubernetes/kubernetes/issues/40332 and https://github.com/Azure/go-autorest/issues/112

In k8s 1.5.2, an update to azure-sdk-for-go was cherry-picked, which broke creation/updating of LBs on Azure. As we should have it back to a working state ASAP, I'd like to do a workaround for now and later when the upstream fix comes in, remove the workaround again.

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

**Release note**:

```release-note
Fix failing load balancers in Azure
```

CC @colemickens
2017-01-31 04:19:05 -08:00
Kubernetes Submit Queue 2cb17cc677 Merge pull request #40426 from sttts/sttts-more-cutoffs-3
Automatic merge from submit-queue

genericapiserver: cut off more dependencies – episode 3

Compare commit subjects.

This is the first step to get `apiserver_test.go` and `watch_test.go` in `pkg/genericapiserver/endpoints` cutoff from k8s.io/kubernetes dependencies.

After this we have to sync client-go and then "episode 4" can go in.

approved based on #40363
2017-01-30 05:57:49 -08:00
Kubernetes Submit Queue 5b88f0e1de Merge pull request #40538 from vmware/fixvSphereDeleteVolume
Automatic merge from submit-queue

Adding vmdk file extension for vmDiskPath in vsphere DeleteVolume

**What this PR does / why we need it**:
This fix is required to handle situation when volume path is not set with vmdk file extension.
DiskAttach call does not require vmdk file extension to be explicitly set in the file path, so in PV yaml file, users have option to set such file path.

Issue happens when such PV is created with persistentVolumeReclaimPolicy set to Delete, and user deletes associated PVC. Volume deletion will fail with the message: file was not found 


**Which issue this PR fixes** *
Fixes: #40560

**Special notes for your reviewer**:
Tested fix with custom image: divyen/hyperkube-fix-deletevolume:latest (Image built using base v1.5.3-beta.0)
@kerneltime @BaluDontu  please review this fix.
2017-01-29 22:32:34 -08:00
Dr. Stefan Schimanski 44ea6b3f30 Update generated files 2017-01-29 21:41:45 +01:00
Dr. Stefan Schimanski bc6fdd925d pkg/api/resource: move to apimachinery 2017-01-29 21:41:44 +01:00
Kubernetes Submit Queue e7950e6f49 Merge pull request #39977 from justinsb/aws_fix_infof
Automatic merge from submit-queue

AWS: Fix a few log messages Info -> Infof

Get those `%q`-s out of my logs :-)

```release-note
NONE
```
2017-01-27 21:03:27 -08:00
divyenpatel 7baa1c7365 fix for vSphere DeleteVolume 2017-01-26 10:25:07 -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 e2c0bf3fca Merge pull request #40384 from zmerlynn/zmerlynn-owners
Automatic merge from submit-queue

pkg/cloudprovider/providers/aws: Add zmerlynn to OWNERS
2017-01-24 16:26:36 -08:00
Kubernetes Submit Queue a4f33195a3 Merge pull request #38880 from justinsb/peninsula_club
Automatic merge from submit-queue

AWS: trust region if found from AWS metadata

```release-note
AWS: trust region if found from AWS metadata
```

Means we can run in newly announced regions without a code change.

We don't register the ECR provider in new regions, so we will still need
a code change for now.

Fix #35014
2017-01-24 15:05:01 -08:00
Zach Loafman 3c9e35b4fb pkg/cloudprovider/providers/aws: Add zmerlynn to OWNERS 2017-01-24 12:36:03 -08:00
deads2k 5a8f075197 move authoritative client-go utils out of pkg 2017-01-24 08:59:18 -05: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
Garrett Rodrigues ad1e5e98c2 Updated top level owners file to match new format 2017-01-19 11:29:16 -08:00
Kubernetes Submit Queue 80f3e93b9a Merge pull request #40129 from calebamiles/calebamiles-fix-cloudprovider-owners
Automatic merge from submit-queue

Prune reviewers from pkg/cloudprovider

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

Per discussion in https://github.com/kubernetes/kubernetes/pull/36530 the `OWNERS` file for `pkg/cloudprovider` should not contain additional reviewers at this time.

**Special notes for your reviewer**:

Sorry for the extra work in review

**Release note**:

`NONE`
2017-01-19 11:06:55 -08:00