Commit Graph

844 Commits

Author SHA1 Message Date
Rohith 4cb8318ac5 Kops Replace Force
This PR fixes the `kops replace --force` flag which was introduce in [#PR3099](https://github.com/kubernetes/kops/pull/3089). The `--force` stopped working when 65aea59418 was merged and the api started returning an actual error for NotFound
2018-01-15 14:18:33 +00:00
Peter Rifel 9b3f0c17ea Fix typo in --target description 2018-01-08 12:10:03 -08:00
k8s-ci-robot b8a701b2da
Merge pull request #4107 from chrislovecnm/validate-ouput
kops validate cluster can output YAML or JSON
2018-01-08 02:47:11 -08:00
k8s-ci-robot 5a85abdeee
Merge pull request #4193 from justinsb/bundle
Initial implementation of bundle command
2018-01-04 17:23:12 -08:00
Justin Santa Barbara ec8db8b78c Initial implementation of bundle command
The bundle command will support enrollment of a machine via SSH.
2018-01-04 18:55:28 -05:00
k8s-ci-robot b45dd32259
Merge pull request #4179 from chrislovecnm/etdversion-override
Adding override for setting etcd version
2018-01-04 15:22:12 -08:00
chrislovecnm b5bb3f983f Adding overide for setting etcd version
Added new overide capability to set all etcd version dynamically.  This
is needed for HA testing. For example following flag can now be used with
create cluster.

--override "cluster.spec.etcdClusters*.version=3.0.17"
2018-01-04 08:59:04 -07:00
chrislovecnm 120cd93c26 Switching the default for kops to create a cluster with RBAC enabled.
When kops creates a cluster RBAC is enabled by default.
2018-01-03 00:31:05 -07:00
chrislovecnm 4dd3bb1dea Updating bazel BUILD files with new go_rules version 2017-12-29 15:03:14 -07:00
Todd Lyons 40eed60dd8 Interactive cli arg framework
Just builds, haven't tested yet.
2017-12-28 10:54:17 -08:00
chrislovecnm c8670155ca backing out unit test because fixing lifecycle creates a failure
Will put unit test back in when we have lifecycle overrides in place
2017-12-27 13:55:23 -07:00
Justin Santa Barbara 5cc5a936f9 Force nodeup to use the bundle
We disable fallback entirely for nodeup, so we can still share code, but
won't accidentally be using the wrong code path.
2017-12-21 16:06:11 -05:00
Justin Santa Barbara e981e708e4 Use bundles when loading keysets
This avoids the need to list directories, which is problematic on GCE.

It also makes for a more consistent experience; we can move nodeup to
use the bundle always, and we can move writing to the Mirror task, so
that VFS & kops-server are more similar.
2017-12-21 12:58:26 -05:00
chrislovecnm 18ea92f696 updating bazel files 2017-12-20 00:26:28 -07:00
chrislovecnm 7cb9384d70 kops validate clsuter can output YAML or JSON
Adding the capbility for kops validate cluster command to output YAML or JSON.
The validate.ValidationCluster struct is used as body of the JSON or
YAML document.
2017-12-19 23:07:55 -07:00
Justin Santa Barbara 7f3d3544c4 Refactor: clean up SecretStore to not use KeystoreItem
More moving to use API objects, except in this case we eventually want
to deprecate SecretStore entirely.
2017-12-19 11:43:43 -05:00
Kubernetes Submit Queue e88496a248
Merge pull request #4061 from meringu/create-subnets
Automatic merge from submit-queue.

Add --subnets and --utility-subnets to kops create cluster

This change adds two new options to `kops create cluster`

When specifying `--vpc`, `--subnets` can be specified as an unordered array of subnet ids. Kops will then look up the zones of the subnets to find which zone to add the subnet id to.

If `--topology private` is also specified, `--utility-subnets` can similarly be specified.

~If a zone was specified but a subnet wasn't given that matches the zone, then the subnet will be allocated a CIDR with the current behaviour.~ This case fails validation here 7bd0a6a703/pkg/apis/kops/validation/validation.go (L151)

I can add unit tests and docs changes if required, but I am keen to get feedback before I proceed much further.

I have only added support for AWS.

I have tested this by running a command similar to this:

```bash
kops create cluster \
  --zones=us-east-1a,us-east-1b,us-east-1c \
  --topology private \
  --master-zones=us-east-1a,us-east-1b,us-east-1c  \
  --vpc $vpc_id \
  --subnets subnet-111111,subnet-222222,subnet-333333 \
  --utility-subnets subnet-444444,subnet-555555,subnet-666666 \
  $cluster_hosted_zone_name
```

And the cluster spec was as expected.
2017-12-18 21:12:59 -08:00
Kubernetes Submit Queue ca0a720a7e
Merge pull request #3833 from justinsb/cleanup_ssh_2
Automatic merge from submit-queue.

Refactor CAStore to use API types

We now return KeySet objects


Builds on #3832
2017-12-18 20:08:41 -08:00
Kubernetes Submit Queue 15c7d61dfb
Merge pull request #3997 from aledbf/amazon-vpc-cni
Automatic merge from submit-queue.

Add support for Amazon VPC CNI plugin

TODO:
- [x] IAM perms so that the CNI provider only has perms for the nodes in the cluster
- [x] Cleanup of security groups
- [ ] Replace image aledbf/k8s-ec2-srcdst:v0.1.0-5 with the official after https://github.com/ottoyiu/k8s-ec2-srcdst/pull/5 and https://github.com/ottoyiu/k8s-ec2-srcdst/pull/6
2017-12-17 21:41:13 -08:00
Justin Santa Barbara bf74133fd4 Refactor CAStore to use API types
We now return KeySet objects
2017-12-17 20:09:00 -05:00
Kubernetes Submit Queue dd49d69399
Merge pull request #3254 from chrislovecnm/file-assets
Automatic merge from submit-queue.

work on using files assets

Basic MVP for file assests.

- using file assest builder
- able to upload files
- using URL structs instead of strings everywhere
2017-12-17 16:10:23 -08:00
Kubernetes Submit Queue 7768729cf2
Merge pull request #3832 from justinsb/cleanup_ssh
Automatic merge from submit-queue.

Refactor: separate out SSHCredentials from Keyset stores
2017-12-17 15:05:09 -08:00
chrislovecnm 7057aaf1bb Enabling the file assets
File assets and the SHA files are uploaded to the new location. Files
when are users uses s3 are upload public read only. The copyfile task
uses only the existing SHA value.

This PR include major refactoring of the use of URLs.  Strings are no
longer categnated, but converted into a URL struct and path.Join is
utlilized.

A new values.go file is included so that we can start refactoring more
code out of the "fi" package.

A
2017-12-17 15:26:57 -07:00
Henry Muru Paenga 0491530b6e Lookup vpc if not given to create cluster 2017-12-18 11:12:57 +13:00
Manuel de Brito Fontes 2e05dd17aa Add support for Amazon VPC CNI plugin 2017-12-17 18:08:24 -03:00
Kubernetes Submit Queue fb7c42cb4d
Merge pull request #3987 from justinsb/default_subnets_on_create_ig
Automatic merge from submit-queue.

Use default subnet when creating IG
2017-12-15 09:23:14 -08:00
Henry Muru Paenga 6fcd970191 create cluster only use --subnets in AWS 2017-12-15 18:59:12 +13:00
Henry Muru Paenga afc1b58722 Tests for create cluster in shared vpc 2017-12-15 18:29:20 +13:00
Justin Santa Barbara 3e236283f3 Tag 1.8.0 2017-12-13 22:13:27 -05:00
Justin Santa Barbara 65bcbe7729 Use default subnet when creating IG
We had this logic before, but I accidentally bypassed it in #2124.
2017-12-13 22:01:44 -05:00
Justin Santa Barbara 509b83ac7a Refactor: separate out SSHCredentials from Keyset stores
We've done this in the API already, but we had a single CAStore
interface that did Keysets and SSHCredentials.  Separate out
SSHCredentials into SSHCredentialStore, and start using API objects as
our primary representation.
2017-12-13 20:16:59 -05:00
Henry Muru Paenga 48d4a7cb1a Add --subnets and --utility-subnets to kops create cluster 2017-12-14 13:57:54 +13:00
Rohith 6b2f4a4c74 Bastion Username
- cleaning up the bastion username line
2017-12-13 13:09:22 +00:00
Kubernetes Submit Queue bfd747a873
Merge pull request #3933 from justinsb/lazy_ssh_keystore
Automatic merge from submit-queue.

SSH keys - be lazier about keystore creation
2017-12-03 20:40:42 -08:00
Justin Santa Barbara 33b7432d6a Fix segfault when updating non-existent object
Fix #3935
2017-12-01 11:00:46 -05:00
Justin Santa Barbara 2ada501c65 Fix typo in kops get cluster --full hint 2017-11-29 21:04:28 -05:00
Justin Santa Barbara b8b7287e4a Bump versions to 1.8.0-beta.2 2017-11-28 13:27:58 -05:00
Justin Santa Barbara ad60069d71 SSH keys - be lazier about keystore creation 2017-11-26 23:35:58 -05:00
Kashif Saadat 79eef3cc6c Support replacing kops secrets via force flag 2017-11-21 11:47:03 +00:00
Kubernetes Submit Queue d8e2ce211a
Merge pull request #3709 from chrislovecnm/placehold-dns-ux-updates
Automatic merge from submit-queue.

Improving UX for placeholder IP Address

Before the `kops validate cluster` attempts to connect to the K8s API
endpoint, the code now checks to see if the API DNS Entry is the kops
placeholder IP Address 203.0.113.123.  It prints a message to the user
and err's.  There is a new init func in validate cluster that disables
CGO based DNS for Darwin OS.  Darwin does two things with kops
validates; it caches the IP address, and it does not return the
placeholder IP address.  We cannot use CGO base DNS with kops validate with OSX.
2017-11-17 02:24:23 -08:00
Kubernetes Submit Queue 1dcc4a0ef1
Merge pull request #3864 from jonstacks/master
Automatic merge from submit-queue.

Fix spelling

Fix spelling of credential in the `kops create` command.
2017-11-16 22:49:59 -08:00
chrislovecnm c7ef856f92 Improving UX for kops validate cluster
Before the `kops validate cluster` attempts to connect to the K8s API
endpoint, the code now checks to see if the API DNS Entry is the kops
placeholder IP Address 203.0.113.123.  It prints a message to the user
and err's.  There is a new init func in validate cluster that disables
CGO based DNS for Darwin OS.  Darwin does two things with kops
validates; it caches the IP address, and it does not return the
placeholder IP address.  We cannot use CGO base DNS with kops validate.
2017-11-16 15:12:51 -07:00
Jonathan Stacks fb3f8f9424
Fix spelling 2017-11-15 13:22:47 -06:00
Rohith 316903fee1 Kops Template Config Value
- the use of %v is somewhat cleaner than trying to convert to a string
2017-11-15 16:57:59 +00:00
Justin Santa Barbara 3ab71d19ab Tweak kops create ig flag to edit, not editor
As EDITOR is the env var used to configure the editor, which will be
confusing.
2017-11-14 03:17:19 -05:00
Kubernetes Submit Queue ad50149769
Merge pull request #3787 from jchanam/master
Automatic merge from submit-queue.

Add edit flag so create instancegroup command is usable on scripts

Until now, the opening of an interactive editor when creating a new instance group was mandatory.

This this commit, a new flag is added, so this is now optional.

This commit is backwards compatible.
2017-11-13 21:47:37 -08:00
Julio Chana 9ca5f9ac98
Change no-edit flag to edit 2017-11-13 11:32:24 +01:00
Justin Santa Barbara 1d402ec962 Fix error message when not specify --cloud or --zones 2017-11-12 22:36:41 -05:00
Kubernetes Submit Queue e5ea6ba6a7
Merge pull request #3783 from georgebuckerfield/instancegroup-labels
Automatic merge from submit-queue.

Add a default NodeLabel with the InstanceGroup name

As requested in https://github.com/kubernetes/kops/issues/2999, this change just auto-populates new InstanceGroup specs with a default node label containing the name of the instance group. It would be really useful for those of us managing environments with multiple instance groups.

It allows an admin to easily view the instance groups using kubectl:
```
kubectl get nodes --label-columns kops.k8s.io/instancegroup
NAME                                           STATUS         AGE       VERSION   INSTANCEGROUP
ip-172-20-108-120.eu-west-1.compute.internal   Ready,node     3m        v1.7.4    xtra-large
ip-172-20-117-133.eu-west-1.compute.internal   Ready,master   14m       v1.7.4    master-eu-west-1c
ip-172-20-32-139.eu-west-1.compute.internal    Ready,master   14m       v1.7.4    master-eu-west-1a
ip-172-20-32-92.eu-west-1.compute.internal     Ready,node     12m       v1.7.4    nodes
ip-172-20-67-184.eu-west-1.compute.internal    Ready,master   13m       v1.7.4    master-eu-west-1b
```
2017-11-09 23:29:47 -08:00
Kubernetes Submit Queue ebef6beda1
Merge pull request #3814 from chrislovecnm/fixing-bazel-kops-version
Automatic merge from submit-queue.

updating bazel build version
2017-11-09 21:37:15 -08:00
Rodrigo Menezes ef24cec62b Fixing naming convention and adding running API machinery. 2017-11-09 14:30:48 -08:00
chrislovecnm a3a633457f updating bazel build version 2017-11-09 14:29:48 -07:00
Rodrigo Menezes 3cfa67c3e6 Merge remote-tracking branch 'upstream/master' into extra_user-data 2017-11-08 22:20:54 -08:00
Julio Chana e4afcd8869
Add no edit flag so create instancegroup command is usable on scripts 2017-11-07 12:43:56 +01:00
georgebuckerfield 8f60078d11 Move instance group node label functionality out of PopulateInstanceGroupSpec so that it's not mandatory 2017-11-07 11:25:37 +00:00
Rodrigo Menezes 1fe56a1603 Move user-data to IG spec 2017-11-06 23:25:37 -08:00
Justin Santa Barbara 07c221bf6b
Merge branch 'master' into feature/kops-add-master-public-name 2017-11-06 22:58:57 -05:00
Justin Santa Barbara a6e2e05c57 Remove nodeup static=on
Doesn't seem to build with that attribute
2017-11-06 17:22:15 -05:00
Justin Santa Barbara 132b428d64
Merge pull request #3776 from chrislovecnm/bazel-work
gazelle updates with new bazel version
2017-11-06 14:08:57 -05:00
chrislovecnm 609e268a1d gazelle updates with new bazel version 2017-11-05 17:41:53 -07:00
chrislovecnm a25b5d7364 adding -y to various commands that use --yes. kops create,
rolling-update and update now include -y.
2017-11-05 17:33:24 -07:00
Kubernetes Submit Queue df69d047f8
Merge pull request #3769 from chrislovecnm/bazel-work
Automatic merge from submit-queue.

updating to bazel 0.0.7 and adding verify scripts

/assign @geojaz
2017-11-05 14:15:06 -08:00
Kubernetes Submit Queue 9c30c30ec0
Merge pull request #3658 from justinsb/rationalize_rollingupdate_timeouts
Automatic merge from submit-queue.

Rationalize timeouts for rolling-update
2017-11-05 13:11:21 -08:00
chrislovecnm 30acda868a updating to bazel 0.0.7 and adding verify scripts 2017-11-04 20:59:01 -06:00
Rodrigo Menezes 565afae2c6 Merge remote-tracking branch 'upstream/master' into extra_user-data 2017-11-04 17:06:43 -07:00
chrislovecnm 4c82a6d5d4 Fixing YAML and JSON output across multiple cli functions. Also
Added --dry-run for create_ig and create_cluster
2017-11-04 17:04:44 -06:00
chrislovecnm 1e418c3e13 more goimport updates 2017-11-04 10:03:02 -06:00
Kashif Saadat b30606ffda Enable IAM Container Registry permissions by default when creating a cluster (#3760). 2017-11-03 17:26:51 +00:00
Kubernetes Submit Queue aadc2e1427
Merge pull request #3731 from gambol99/template_fix
Automatic merge from submit-queue.

Template Fixes

- fixing an issue in the way it handled inline yaml documents
- cleaning it up somewhat, the prior version was a little cryptic to read; it's easier to just split into docs, format if required and rejoin at the end.

Apologizes @justinsb ... the prior PR didn't handle YAML separators correctly; I've find it somewhat simpler by a split and join rather than using indexes and such
2017-11-03 08:10:23 -07:00
Rohith fad62c284f Template Fixes
- fixing an issue in the way it handled inline yaml documents
- cleaning it up somewhat, the prior version was a little cryptic to read; it's easier to just split into docs, format and rejoin at the end
2017-11-02 14:26:39 +00:00
Justin Santa Barbara 53de6ff255 Generate gazelle 2017-10-30 23:47:00 -04:00
Rodrigo Menezes 58faa71d89 Merge remote-tracking branch 'origin/master' into extra_user-data 2017-10-30 20:44:00 -07:00
Kubernetes Submit Queue 3a29d7c3e1
Merge pull request #3722 from justinsb/toolbox_refactor_4_add_gce_ips
Automatic merge from submit-queue.

GCE Dump: Include instance IPs

The challenge here is that we normally only get the instance url.  So we
have to do another call to GCE, but we also don't want to do one call per
instance.

Instead, we create a dump operation context object which we pass into the
dump.
2017-10-30 13:59:11 -07:00
Rohith 0e2e20bc15 Kops Templating
Adding an extra option to the toolbox templating to format the YAML before writing out; which is usefull to cleanup formating issues and as detecting errors in the template

- added a formating options --format-yaml to the toolbox template which cleans up the yaml before writing out
- updated the cli documentation
- added the --config-value used to grab the configuration
2017-10-30 12:05:11 +00:00
Justin Santa Barbara b3e00c0dd1 GCE Dump: Include instance IPs
The challenge here is that we normally only get the instance url.  So we
have to do another call to GCE, but we also don't want to do one call
per instance.

Instead, we create a dump operation context object which we pass into the dump.
2017-10-29 23:22:40 -04:00
Kubernetes Submit Queue b02c3a269c
Merge pull request #3726 from justinsb/storage_acls
Automatic merge from submit-queue.

GCS: Use ACLs for GCE permissions

This needs less permissions, but also allows for more granular control over
access to files than whole-bucket permissions that IAM gives us.
2017-10-29 20:18:51 -07:00
Justin Santa Barbara b2bcba4a6d GCE: Use object-level permissions for files in GCS
This lets us configure cross-project permissions while ourselves needing
minimal permissions, but also gives us a nice hook for future lockdown
of object-level permissions.
2017-10-29 19:17:00 -04:00
Justin Santa Barbara 66e74fac6a Rename pkg/resources/utils -> pkg/resources/ops
That seems to be what utils really is.
2017-10-29 16:32:48 -04:00
Justin Santa Barbara 1eb17ae6b9 Move DeleteResources into pkg/resources/utils 2017-10-29 12:26:07 -04:00
Justin Santa Barbara a18363f059 Refactor toolbox dump & dump structured instances
This will enable log collection even if nodes don't register.

AWS: Dumps ids & addresses
GCE: Dumps names - addresses to follow
Others: Not yet!
2017-10-28 14:46:28 -04:00
Kubernetes Submit Queue a4d6895472 Merge pull request #3707 from andrewsykim/droplet
Automatic merge from submit-queue.

Implement DigitalOcean Droplet FI Task

Implements cloudup fi tasks for DigitalOcean droplets. It makes a few assumptions to reduce the size of this PR, those will be addressed in future PRs. 

Also does some cleanup in the DigitalOcean `dns` package.
2017-10-27 08:30:57 -07:00
andrewsykim 45bf2cb3a7 Implement DigitalOcean Droplet FI Task 2017-10-27 09:48:42 -04:00
chrislovecnm 0dc7a6e671 network and security tests are working 2017-10-26 13:17:34 -06:00
chrislovecnm 384c74d66c Refactoring IAM phase to Security Phase 2017-10-26 12:28:50 -06:00
Rodrigo Menezes d803480485 Merge remote-tracking branch 'upstream/master' into extra_user-data 2017-10-24 12:52:19 -07:00
Rohith 9958d333ae Kops Toolbox Template
The current implementation fails on template which reference unset variables, it is however useful at times to permit overriding this behavior and using sprig default() for example methods to handle it

- added a new command line option --fail-on-missing (defaults to true, so keeps the current behaviour)
- updated the unit test to reflect the changes
- updated the cli docs
2017-10-22 14:29:23 +00:00
Rodrigo Menezes 469b73560f Merge remote-tracking branch 'upstream/master' into extra_user-data 2017-10-17 14:10:25 -07:00
Justin Santa Barbara eec1141a41 Rationalize timeouts for rolling-update
The intervals remain the minimum time between instances; drain &
validate time is additional.
2017-10-17 11:44:46 -04:00
chrislovecnm 91d4e7e3e8 fixing bazel missed BUILD stuff 2017-10-16 10:38:53 -06:00
Rodrigo Menezes 75aa120f43 Merge remote-tracking branch 'upstream/master' into extra_user-data 2017-10-15 17:17:12 -07:00
Rodrigo Menezes e77cda1af1 Allow passing in extra user-data to cloud-init 2017-10-15 17:10:03 -07:00
chrislovecnm eeafe6467c Integration tests for phases - iam works - others are WIP 2017-10-12 14:13:17 -06:00
Erick Tryzelaar 5a89dd113c `kops get ...` should exit with non-zero if the resource don't exist
Without this change, `kops get --name non-existing-cluster` will
exit with a status of `0`, which makes it difficult to check if
a cluster (and other resources) exist in a shell script.
2017-10-11 16:11:16 -07:00
Justin Santa Barbara 19677523c0 Mock kops version in tests
This avoids having to update the tests every time our version changes.
2017-10-10 11:11:57 -04:00
Kubernetes Submit Queue 1c9df0b269 Merge pull request #3524 from justinsb/gce_format_ig_zones
Automatic merge from submit-queue.

GCE: Fix subnets vs zones formatting of instance groups
2017-10-08 13:16:52 -07:00
chrislovecnm 2e6f8bf461 setting variable in func instead inside of func call 2017-10-05 20:38:34 -06:00
Thomas Schaaf 6330c6c6ee Minor spelling 2017-10-05 09:06:09 +02:00
Justin Santa Barbara 3ab5264ee4 Fix update cluster integration test for bazel
Bazel doesn't like overlapping file paths; this is much cleaner anyway.
2017-10-03 20:51:00 -04:00
Kubernetes Submit Queue 98bf9d35a9 Merge pull request #3477 from chrislovecnm/update-test-yaml-k8s-version
Automatic merge from submit-queue.

bumping k8s versions in test files

updating k8s versions in test YAML files so that we do not get warnings during testing
2017-10-03 14:03:23 -07:00
chrislovecnm 0abcaa8026 renaming cf integration test folder 2017-10-03 13:38:13 -06:00
chrislovecnm 48c6dfdad4 giving cf its own files, because it has hardcoded versions 2017-10-03 12:16:04 -06:00
Justin Santa Barbara 38ea16a4ae GCE: Fix subnets vs zones formatting of instance groups 2017-10-03 13:42:14 -04:00
Justin Santa Barbara 39d4f21954 bazel: stamp version into build 2017-10-03 11:36:40 -04:00
Justin Santa Barbara 57ceb5dbab bazel: Add targets for cross-package testdata 2017-10-03 10:54:46 -04:00
Justin Santa Barbara 0143be7c4f autogen: BUILD and BUILD.bazel 2017-10-02 14:27:21 -04:00
Justin Santa Barbara 544990842a More fixes for 1.8 API changes 2017-10-01 23:02:32 -04:00
Justin Santa Barbara 95d4f3eb59 More code updates for 1.8 2017-10-01 21:13:00 -04:00
Justin Santa Barbara 3478031533 API types changed package 2017-10-01 14:03:56 -04:00
Justin Santa Barbara 0c89c9851e Simple code updates for 1.8 breakages 2017-10-01 13:17:40 -04:00
Kubernetes Submit Queue 0905e71741 Merge pull request #3411 from justinsb/mirror_stores
Automatic merge from submit-queue.

Mirror keystore & secretstore
2017-09-30 23:08:33 -07:00
Justin Santa Barbara a4a58d277d Mirroring - Fixes from code review 2017-09-30 22:05:14 -04:00
Kubernetes Submit Queue 852455afed Merge pull request #3439 from justinsb/gce_zones_in_instancegroup
Automatic merge from submit-queue.

Add Zones field to InstanceGroup

The Zones field can specify zones where they are not specified on a
Subnet, for example on GCE where we have regional subnets.
2017-09-30 18:17:32 -07:00
Justin Santa Barbara 7fd1196708 Add Zones field to InstanceGroup
The Zones field can specify zones where they are not specified on a
Subnet, for example on GCE where we have regional subnets.
2017-09-30 19:44:35 -04:00
Justin Santa Barbara da99a7270d Subnets on GCE are regional, create one per region
We also make the subnet zone and CIDR optional on GCE
2017-09-30 19:22:14 -04:00
Justin Santa Barbara 8280c4f9d3 Remove MarkIsReady function, calculate on demand
Avoids setting the trap of failing to call MarkIsReady
2017-09-30 17:39:53 -04:00
chrislovecnm a431eb3e43 refactoring to use cloud based GetGroups 2017-09-29 12:29:07 -06:00
John Laswell a6dbc73502
docs updates to clarify and fix typos
Helps with https://github.com/kubernetes/kops/issues/3441.
2017-09-26 19:50:38 -04:00
Justin Santa Barbara 559d885480 Mirror keystore & secretstore
This allows us to have our API objects in kops-server, but our
configuration on S3 or GCS.
2017-09-24 00:09:02 -04:00
Kubernetes Submit Queue ba42020e09 Merge pull request #3329 from chrislovecnm/promote-drain-validate
Automatic merge from submit-queue. .

promoting drain and validate by setting feature flag to true

I am unable to recreate https://github.com/kubernetes/kops/issues/2407, and frankly, it may be an edge case.  We could warn a user if their wait times are low, but that would be another PR.

This PR moves Drain and Validate functionality for rolling-updates into the default user experience, setting the Feature Flag to true.

Per feedback, I am using the node and master interval times for the validation.
2017-09-23 21:07:26 -07:00
Kubernetes Submit Queue 9ffa37ac6b Merge pull request #3435 from justinsb/gce_network_mode_custom
Automatic merge from submit-queue. .

Create GCE networks in auto mode, not legacy mode

auto mode allows for conversion to custom mode at the API level, and
legacy mode is deprecated.
2017-09-23 18:03:41 -07:00
chrislovecnm ec2f0dfdf3 reusing the node and master duration for validation periods 2017-09-23 18:11:48 -06:00
Justin Santa Barbara 73dd870118 GCE integration test: verify TF output 2017-09-23 16:27:15 -04:00
Justin Santa Barbara e730e043ab Add function to get etcd status
This will allow us to permit changing the etcd configuration only if
etcd has not yet been configured.
2017-09-22 23:27:26 -04:00
georgebuckerfield da36425dfb Enable support for encryption-at-rest
- add a new kops secret command to store encryption config
- add the experimential-encryption-provider-config flag to the kube-apiserver
- add functionality to nodeup to create the stored encryption config in the correct path
2017-09-22 17:14:51 +01:00
Justin Santa Barbara 055f510c6f Create minimal mock GCECloud, first test
We test create cluster - we actually have an issue with the length of
the names on longer cluster names; first step is to get test coverage.
2017-09-16 11:02:30 -04:00
Marius Davidsen 34cbbd20db Adds --master-public-name argument to create_cluster. 2017-09-15 13:20:20 +02:00
Kubernetes Submit Queue 5cb443d4a9 Merge pull request #3290 from romana/romana-networking-option
Automatic merge from submit-queue

Add romana to built-in CNI options

This PR adds `romana` as a networking option for kops.

It installs the latest "preview" release of Romana v2.0, which provides the expected features in terms of IP allocations and route configuration. Network policy features are being ported to 2.0 and will be in the final release. (We intend to submit a followup PR for kops as part of that rolling out that release.)

Note: in this setup, we're using the etcd cluster that kops deploys for k8s. This isn't ideal, but some possibilities (eg: StatefulSets) aren't practical for the CNI itself, and creating a parallel etcd cluster via manifests seemed to be a more-intrusive approach than using the existing one.
If this is a concern or problem, then I'm very open to discussing and implementing it based on your suggestions.

Also, some functionality is exclusive to AWS environments. Other cloud platforms are on Romana's roadmap but not developed yet. Let me know that restriction needs to be enforced in code or directly documented.
2017-09-14 20:43:05 -07:00
Kubernetes Submit Queue 593f444297 Merge pull request #3359 from justinsb/delete_more_secrets
Automatic merge from submit-queue

Support for deleting tokens & keypairs
2017-09-14 19:30:08 -07:00
Caleb Gilmour 79d331e590 Add support for Romana as a networking option 2017-09-13 22:48:18 +00:00
Kubernetes Submit Queue 26e1cb06bf Merge pull request #3190 from justinsb/flannel_vlxan
Automatic merge from submit-queue

Flannel: change default backend type

We support udp, which has to the default for backwards-compatibility,
but also new clusters will now use vxlan.
2017-09-12 19:03:17 -07:00
Justin Santa Barbara f463a8e30e Add docs for flannel-vxlan option 2017-09-12 20:53:00 -04:00
Kubernetes Submit Queue 721ba52139 Merge pull request #3287 from gambol99/toolbox_template
Automatic merge from submit-queue

Toolbox template

Extending the current implementation of toolbox template to include multiple files and snippets. Note, I've removed the requirements for defaults as I think people should be forced to specifically pass them

- allowing the users to use a snippets directory for reusable templates
- allows the users to specify multiple templates files via multiple --template <path>, use a directory or both
- allows the users to specify multiple configuration files via multiple --values <path>,  use a directory or both
- adding a safety check to ensure templates don't reference an unknown values
- fixing the vetting issues to the method YamlToJson -> YAMLToJSON
- as usual anything a saw on the journey which doesn't comply with go-vet got changed

Examples of a snippet

```YAML
hooks:
  - name: some_service.service
    manifest: |
      {{ include "some_service.service" . | indent 6 }}
```
We currently use something similar to template our cluster and instances group documents, handling the differences between prod, ci and ephemeral
2017-09-10 14:04:05 -07:00
Justin Santa Barbara 106875115d Support for deleting tokens & keypairs
This now allows for deleting all secrets, which means we can have a
procedure for rotating all keys.
2017-09-09 01:04:45 -04:00
Kubernetes Submit Queue ae51cfef95 Merge pull request #3336 from justinsb/nodeportaccess
Automatic merge from submit-queue

nodePortAccess, experimental spec override flag
2017-09-08 15:40:01 -07:00
Rohith aaf6143a98 Toolbox Templating
Extending the current implementation of toolbox template to include multiple files and snippets. Note, i've removed the requirements for defaults as I think people should be forced to specifically pass them.

- fixing the vetting iseues to the method YamlToJson -> YAMLToJSON
- adding a safety check to ensure templates don't reference an unknown value
- extending the unit test to ensure the above works on main and snippets
- include the ability to specify multiple configuration files, useful for common.yaml and prod.yaml etc

Requested Changes - Toolbox Templating

Added the requested changes

- moved the templater into it's own package rather than using base util
- moved to using the sprig library for additional template function
- @note: i couldn't find a native way in sprig to do snippets, also the i've overloaded the indent as it appears to do the indent on all lines rather than on the newline, meaning i'd have to shift my first line back by the indent to get it to work, which seems ugly
2017-09-08 20:30:21 +01:00
Kubernetes Submit Queue 05cf84dc3d Merge pull request #3299 from justinsb/extract_userdata
Automatic merge from submit-queue

Extract UserData from CloudFormation output during testing
2017-09-06 10:05:39 -07:00
Justin Santa Barbara 9d31ed1b08 nodePortAccess, experimental spec override flag
This will allow us to set CIDRs for nodeport access, which in turn will
allow e2e tests that require nodeport access to pass.

Then add a feature-flagged flag to `kops create cluster` to allow
arbitrary setting of spec values; currently the only value supported is
cluster.spec.nodePortAccess
2017-09-04 14:27:31 -04:00
andrewsykim d9fa618de6 refactor resource tracker to be usable across packages 2017-09-02 17:37:21 -04:00
Justin Santa Barbara 15d6834113 Flannel: support choosing a backend type
We support udp, which has to the default for backwards-compatibility,
but also new clusters will now use vxlan.
2017-08-30 21:16:21 -04:00
Justin Santa Barbara 69e3d760f4 Misc go vet fixes 2017-08-29 09:55:40 -04:00
Justin Santa Barbara e793562ee6 Extract UserData from CloudFormation output during testing
This gives us some sanity, so we can peek inside the base64 blob
2017-08-29 09:47:11 -04:00
Kubernetes Submit Queue 1cba2a2346 Merge pull request #3292 from chrislovecnm/gce-change-to-interface
Automatic merge from submit-queue

Implementing GCE as an interface - modelling aws cloud provider

GCE and other cloud providers are structs instead of an interface.  AWS cloud provider implements an interface.  This PR refactors `GCECloud` as an interface, and creates `gceCloudImplementation`.

- [x] Need to e2e test
2017-08-28 05:54:57 -07:00
Kubernetes Submit Queue 0c7268435e Merge pull request #3285 from justinsb/fix_space_in_rollingupdatecluster_help
Automatic merge from submit-queue

Fix space in rolling-update cluster help
2017-08-28 03:04:20 -07:00
chrislovecnm 0779fb6fc4 Implementing GCE as an inteface modelling aws cloud provider 2017-08-27 22:19:25 -06:00
Kubernetes Submit Queue 847f6defee Merge pull request #3277 from alrs/kops-command-fixes
Automatic merge from submit-queue

Kops command fixes

TrimSuffix() on defaultStateStore doesn't actually do anything, and there is an unused answer variable in the tests.
2017-08-26 14:40:02 -07:00
Justin Santa Barbara 6d2185a6cd Fix space in rolling-update cluster help
When we use pretty.Bash, we must use pretty.LongDesc to stop the spacing
being mangled.
2017-08-26 07:39:17 -04:00
Lars Lehtonen 408b11d4cc
Assign unused test variable to _ 2017-08-25 14:29:50 -07:00
Lars Lehtonen 24e79a3d8e
TrimSuffix of defaultStateStore 2017-08-25 14:26:24 -07:00
Kubernetes Submit Queue d661e27a99 Merge pull request #3240 from justinsb/create_and_update_functions
Automatic merge from submit-queue

Explicit CreateCluster & UpdateCluster functions
2017-08-25 06:37:34 -07:00
Kubernetes Submit Queue 1e3eef37bf Merge pull request #3245 from mad01/sshsecret
Automatic merge from submit-queue

Adding support for adding ssh public key from file

MVP implementation of adding secret from file related to #2195 

```bash
cat > secret.yaml <<EOF
apiVersion: kops/v1alpha2
kind: SSHSecret
metadata:
  labels:
    kops.k8s.io/cluster: dev.k8s.example.com
spec:
  username: "admin"
  sshPublicKey: "ssh-rsa AAAAB3NzaC1yc2EEEAADA dev@devbox"
EOF
```

`kops create -f secret.yaml`
2017-08-24 20:18:48 -07:00
Justin Santa Barbara c6e31a94c7 Explicit CreateCluster & UpdateCluster functions
This enables better validation (in the etcd status PR)
2017-08-24 14:03:37 -04:00
Kubernetes Submit Queue e6683481c8 Merge pull request #3139 from justinsb/hints_on_cf_test
Automatic merge from submit-queue

Add hints to CF integration test
2017-08-24 00:07:52 -07:00
Alexander Brandstedt 5705885d02 rename sshsecret to sshcredential and update files to reflect change. 2017-08-23 12:18:10 +02:00
Kubernetes Submit Queue 34473e8602 Merge pull request #3210 from KashifSaadat/feature-gate-strict-iam-policies
Automatic merge from submit-queue

Allow the strict IAM policies to be optional

The stricter IAM policies could potentially cause regression for some edge-cases, or may rely on nodeup image changes that haven't yet been deployed / tagged officially (currently the case on master branch since PR https://github.com/kubernetes/kops/pull/3158 was merged in).

This PR just wraps the new IAM policy rules around a cluster spec flag, `EnableStrictIAM`, so will default to the original behaviour (where the S3 policies were completely open). Could also be used to wrap PR https://github.com/kubernetes/kops/pull/3186 if it progresses any further.

- Or we could reject this and have the policies always strict! :)
2017-08-22 20:27:54 -07:00
Kashif Saadat 0e5c393f10 Rename IAM switch to legacy, default to false for new cluster creations. 2017-08-22 13:27:55 +01:00
chrislovecnm 6071ce7383 refactoring for tracking via assets container registry 2017-08-21 17:29:16 -06:00
chrislovecnm 7efb0f31f6 updating phases 2017-08-21 15:17:34 -06:00
Alexander Brandstedt 1eceb788e6 implementation of adding ssh public key using sshsecret spec 2017-08-21 17:18:00 +02:00
Kubernetes Submit Queue 9c86800207 Merge pull request #3085 from chrislovecnm/file-asset-tasks
Automatic merge from submit-queue

starting work on file assets builder

I refactored to the dockerassets pkg to assetstasks, in order to not add yet another package.  Added file copy task, that I have tested with s3 locally, but not certain how to add memfs tests.

Fixes: https://github.com/kubernetes/kops/issues/3086
2017-08-20 08:21:06 -07:00
Kubernetes Submit Queue a3fdefa74c Merge pull request #3041 from justinsb/it_shared_vpc_and_subnet
Automatic merge from submit-queue

Add integration tests for shared subnet & VPC
2017-08-18 15:55:53 -07:00
Kashif Saadat 6a3df8fb7c Don't force ig image change on cluster upgrade if it is custom. 2017-08-18 20:52:50 +01:00
chrislovecnm ee17e6567c starting work on file assets builder 2017-08-18 13:04:12 -06:00
lichuqiang 90ed63465b fix typo 2017-08-17 19:16:13 +08:00
Kubernetes Submit Queue 71d66849a0 Merge pull request #3209 from krzyzacy/addding
Automatic merge from submit-queue

s/addding/adding/ in ssh logs

I was hittting this errror messsage :-(
2017-08-16 09:53:29 -07:00
Sen Lu 790ca20051 s/addding/adding/ in ssh logs 2017-08-15 18:16:03 -07:00
Kubernetes Submit Queue 74d0e211f4 Merge pull request #3193 from orrchen/master
Automatic merge from submit-queue

resolve #3169
2017-08-14 06:14:00 -07:00
Orr Chen 43020af959 resolve #3169 2017-08-13 19:16:22 +03:00
Kubernetes Submit Queue b7efd3ba62 Merge pull request #3120 from KashifSaadat/diff-on-component-config-changes
Automatic merge from submit-queue

Add cluster spec to node user data so component config changes are detected

Related to #3076 

Some cluster changes such as component config modifications are not picked up when performing updates (nodes are not marked as `NEEDUPDATE`). This change introduces the ability to:
1. Include certain cluster specs within the node user data file ~(`enableClusterSpecInUserData: true`)~
2. ~Encode the cluster spec string before placing within the user data file (`enableClusterSpecInUserData: true`)~

~The above flags default to false so shouldn't cause any changes to existing clusters.~

Following feedback I've removed the optional API flags, so component config is included by default within the user data. This WILL cause all nodes to have a required update to their bootstrap scripts.
2017-08-11 03:43:17 -07:00
Kubernetes Submit Queue b1aee7a505 Merge pull request #2542 from kenden/patch-1
Automatic merge from submit-queue

Clarify docs: rename spec/specification into desired configuration 

The cluster state in S3 has (among others) two files: `cluster.spec` and `config`.
When the documentation mentioned "create or update cluster spec" for example, it was confusing what was actually updated. It's not the cluster.spec file.
As I understand, `cluster.spec` should only be created/updated after `kops update --yes` is run.

I changed the docs for `kops get`, `kops create`, `kops replace`, `kops edit`.
I did NOT change those files: `kops_rolling-update.md`, `kops_rolling-update_cluster.md` as I think those actually use `cluster.spec`.
2017-08-10 21:37:29 -07:00
Quentin Nerden 5491f179d1 Clarify docs: rename spec to desired conf
In the S3 bucket, the file cluster.spec is not actually the spec, but the
actual configuration. The file config is the spec. To avoid confusion,
this commit changes spec/specification into 'desired configuration' in
the documentation, to avoid associating cluster.spec with a cluster
'specification' that the users should use.
2017-08-10 18:50:45 +02:00
Lars Lehtonen 5bdd7f2568
Fix dropped error in kops cmd package 2017-08-09 16:29:18 -07:00
Kashif Saadat e0461b92a9 Add ability to store partial cluster and instancegroup spec in userdata,
so component config changes are detected and causes nodes to be updated
2017-08-09 14:15:02 +01:00
asifdxtreme 18f6edd850 Fix Typo to improve GoReportCard 2017-08-08 10:48:14 +08:00
Rohith 3599e64205 - fixing up the flag name from --create to --force to make it align to the kubectl syntax 2017-08-04 20:44:49 +01:00
Rohith e4a53dd044 Replace Command
The current 'kops replace' fails if the resource does not exist, which is annoying if you want to use the feature to drive your CI. This PR adds a --create option to create any resource which does not exist. At the moment we limit this to instanceGroups only. I'd also like to see this command perhaps be renamed to kops apply?
2017-08-04 20:44:49 +01:00
Kubernetes Submit Queue 10ce978b64 Merge pull request #3040 from mad01/templating
Automatic merge from submit-queue

MVP of templating 

MVP implementation of templating to generate cluster.yaml file: related to #2404 implementation is using the `text/template`

```bash
cat > values.yaml <<EOF
clusterName: eu1
kubernetesVersion: 1.7.1
dnsZone: k8s.example.com
awsRegion: eu-west-1
EOF
```

```bash
cat > cluster.tmpl.yaml <<EOF
apiVersion: kops/v1alpha2
kind: InstanceGroup
metadata:
  labels:
	kops.k8s.io/cluster: {{.clusterName}}.{{.dnsZone}}
  name: nodes
spec:
  image: coreos.com/CoreOS-stable-1409.6.0-hvm
  machineType: m4.large
  maxPrice: "0.5"
  maxSize: 2
  minSize: 15
  role: Node
  rootVolumeSize: 100
  subnets:
  - {{.awsRegion}}a
  - {{.awsRegion}}b
  - {{.awsRegion}}c

EOF
```

running the templating command
```bash
  kops toolbox template \
      --values values.yaml \
      --template cluster.tmpl.yaml \
      --output cluster.yaml
```

output
```bash
apiVersion: kops/v1alpha2
kind: InstanceGroup
metadata:
  labels:
	kops.k8s.io/cluster: eu1.k8s.example.com
  name: nodes
spec:
  image: coreos.com/CoreOS-stable-1409.6.0-hvm
  machineType: m4.large
  maxPrice: "0.5"
  maxSize: 2
  minSize: 15
  role: Node
  rootVolumeSize: 100
  subnets:
  - eu-west-1a
  - eu-west-1b
  - eu-west-1c
```
2017-08-04 09:26:41 -07:00
Justin Santa Barbara 434e1d2000 Add hints to CF integration test
We can save the CF output, which makes dealing with the base64 blob much
more convenient.
2017-08-04 11:08:11 -04:00
Kubernetes Submit Queue 29415860e2 Merge pull request #2950 from chrislovecnm/full-spec-warning
Automatic merge from submit-queue

adding warning about --full

This starts work on https://github.com/kubernetes/kops/issues/2290.  Adds a warning to deter users from using YAML generated by --full.
2017-08-03 21:05:02 -07:00
Blake 4f95fe473f Incorporate review feedback
- Rename to just DockerConfig / dockerconfig everywhere for consistency
- Check if the config is valid JSON
- Update docs
2017-08-01 13:15:19 -07:00
Blake 60dc81fe49 Add `kops create secret nodedockercfg` feature
This adds a well-known secret name `nodedockercfg` which will automatically
be used if present to create /root/.docker/config.json on all nodes. This will
allow private registries to be used for kops hooks as well as any k8s images
without the need to define `imagePullSecrets` in every namespace.

closes https://github.com/kubernetes/kops/issues/2505
2017-07-28 17:38:50 -07:00
Alexander Brandstedt 04a68e7ec8 change template func to take out io.Writer from function not directly use os.Stdout 2017-07-26 11:19:25 +02:00
Kubernetes Submit Queue c9e651b997 Merge pull request #3050 from craigmonson/master
Automatic merge from submit-queue

Fixing "dederation"

Noticed in some comments and docs, misspelled "dederation".  Fixed.
2017-07-25 14:53:50 -07:00
Kubernetes Submit Queue b371ff81b9 Merge pull request #3027 from justinsb/ssh_access_test
Automatic merge from submit-queue

Create test for ssh-access
2017-07-25 14:19:10 -07:00
craigmonson 4e31533761 fix "dederation" 2017-07-25 15:33:36 -04:00
craigmonson 3990f582b4 fix "dederation" 2017-07-25 15:31:46 -04:00
Alexander Brandstedt 89150391c1 remove inline example file with eof 2017-07-25 10:23:59 +02:00
Alexander Brandstedt b0cf65ceca correct squash 2017-07-25 10:23:59 +02:00
Alexander Brandstedt 21d43e3187 MPV implementation of templating to generate cluster.yaml file: related to #2404
rename command templating to template
2017-07-25 10:23:59 +02:00
Kubernetes Submit Queue 83fb549a9d Merge pull request #2960 from justinsb/dont_delete_shared_subnets
Automatic merge from submit-queue

Honor shared tags when deleting subnets/vpcs
2017-07-24 22:05:43 -07:00
Justin Santa Barbara 64f0920c8b Add integration tests for shared subnet & VPC 2017-07-24 10:37:07 -04:00
Justin Santa Barbara 94fceff30a Fix more instances where cluster could be nil
Generally check the return value where we can't tolerate it being nil,
similar to the case seen in #3011.
2017-07-23 23:39:57 -04:00
Justin Santa Barbara c537c7271c Avoid panic when cluster not found
Based on the stack trace in #3011

Fix #3011
2017-07-23 23:21:50 -04:00
Kubernetes Submit Queue 89dd78bee9 Merge pull request #3026 from justinsb/repoint_pause_2
Automatic merge from submit-queue

Remap pause image through our AssetBuilder
2017-07-22 19:01:31 -07:00
Justin Santa Barbara cde70934dc Create test for ssh-access 2017-07-22 01:45:03 -04:00
Kubernetes Submit Queue 14a8c9ae89 Merge pull request #3014 from BradErz/adding-ssh-access
Automatic merge from submit-queue

Adding ssh access flag 

Adding --ssh-access flag to seperate from --admin-access

Addresses: https://github.com/kubernetes/kops/issues/3013
2017-07-21 22:43:02 -07:00
Justin Santa Barbara 0115ece62d Remap pause image through our AssetBuilder 2017-07-22 00:35:37 -04:00
Kubernetes Submit Queue 62d702a22b Merge pull request #2763 from justinsb/lifecycle
Automatic merge from submit-queue

Support for lifecycles
2017-07-21 09:59:00 -07:00
Bradley a798cc721c Adding the case where adminAccess is not set but sshAccess is 2017-07-21 17:28:17 +01:00
Bradley 490407e199 removed logs 2017-07-20 22:02:52 +01:00
Bradley fa755127a7 Fixing docs 2017-07-20 22:01:47 +01:00