Commit Graph

806 Commits

Author SHA1 Message Date
Kashif Saadat c78790f902 Modified OS detection logic when updating http proxy settings. 2017-10-13 19:08:47 +01:00
chrislovecnm f00ee27dbe adding missing lifecycle to route table task 2017-10-12 11:55:50 -06:00
Kubernetes Submit Queue 5b6a8ecc05 Merge pull request #3593 from justinsb/limit_gce_task_length
Automatic merge from submit-queue.

GCE: Limit length of InstanceTemplate names
2017-10-10 21:49:23 -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
Justin Santa Barbara d71bd09a6c GCE: Limit length of InstanceTemplate
We explicitly set a separate prefix for the names, and we ensure it is
not too long
2017-10-10 09:48:38 -04:00
Manatsawin Hanmongkolchai a06fbbac79 Added documentation that PolicyConfigMap should not be used during cluster creation 2017-10-10 09:33:48 +07:00
Manatsawin Hanmongkolchai c00f5ea9a7 Added error when trying to use kube-scheduler policyConfigMap before Kube 1.7.x 2017-10-10 09:10:05 +07:00
Manatsawin Hanmongkolchai 78023ba0df Updated PolicyConfigMap comment 2017-10-10 09:10:05 +07:00
Manatsawin Hanmongkolchai 0f2dde994c Regenerated API 2017-10-10 09:10:04 +07:00
Manatsawin Hanmongkolchai 091e87eb4f Added PolicyConfigMap and PolicyConfigMapNamespace to KubeSchedulerConfig 2017-10-10 09:10:04 +07: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
Kubernetes Submit Queue b052495e3d Merge pull request #3448 from justinsb/unit_test_new_model_helpers
Automatic merge from submit-queue.

Add unit test for model helper functions
2017-10-08 12:42:30 -07:00
Kubernetes Submit Queue 14ba6d0414 Merge pull request #3474 from chrislovecnm/test-cleanup
Automatic merge from submit-queue.

Fixing stdout on tests - cleaning house

We are printing to STDOUT and logging in some tests.  Not needed.
2017-10-08 10:01:05 -07:00
Justin Santa Barbara 0356f45957 Add unit test for model helper functions 2017-10-08 11:49:39 -04:00
Justin Santa Barbara 8693683324 GCE: use recreateInstance when rolling a MIG 2017-10-04 02:54:40 -04:00
Kubernetes Submit Queue 35ead73978 Merge pull request #3462 from justinsb/map_docker_1_13_1_17_03_1
Automatic merge from submit-queue.

Map docker 1.13.1 & 17.03.1, default 1.8 to 1.13.1

Kubernetes 1.8 adds validation for 1.13.1 and 17.03.1 (17.03.1 being
essentially the same as 1.13.1).

For 1.8, the default should be 1.13.1
2017-10-03 18:10:52 -07:00
Justin Santa Barbara cc559dc373 Map docker 1.13.1 & 17.03.2, default 1.8 to 1.13.1
Kubernetes 1.8 is validated with 1.13.1 and 17.03.2.

For 1.8, the default should be 1.13.1
2017-10-03 19:04:20 -04: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 b63f4d2dbe Add data dependencies to go_test rules
This lets all the tests pass in bazel, other than create_cluster which
references files outside its tree.
2017-10-03 10:45:50 -04:00
Kubernetes Submit Queue 518e97d97b Merge pull request #3510 from justinsb/bazel
Automatic merge from submit-queue.

Initial bazel support

Builds on the 1.8 version bump

The "trick" is to strip the BUILD & BUILD.bazel files from the vendor-ed deps.

Will rebase after 1.8 version bump merges.
2017-10-03 01:19:27 -07:00
Kubernetes Submit Queue 1c81ec5e42 Merge pull request #3490 from justinsb/download_with_wget
Automatic merge from submit-queue.

Support wget for download, not just curl
2017-10-03 00:45:04 -07:00
Kubernetes Submit Queue 48e61b9523 Merge pull request #3507 from justinsb/gce_rolling_update
Automatic merge from submit-queue.

rolling-update - initial GCE support
2017-10-03 00:05:03 -07:00
Kubernetes Submit Queue 74d48eab46 Merge pull request #3496 from justinsb/using-same-disk-size-refactor
Automatic merge from submit-queue.

Tweak signature in #3478

Follow-on to #3478

Because the default doesn't depend on the user-specified value, it's
misleading to pass it in.
2017-10-02 23:29:40 -07:00
Justin Santa Barbara 737f2fcd80 rolling-update - initial GCE support 2017-10-02 23:07:35 -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 4b328e67a7 New apimachinery codegen 2017-10-01 13:53:42 -04:00
Justin Santa Barbara 2205e26257 Updates for new apimachinery 2017-10-01 13:53:26 -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
Kubernetes Submit Queue 34bb6ec3cd Merge pull request #3494 from justinsb/pod_critical_annotations
Automatic merge from submit-queue.

Add critical pod annotations to our system pods
2017-09-30 22:32:08 -07:00
Justin Santa Barbara a4a58d277d Mirroring - Fixes from code review 2017-09-30 22:05:14 -04:00
Justin Santa Barbara 66b174321f Cleanup signature of default volume-size method
Because the default doesn't depend on the user-specified value, it's
misleading to pass it in.
2017-09-30 21:24:51 -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
Kubernetes Submit Queue 0ef1b697af Merge pull request #3493 from justinsb/dry_getgroups
Automatic merge from submit-queue.

Minor cleanups to #3446

Felt easier than iterating in PR comments!
2017-09-30 17:19:35 -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 eb2cd45cdf Support wget for download, not just curl
Some images don't include curl but do have wget.  Prefer curl, but
fallback to wget.

(The official Debian 9 image does not have curl.)
2017-09-30 19:12:58 -04:00
Kubernetes Submit Queue eb110f5b6c Merge pull request #3478 from chrislovecnm/using-same-disk-size-gce
Automatic merge from submit-queue.

using same disk sizes for gce

Using the same disk size for gce and aws.  We need to override the disk sizes in the e2e tests, but that is another PR.

Closes: https://github.com/kubernetes/kops/issues/3294
2017-09-30 16:01:38 -07:00
Justin Santa Barbara abd48ee653 Name CloudInstanceGroupMember consistently
Keep the naming of the type consistent.
2017-09-30 17:39:53 -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
Justin Santa Barbara a5d72ca190 DRY FindAutoscalingGroups by removing from resources pkg 2017-09-30 17:39:53 -04:00
Kubernetes Submit Queue c7b4f7e925 Merge pull request #3446 from chrislovecnm/aws-get-groups
Automatic merge from submit-queue.

Refactoring to use cloud method for getting cloud groups

This builds on various other PRs.  The only two SHAs to review are:

1. Moving delete instancesgroups into its own file d52d767508
2. Refactoring to use cloud based GetCloudGroups c33a078f52

AWS is the only one that has GetCloudGroups implemented at this point.  GCE is next.

TODO

- [x] e2e testing rolling-update
- [x] e2e testing rolling-update with only one instance group
- [x] e2e testing force
- [x] e2e testing cloud-only

Updates

I have moved more of the code into `/pkg/cloudinstances` per guidance from @justinsb!  I am liking it more!
2017-09-30 14:39:06 -07:00
Justin Santa Barbara 383194780a Create helper function for critical pod annotations
In particularly I think we want a toleration also; easiest to put the
code in one function.
2017-09-30 17:38:20 -04:00
chrislovecnm c9cc561885 refactoring FindInstanceTemplates into gce cloud interface 2017-09-30 14:02:58 -06:00
Justin Santa Barbara b32e6b569f baremetal: error if NetworkCIDR set 2017-09-30 15:10:10 -04:00
chrislovecnm c4c63b2b0c using same disk sizes for gce 2017-09-29 16:07:38 -06:00
chrislovecnm a431eb3e43 refactoring to use cloud based GetGroups 2017-09-29 12:29:07 -06:00
chrislovecnm 9bf197830f Fixing stdout on tests 2017-09-29 12:25:07 -06:00
chrislovecnm 2f12a3e521 refactoring delete into its own file 2017-09-28 15:52:50 -06:00
chrislovecnm 93f3600f36 adding aws_cloud instancegroups delete and get methods 2017-09-28 15:52:50 -06:00
chrislovecnm db5b931579 Adding three new funcs for cloud providers, for refactoring delete and
get
2017-09-28 15:52:49 -06:00
Rohith a7abb07d56 Component Manifests
The current kube manifest redirect all the logs into host located log files, this PR uses the tee command to pipe into both local logs (retaining the current) and docker stdout (which will be picked up by the journald or which every logging your using. Note also permits as to now need the logs via the kubectl command.

- renamed some of the files to make things cleaner
- redirecting the logs from the kubernetes components into local file and stdout
- cleaned up any vetting or linting error i came across
2017-09-27 15:48:41 +01:00
Justin Santa Barbara b7f6261993 Fix version comparison: mask out pre & build fields 2017-09-25 01:04:47 -04:00
Kubernetes Submit Queue fc3716677a Merge pull request #3345 from andreychernih/enable-critical-feature-gate
Automatic merge from submit-queue. .

Enable ExperimentalCriticalPodAnnotation feature gate

Otherwise, it is possible that critical system components will be evicted

https://github.com/kubernetes/kops/issues/3194
https://github.com/kubernetes/kubernetes/issues/51432
2017-09-24 21:59:49 -07: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
chrislovecnm 8dabeecd3b tweaking ux printing rolled cluster name 2017-09-23 19:41:36 -06:00
Kubernetes Submit Queue a7fccedf5e Merge pull request #3406 from justinsb/baremetal_relax_to_create_objects
Automatic merge from submit-queue. .

baremetal: fill out more of the baremetal mappings
2017-09-23 18:39:27 -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
chrislovecnm acb5e8b5a6 promoting drain and validate by setting feature flag to true 2017-09-23 16:48:01 -06:00
Justin Santa Barbara ecc78c06bd 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 16:32:52 -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
Justin Santa Barbara 45032502c6 baremetal: fill out more of the baremetal mappings
This gets us to the point where we can create the objects.
2017-09-22 23:03:07 -04:00
Kubernetes Submit Queue 6a238539e0 Merge pull request #3368 from georgebuckerfield/enable-data-encryption
Automatic merge from submit-queue. .

Support encryption-at-rest for the kube-apiserver

This PR adds support for enabling encryption-at-rest for data in etcd, via the kube-apiserver (as per https://kubernetes.io/docs/tasks/administer-cluster/encrypt-data).

I've put the functionality behind a feature flag, `+EnableDataEncryption`. It can then be enabled per-cluster by using `--enable-encryption-config` on the command line, or by adding a `kubeEncryptionConfig` section to the cluster spec. This is passed through to the kube-apiserver by the nodeup process. I'm not sure if this is the best way of doing it right now, but it is working.

Fixes #3356.
2017-09-22 17:56:44 -07:00
Kubernetes Submit Queue 14263de04a Merge pull request #3398 from justinsb/gce_dont_remove_shared_dns_zone
Automatic merge from submit-queue. .

GCE: Don't remove (shared) DNS Zone
2017-09-22 17:19:42 -07:00
Kubernetes Submit Queue 784da374c7 Merge pull request #3408 from wlan0/api
Automatic merge from submit-queue. .

Add apimachinery changes to enable cloud controller manager

This is part I of multi part Pull Request to enable the
cloud-controller-manager through kops. This specific PR introduces the
cloud-controller-manager api, and puts it behind a feature flag.

Please feel free to merge this.
2017-09-22 12:33:35 -07: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 8ff312397b GCE: Don't remove (shared) DNS Zone
We don't create it, we shouldn't be deleting it.
2017-09-22 09:31:49 -04:00
Rohith b64795673d DNS Controller Limitation
The current implementation does not place any limitation on the dns annontation which the dns-controller can consume. In a multi-tenented environment was have to ensure certain safe guards are met, so users can't byt accident or intentionally alter our internal dns. Note; the current behaviour has not been changed;

- added the --watch-namespace option to the dns controller and WatchNamespace to the spec
- cleaned up area of the code where possible or related
- fixed an vetting issues that i came across on the journey
- renamed the dns-controller watcher files
2017-09-22 11:37:00 +01:00
wlan0 0d91badd8f Add apimachinery changes to enable cloud controller manager
This is part I of multi part Pull Request to enable the
cloud-controller-manager through kops. This specific PR introduces the
cloud-controller-manager api, and puts it behind a feature flag.

Please feel free to merge this.
2017-09-21 10:01:09 -07:00
Kubernetes Submit Queue 0756ece56f Merge pull request #3421 from KashifSaadat/canal-config-options
Automatic merge from submit-queue. .

Support additional config options for Canal Networking

Add support for additional global and iptables configuration options within the Canal Networking Spec: https://docs.projectcalico.org/v2.4/reference/felix/configuration

- **ChainInsertMode:** Controls whether Felix inserts rules to the top of iptables chains, or appends to the bottom. Leaving the default option is safest to prevent accidentally breaking connectivity. Default: 'insert' (other options: 'append')
- **PrometheusMetricsEnabled:** Set to enable the experimental Prometheus metrics server (default: false)
- **PrometheusMetricsPort:** TCP port that the experimental Prometheus metrics server should bind to (default: 9091)
- **PrometheusGoMetricsEnabled:** Enable Prometheus Go runtime metrics collection
- **PrometheusProcessMetricsEnabled:** Enable Prometheus process metrics collection
2017-09-21 08:20:49 -07:00
Kubernetes Submit Queue b1b7a9e226 Merge pull request #3403 from justinsb/gce_nodeport_lockdown
Automatic merge from submit-queue. .

GCE: Don't open NodePort range to all by default
2017-09-21 00:45:35 -07:00
Kubernetes Submit Queue 66b9838a8c Merge pull request #3215 from johnzeringue/specify-ssh-key-name
Automatic merge from submit-queue. .

Allow specifying a SSH key name for AWS

Related to #2309, this allows naming an existing key pair using the
cluster spec field `sshKeyName`.

In our use case, kops can now be used without providing the ability to
create EC2 key pairs.
2017-09-20 21:15:43 -07:00
Kashif Saadat f1109dbf29 Support additional config options for Canal Networking 2017-09-20 15:44:02 +01:00
Andrey Chernih b3acc4b5f8 Merge branch 'master' into enable-critical-feature-gate 2017-09-18 20:05:22 -07:00
Andrey Chernih 56553c5971 Add ability to override feature gates and check version 2017-09-18 20:04:54 -07:00
Justin Santa Barbara 1eb2bed921 GCE: Don't open NodePort range to all by default
We set a redundant SourceTag filter if there are no SourceRanges set.
2017-09-17 15:22:20 -04: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
Kubernetes Submit Queue 70007f869d Merge pull request #3323 from KashifSaadat/bootstrap-include-file-assets
Automatic merge from submit-queue

Add file assets to node user data scripts, fingerprint fileAssets and hooks content.

**Changes made:**
- Include FileAssets in the bootstrapscript (user-data for all nodes), selectively dependent on the roles specified for each asset.
- Fingerprint the sections of the FileAssets (Content) and Hooks (Manifests, ExecContainer Commands) Specs within the bootstrap script to reduce size (otherwise this can very quickly hit the 16KB user data limit with AWS).
2017-09-15 10:44:17 -07:00
Kubernetes Submit Queue 52fe2ceab4 Merge pull request #3343 from KashifSaadat/iam-policy-revision
Automatic merge from submit-queue

Revision to IAM Policies created by Kops

Based off of the work done by @chrislovecnm in PR #2497.

This PR tightens down the IAM policies created for Master & Node instance groups. The Cluster Spec `IAMSpec.Legacy` flag is used to control application of stricter policy rules, which is defaulted to true for existing clusters (to limit potential regression impact), and false for new cluster creation.
2017-09-15 08:32:47 -07:00
chrislovecnm 2e6b7eedb9 Revision to IAM Policies created by Kops, and wrapped in Cluster Spec
IAM Legacy flag.
2017-09-15 08:05:23 +01:00
Justin Santa Barbara b29f3a7505 Honor ServiceNodePortRange when opening NodePort access 2017-09-15 00:39:41 -04: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 ec074bb473 Merge pull request #3346 from rushtehrani/update-autoscaling-policy
Automatic merge from submit-queue

add autoscaling:DescribeLaunchConfigurations permission

As of 0.6.1, Cluster Autoscaler supports [scaling node groups from/to 0](https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler/cloudprovider/aws#scaling-a-node-group-to-0), but requires the `autoscaling:DescribeLaunchConfigurations` permission.  

It'd be great to have this in kops since this permission needs to be re-added back to the master policy every time the cluster is updated.
2017-09-14 18:17:42 -07:00
Kubernetes Submit Queue 893217fea0 Merge pull request #3333 from robinpercy/node-port-range
Automatic merge from submit-queue

Added ability to set --service-node-port-range

Addresses: #3052 and #3326 

From what I can tell, `--service-node-port-range` has been a valid option forever, so I haven't worried about k8s versions.

@justinsb @chrislovecnm let me know if any changes are required.
2017-09-14 17:11:15 -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 5c0ac9de73 Merge pull request #3362 from justinsb/iam_createsecurityggroup
Automatic merge from submit-queue

Add CreateSecurityGroup permission
2017-09-10 17:21:17 -07:00
Justin Santa Barbara 7b5510028a Add CreateSecurityGroup permission
Also document the available filtering for the methods we use.
2017-09-10 19:14:41 -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
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
Robin Percy e1b20c0217 Added ability to set --service-node-port-range on kube-apiserver 2017-09-07 17:01:15 -07:00
John Zeringue 13d22fdd1a Allow specifying a SSH key name for AWS
Related to #2309, this allows naming an existing key pair using the
cluster spec field `sshKeyName`.

In our use case, kops can now be used without providing the ability to
create EC2 key pairs.
2017-09-07 08:24:13 -04:00
Kubernetes Submit Queue 31e7fbf082 Merge pull request #3286 from justinsb/keyset_object
Automatic merge from submit-queue

Create Keyset API type

A Keyset holds a set of keypairs or other secret cluster material.

It is a set to support rotation of keys.

This will allow us to store secrets on kops-server (and also is a step towards
separating where we manage secrets from how we communicate them to running
clusters, which will allow bare-metal or KMS)

Starting with just the API objects.
2017-09-06 11:36:14 -07: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
rushtehrani db505adb65 add autoscaling:DescribeLaunchConfigurations action 2017-09-05 23:41:19 -07:00
Andrey Chernih 11c702ea0c Enable ExperimentalCriticalPodAnnotation feature gate
Otherwise, it is possible that critical system components will be
evicted

https://github.com/kubernetes/kops/issues/3194
https://github.com/kubernetes/kubernetes/issues/51432

Closes #3194
2017-09-05 21:28:13 -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
Kashif Saadat e4919d0c39 Add file assets to node user data scripts, fingerprint sections of the
hooks and fileAssets specs.
2017-09-01 15:25:04 +01: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
Kubernetes Submit Queue 155650eb82 Merge pull request #2504 from reactiveops/flag-watch-ingress
Automatic merge from submit-queue

Adds DNSControllerSpec and WatchIngress flag

This PR is in reference to #2496, #2468 and the issues referenced in there relating to use of the watch-ingress flag. 

This PR attempts to rectify this situation and gives users who want it, the option to turn on watch-ingress without forcing it on them. Also spits out a warning to the logs about potential side effects.

Includes notes in `docs/cluster_spec.md` to explain.
2017-08-29 23:31:57 -07:00
Kubernetes Submit Queue 47ed9e43ee Merge pull request #3307 from justinsb/misc_warnings
Automatic merge from submit-queue

Misc go vet fixes
2017-08-29 22:59:40 -07:00
Kubernetes Submit Queue 0e48620975 Merge pull request #3302 from gambol99/kubelet_options
Automatic merge from submit-queue

Additional Kubelet Options

This PR add additional options to the kubelet spec allowing users to set the --runtime-request-timeout and -volume-stats-agg-period

In related to issue https://github.com/kubernetes/kops/issues/3265
2017-08-29 14:32:55 -07:00
Kubernetes Submit Queue 6610153df9 Merge pull request #3303 from gambol99/kubelet_readonly
Automatic merge from submit-queue

Kubelet Readonly Port

The current implementation does not permit the user to specify the kubelet read-only port (which unset defaults to 10255). For security reasons we need this port switched off i.e. 0. This PR retains the default behavior but adds the readOnlyPort as an option for those whom need to override.

```shell
   podInfraContainerImage: gcr.io/google_containers/pause-amd64:3.0
   podManifestPath: /etc/kubernetes/manifests
+  readOnlyPort: 0
   registerSchedulable: false
   requireKubeconfig: true
```
And tested on the box
```shell
core@ip-10-250-34-23 ~ $ egrep -o 'read-only-port=[0-9]+' /etc/sysconfig/kubelet 
read-only-port=0
```
2017-08-29 13:59:04 -07: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
Rohith bf5e154225 Additional Kubelet Options
In related to issue https://github.com/kubernetes/kops/issues/3265
2017-08-29 08:44:25 +01:00
Eric Hole 673cdf6b5f Fixes merge conflicts 2017-08-28 19:10:21 -07:00
Rohith 9bbe569f3c Kubelet Readonly Port
The current implementaton does not permit the user to specify the kubelet read-only port (which unset defaults to 10255). Note security reasons we need this port switched off i.e. 0. This PR retains the default behaviour but adds the readOnlyPort as an options for those whom need to override.

   podInfraContainerImage: gcr.io/google_containers/pause-amd64:3.0
   podManifestPath: /etc/kubernetes/manifests
+  readOnlyPort: 0
   registerSchedulable: false
   requireKubeconfig: true
2017-08-28 20:53:36 +01:00
Justin Santa Barbara df8bbb2ff6 baremetal: relax validation on subnets & networking
For baremetal, we don't require that subnets or the network CIDR is
specified.
2017-08-28 11:31:52 -04:00
Kubernetes Submit Queue 327235a22c Merge pull request #3288 from justinsb/refactor_pki
Automatic merge from submit-queue

Refactor PKI classes into their own package
2017-08-28 07:01:27 -07: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 1aef760d86 Merge pull request #3272 from KashifSaadat/canal-custom-endpoint-to-host-action
Automatic merge from submit-queue

Allow user defined endpoint to host action for Canal

Adds ability to define `Networking.Canal.DefaultEndpointToHostAction` in the Cluster Spec. This allows you to customise the behaviour of traffic routing from a pod to the host (after calico iptables chains have been processed). `ACCEPT` is the default value and is left as-is.

`If you want to allow some or all traffic from endpoint to host, set this parameter to “RETURN” or “ACCEPT”. Use “RETURN” if you have your own rules in the iptables “INPUT” chain; Calico will insert its rules at the top of that chain, then “RETURN” packets to the “INPUT” chain once it has completed processing workload endpoint egress policy.`
2017-08-28 02:31:00 -07:00
Kubernetes Submit Queue fdce8b4b7b Merge pull request #3186 from KashifSaadat/limit-master-ec2-policy
Automatic merge from submit-queue

Limit the IAM EC2 policy for the master nodes

Related to: https://github.com/kubernetes/kops/pull/3158

The EC2 policy for the master nodes are quite open currently, allowing them to create/delete/modify resources that are not associated with the cluster the node originates from. I've come up with a potential solution using condition keys to validate that the `ec2:ResourceTag/KubernetesCluster` matches the cluster name.
2017-08-28 02:00:46 -07:00
chrislovecnm 0779fb6fc4 Implementing GCE as an inteface modelling aws cloud provider 2017-08-27 22:19:25 -06:00
Justin Santa Barbara 4d52a7c9e6 Add Initializers admission controller
Also sync up Admission controllers with current default sets for 1.7 &
1.8
2017-08-27 20:53:57 -04:00
Justin Santa Barbara a16c8b1500 Refactor PKI classes into their own package
This will support generation of keys on the node.
2017-08-27 08:14:55 -04:00
Kubernetes Submit Queue 1e5cf2db52 Merge pull request #3270 from gambol99/secrets
Automatic merge from submit-queue

Kops Secrets on Nodes

The current implementation permits nodes access to /secrets/* though the nodes themselve do [not](https://github.com/gambol99/kops/blob/secrets/nodeup/pkg/model/secrets.go#L77-L79) require access. This PR changed the ACL on the iam policy to deny access for nodes to /secrets/*

- removed the /secrets from node iam policy
- ordered the list alphabetically 

one @question ... when would [this](https://github.com/gambol99/kops/blob/secrets/nodeup/pkg/model/secrets.go#L61-L74) be used? ... and given you can managed dockerconfig in k8s is this needed ...
2017-08-26 18:11:24 -07:00
Justin Santa Barbara 456a863416 codegen: apimachinery 2017-08-26 09:55:58 -04:00
Justin Santa Barbara 8792323fa0 Add Keyset API type
This will allow management of cluster secrets in kops-server
2017-08-26 08:55:23 -04:00
Kashif Saadat 2ffc790c66 Added validation to Networking Canal spec. 2017-08-26 12:53:44 +01:00
Kashif Saadat d9e4a62994 Allow user defined endpoint to host action for Canal 2017-08-26 12:53:44 +01:00
Kashif Saadat d6e5a62678 Limit the IAM EC2 policy for the master nodes, wrapped in 'Spec.IAM.LegacyIAM' API flag. 2017-08-26 11:46:09 +01:00
georgebuckerfield 58960f39cd Move etcd config for apiserver into code, set cloud provider for Digital Ocean to external 2017-08-26 08:23:19 +01:00
georgebuckerfield ff7f60dc35 Initial work on moving apiserver templates into code 2017-08-26 00:32:28 +01:00
Rohith 0dc4e5e4dc Kops Secrets on Nodes
The current implementation permits nodes access to /secrets/* thought the nodes themselve do [not](https://github.com/gambol99/kops/blob/secrets/nodeup/pkg/model/secrets.go#L77-L79) require access. This PR changed the ACL on the iam policy to deny access for nodes to /secrets/*
2017-08-25 19:47:37 +01: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
Kubernetes Submit Queue 9cfd303154 Merge pull request #3267 from gambol99/ignore_content
Automatic merge from submit-queue

Inline Component Configuration Fix

The current implementation does not ignore any possible interpolation of bash in the content. This PR wrapped the various spec content in 'EOF' to ignore all. All tested on a working cluster.

- updated the tests to reflect the changes
- wrapped the component configuration in 'eof' to ensure interpolation is ignored
- dropped the t.Log debug line
2017-08-24 18:51:29 -07:00
Kubernetes Submit Queue 0aaafb8328 Merge pull request #3183 from justinsb/offline_channel
Automatic merge from submit-queue

Read the channel from the local filesystem during tests
2017-08-24 17:39:25 -07:00
Rohith 293292173a Inline Conponent Configuration
The current implementation does not ignore any possible interpolation of bash in the content. This PR wrapped the various spec content in 'EOF' to ignore all.

- updated the tests to reflect the changes
- wrapped the component configuration in 'eof' to ensure interpolation is ignored
2017-08-25 00:36:06 +01:00
Kubernetes Submit Queue 63480a79f3 Merge pull request #3259 from gambol99/docker_ulimits
Automatic merge from submit-queue

Docker Default Ulimits

The current implementation does not permit us to set the default ulimit on docker daemon (currently a requirement for our elasticsearch). This PR add the DefaultUlimit option to the DockerConfig
2017-08-24 14:30:48 -07:00
Rohith 9b9e4bb123 Docker Default Ulimits
The current implementation does not permit us to set the default ulimit on docker daemon (currently a requirement for our logstash). This PR add the DefaultUlimit option to the DockerConfig
2017-08-24 21:24:41 +01:00
Justin Santa Barbara a467d9dbd7 Add godoc comments 2017-08-24 14:03:37 -04: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
Alexander Brandstedt 66d4c4ed67 change PulicKey to lower p as in publicKey in json 2017-08-23 12:38:27 +02:00
Alexander Brandstedt f9867302b0 update api machinery 2017-08-23 12:22:55 +02:00
Alexander Brandstedt 5705885d02 rename sshsecret to sshcredential and update files to reflect change. 2017-08-23 12:18:10 +02:00
Kashif Saadat c9c70695ad Validate AWS machine type on cluster ig update 2017-08-23 10:00:07 +01: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
Kubernetes Submit Queue 4edc267fb8 Merge pull request #3090 from gambol99/file_assets
Automatic merge from submit-queue

Cluster / InstanceGroup File Assets

@chrislovecnm @justinsb ... 

The current implementation does not make it ease to fully customize nodes before kube install. This PR adds the ability to include file assets in the cluster and instaneGroup spec which can be consumed by nodeup. Allowing those whom need (i.e. me :-)) greater flexibilty around their nodes. @Note, nothing is enforced, so unless you've specified anything everything is as the same

- updated the cluster_spec.md to reflect the changes
- permit users to place inline files into the cluster and instance group specs
- added the ability to template the files, the Cluster and InstanceGroup specs are passed into context
- cleaned up and missed comment, unordered imports etc along the journey

notes: In addition to this; need to look at the detecting the changes in the cluster and instance group spec. Think out loud perhaps using a last_known_configuration annotation, similar to kubernetes
2017-08-22 19:49:48 -07:00
Kubernetes Submit Queue 2d7fb51c2a Merge pull request #3025 from chrislovecnm/mapping-and-uploading-kubernetes-assets
Automatic merge from submit-queue

inventory assets - mapping and uploading kubernetes containers
2017-08-22 19:15:31 -07:00
Kubernetes Submit Queue 7a2ff89d77 Merge pull request #3248 from andrewsykim/do
Automatic merge from submit-queue

Create cluster requirements for DigitalOcean

Initial changes required to create a cluster state. Running `kops update cluster --yes` does not work yet. 

Note that DO has already adopted cloud controller managers (https://github.com/digitalocean/digitalocean-cloud-controller-manager) so we set `--cloud-provider=external`. This will end up being the case for aws, gce and vsphere over the next couple of releases. 

https://github.com/kubernetes/kops/issues/2150

```bash
$ kops create cluster --cloud=digitalocean --name=dev.asykim.com --zones=tor1
I0821 18:47:06.302218   28623 create_cluster.go:845] Using SSH public key: /Users/AndrewSyKim/.ssh/id_rsa.pub
I0821 18:47:06.302293   28623 subnets.go:183] Assigned CIDR 172.20.32.0/19 to subnet tor1
Previewing changes that will be made:

I0821 18:47:11.457696   28623 executor.go:91] Tasks: 0 done / 27 total; 27 can run
I0821 18:47:12.113133   28623 executor.go:91] Tasks: 27 done / 27 total; 0 can run
Will create resources:
  Keypair/kops
  	Subject             	o=system:masters,cn=kops
  	Type                	client

  Keypair/kube-controller-manager
  	Subject             	cn=system:kube-controller-manager
  	Type                	client

  Keypair/kube-proxy
  	Subject             	cn=system:kube-proxy
  	Type                	client

  Keypair/kube-scheduler
  	Subject             	cn=system:kube-scheduler
  	Type                	client

  Keypair/kubecfg
  	Subject             	o=system:masters,cn=kubecfg
  	Type                	client

  Keypair/kubelet
  	Subject             	o=system:nodes,cn=kubelet
  	Type                	client

  Keypair/kubelet-api
  	Subject             	cn=kubelet-api
  	Type                	client

  Keypair/master
  	Subject             	cn=kubernetes-master
  	Type                	server
  	AlternateNames      	[100.64.0.1, 127.0.0.1, api.dev.asykim.com, api.internal.dev.asykim.com, kubernetes, kubernetes.default, kubernetes.default.svc, kubernetes.default.svc.cluster.local]

  ManagedFile/dev.asykim.com-addons-bootstrap
  	Location            	addons/bootstrap-channel.yaml

  ManagedFile/dev.asykim.com-addons-core.addons.k8s.io
  	Location            	addons/core.addons.k8s.io/v1.4.0.yaml

  ManagedFile/dev.asykim.com-addons-dns-controller.addons.k8s.io-k8s-1.6
  	Location            	addons/dns-controller.addons.k8s.io/k8s-1.6.yaml

  ManagedFile/dev.asykim.com-addons-dns-controller.addons.k8s.io-pre-k8s-1.6
  	Location            	addons/dns-controller.addons.k8s.io/pre-k8s-1.6.yaml

  ManagedFile/dev.asykim.com-addons-kube-dns.addons.k8s.io-k8s-1.6
  	Location            	addons/kube-dns.addons.k8s.io/k8s-1.6.yaml

  ManagedFile/dev.asykim.com-addons-kube-dns.addons.k8s.io-pre-k8s-1.6
  	Location            	addons/kube-dns.addons.k8s.io/pre-k8s-1.6.yaml

  ManagedFile/dev.asykim.com-addons-limit-range.addons.k8s.io
  	Location            	addons/limit-range.addons.k8s.io/v1.5.0.yaml

  ManagedFile/dev.asykim.com-addons-storage-aws.addons.k8s.io
  	Location            	addons/storage-aws.addons.k8s.io/v1.6.0.yaml

  Secret/admin

  Secret/kube

  Secret/kube-proxy

  Secret/kubelet

  Secret/system:controller_manager

  Secret/system:dns

  Secret/system:logging

  Secret/system:monitoring

  Secret/system:scheduler

Must specify --yes to apply changes

Cluster configuration has been created.

Suggestions:
 * list clusters with: kops get cluster
 * edit this cluster with: kops edit cluster dev.asykim.com
 * edit your node instance group: kops edit ig --name=dev.asykim.com nodes
 * edit your master instance group: kops edit ig --name=dev.asykim.com master-tor1

Finally configure your cluster with: kops update cluster dev.asykim.com --yes
```
2017-08-22 18:41:10 -07:00
Torin Sandall 7cf6e1036c Add support for proxy client certs
This enables external admission controller webhooks, api aggregation,
and anything else that relies on the
--proxy-client-cert-file/--proxy-client-key-file apiserver args.
2017-08-22 08:03:36 -07:00