Commit Graph

57 Commits

Author SHA1 Message Date
Justin Santa Barbara d8895c57ec Add version logic to UseServiceAccountIAM
Co-authored-by: John Gardiner Myers <jgmyers@proofpoint.com>
2020-09-09 09:57:07 -04:00
Justin SB 8498ac9dbb Create PublicJWKS feature flag
This should be much easier to start and to get under testing; it only
works with a load balancer, it sets the apiserver into anonymous-auth
allowed, it grants the anonymous auth user permission to read our jwks
tokens.  But it shouldn't need a second bucket or anything of that
nature.

Co-authored-by: John Gardiner Myers <jgmyers@proofpoint.com>
2020-09-09 09:57:06 -04:00
Justin SB b158ffab04 Refactor: KopsModelContext embeds IAMModelContext
go syntax makes this an annoying change, unfortunately.
2020-08-25 11:22:34 -04:00
Peter Rifel 4d9f0128a3
Upgrade to klog2
This splits up the kubernetes 1.19 PR to make it easier to keep up to date until we get it sorted out.
2020-08-16 20:56:48 -05:00
John Gardiner Myers c5871df319 Get kubelet certificate from kops-controller 2020-08-15 10:30:20 -07:00
John Gardiner Myers 00c60ddff6 Add server code to kops-controller 2020-08-15 09:46:30 -07:00
Ciprian Hacman a7c8d2087c Use github.com/blang/semver/v4 2020-07-01 08:54:42 +03:00
Peter Rifel 460cdbfc67 Add CloudLabels tags to additional AWS resources
This adds any labels defined in the Cluster spec's CloudLabels to the tags of the following AWS resource types:

Elastic IP
Internet Gateway
NAT Gateway
Route Table
Security Group
Subnet
VPC DHCP Options
VPC
2020-04-11 13:25:52 -05:00
Ciprian Hacman 661bd6dfbd Add "owned" tag for all instance groups related resources 2020-03-02 10:39:50 +02:00
Ciprian Hacman e8c107f767 Update tags support for LaunchTemplates 2020-02-21 10:12:14 +02:00
Kubernetes Prow Robot 77d6d381c3
Merge pull request #8327 from johngmyers/remove-code
Remove code for unsupported Kubernetes versions
2020-01-15 14:54:22 -08:00
Austin Moore 4a88f7b5a5
Add ability to specify no ssh key by setting sshKeyName to empty
Add tests for no ssh key functionality

Add docs for setting no ssh key

Disable sshKey rendering for cloudformation if nosshkey is set

Fix broken test

make goimports

Fix

Formatting fix

Update kubernetes version for tests

Update expected test output

Fix imports in mesh.pb.go

Run hack/update-expected.sh

Change digital ocean logic to handle *string for SSHKeyName

Fix expected output

Missed a few
2020-01-15 15:24:32 -05:00
John Gardiner Myers e428903871 Remove code for unsupported k8s versions from pkg/model 2020-01-12 19:30:37 -08:00
Justin SB 4fe3db7faa
Don't share /etc/hosts when using etcd-manager
With etcd-manager the DNS names should only be used by the
etcd-manager pod itself, so we don't need to share /etc/hosts with the
host.

By not sharing we avoid:

(1) the temptation to address etcd directly
(2) problems of concurrent updates to /etc/hosts being hard from within a container (because locking is difficult across bind mounts)

Introducing with kubernetes 1.17 to avoid changing behavior of existing versions.
2020-01-12 11:56:14 -05:00
tanjunchen 28fdb358f8 fix-up staticcheck error 2019-10-08 13:53:04 +08:00
Justin SB 728e582360
Fill out kops controller functionality
k8s 1.16 requires that we move label setting away from the kubelet, to
a central controller.  kops-controller is that controller.
2019-09-25 12:04:34 -04:00
mikesplain 9e55b8230a Update copyright notices
Also cleans some white spaces
2019-09-09 14:47:51 -04:00
Justin SB 21cb8ece06
Label AWS ASGs with kops.k8s.io/instancegroup
We will use this to map an AWS instance to the instance group.
2019-09-02 09:26:23 -07:00
Justin SB 3e33ac7682
Change code from glog to klog
We don't call klog.InitFlags yet, because that will cause a flag
redefinition error until we get everyone to stop using glog.  That
will happen when we update to k8s 1.13.
2019-05-06 12:54:51 -04:00
Justin SB 31f408c978
Support etcd-manager in kops 1.12
In 1.12 (kops & kubenetes):

* We default etcd-manager on
* We default to etcd3
* We default to full TLS for etcd (client and peer)
* We stop allowing external access to etcd
2019-03-14 23:13:06 -04:00
Rohith 761d760c11 - updating the aws model to make use of the aws template and mixed instance policies 2019-02-04 11:59:42 +00:00
Rob Graham 8ccf42f4a2 GH-4252 Better name for the config value and also add to v1alpha1 API 2018-07-23 13:48:35 +01:00
Rob Graham e307021a6c remove log 2018-07-03 10:26:13 +01:00
Rob Graham ae327e1e8c wrestling with the api stuff 2018-07-02 15:16:37 +01:00
Rob Graham cc589ae538 Reworked to use loadbalancer only if config is specified 2018-07-02 12:02:50 +01:00
Rohith d2bae64dd1 - adding the enable-bootstrap-token-auth to the kubeapi and fixing up the various compoents 2018-06-11 09:57:26 +01:00
Rohith 2d5bd2cfd9 - update the IAM policy to ensure the kubelet permision is skipped
- update the PKI to ensure on new clusters the certificate it not created
2018-06-11 09:57:26 +01:00
Rohith 4531384649 This PR attempts to solve two issues
a) The current implementation use's a static kubelet which doesn't not conform to the Node authorization mode (i.e. system:nodes:<nodename>)
b) As present the kubeconfig is static and reused across all the masters and nodes

The PR firstly introduces the ability for users to use bootstrap tokens and secondly when enabled ensure the kubelets for the masters as have unique usernames.  Note, this PR does not attempt to address the distribution of the bootstrap tokens themselves, that's for cluster admins. One solution for this would be a daemonset on the masters running on hostNetwork and reuse dns-controller to annotated the pods and give as the DNS

Notes:
- the master node do not use bootstrap tokens, instead given they have access to the ca anyhow, we generate certificates for each.
- when bootstrap token is not enabled the behaviour will stay the same; i.e. a kubelet configuration brought down from the store.
- when bootstrap tokens are enabled, the Nodes sit in a timeout loop waiting for the configuration to appear (by third party).
- given the nodeup docker and manifests builders are executed before the kubelet builder, the assumption here is a unit file kicks of a custom container to bootstrap the rest.
- the current firewalls on between the master and nodes are fairly open so no need to open ports between the two
- much of the work was ported from @justinsb PR [here](https://github.com/kubernetes/kops/pull/4134/)
- we add a very presumptuous server and client certificates for use with an authorizer (node-bootstrap-internal.dns_zone)

I do have an additional PR which performs the entire thing. The process being a node_authorizer which runs on the master nodes via a daemonset, the service implements a series of authorizers (i.e. alwaysallow, aws, gce etc). For aws, the process is similar to how vault authorizes nodes [here](https://www.vaultproject.io/docs/auth/aws.html). Nodeup no then calls out to the node_authorizer on bootstrap and provisions the kubelet.
2018-06-11 09:56:32 +01:00
Justin Santa Barbara a7f82a6380 Fix shared subnet/vpc tags
* Stop setting the Name tag on a shared subnet/vpc

* Stop setting the legacy KubernetesCluster tag on a shared subnet/vpc
that is new enough (>=1.6); we rely on the shared tags instead

* Set tags on shared subnets; i.e. we _do_ set the shared tag on a
shared subnet; that is important for ELBs

* Set tags on shared VPCs; i.e. we _do_ set the shared tag on a shared
VPC; that is not used but consistent with subnets.

* Add tests for shared subnet
2017-10-23 11:30:25 -04: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 b29f3a7505 Honor ServiceNodePortRange when opening NodePort access 2017-09-15 00:39:41 -04:00
Rohith f61e1ebe08 Etcd TLS Options
- changed the location of this variable to be in the etcd cluster spec rather the kops cluster spec
- reflected the changes against the models
2017-08-06 20:50:05 +01:00
Seth Pollack 888702b1a9
populate cloud labels with cluster autoscaler tags 2017-07-21 10:47:25 -04:00
Justin Santa Barbara d2df318ecc Move CloudProvider to kops API
This avoids a circular reference when breaking up the fi package
2017-06-17 16:27:07 -04:00
Justin Santa Barbara 383c2bf5ed Use explicit tag management in network tasks
This lets us use the new shared cluster tags, for shared networking
objects - in particular subnets.

We continue to add the existing tags also, for compatability. When we
add direct management of shared networks, we will likely address that.
2017-05-01 22:55:27 -04:00
Justin Santa Barbara 864a999602 Fix automatic private DNS zone creation
We have to defer creation of the IAM policy until we have created the
hosted zone.

Fix #2444
2017-04-29 17:01:18 -04:00
Justin Santa Barbara 18886749d9 Always include hash, per code review
Thanks @kris-nova
2017-03-09 09:35:09 -05:00
Justin Santa Barbara 69c38f721e Switch how we build ELB names, but keep a feature flag 2017-03-09 09:18:31 -05:00
Justin Santa Barbara 724bd95e0b Use Name tag to match ELBs
Rather than using the LoadBalancerName to match, we match on the Name
tag.

Related to #2019
2017-03-09 09:18:31 -05:00
Justin Santa Barbara bf2edddb8d Merge pull request #1935 from justinsb/terraform_variable_output
Output variables from terraform, for reuse in a module
2017-02-24 09:06:20 -05:00
Justin Santa Barbara e09037dff0 Merge pull request #1969 from zytek/fix-1949
Resolve DNS Hosted Zone ID while building IAM policy
2017-02-23 10:21:39 -05:00
Robin Percy f9b3c5e584 Now applying the tags to IGs at render time.
- Previous method would have caused issues with the way tags are used
  for filtering resources.
- Updated docs and comments to only refer to instance groups, rather
  than all AWS resources
2017-02-23 06:10:15 -08:00
Jakub Paweł Głazik cd795d0c8c Resolve DNS Hosted Zone ID while building IAM policy
Fixes #1949
2017-02-23 11:45:58 +01:00
Justin Santa Barbara 2a34e6d00e Output variables from terraform, for reuse in a module
Issue #1026
2017-02-17 11:05:06 -05:00
Justin Santa Barbara 55b6d86454 Move more options to code
User reports of kubelet flags not being passed; moved more to code.

Also found & fixed the likely root-cause issue: we have two copies of
the cluster spec and were not being precise about which one we wanted to
use at all times.
2017-02-15 13:11:12 -05:00
Manuel de Brito Fontes da2630638b Fix build 2017-02-11 13:57:30 -03:00
Justin Santa Barbara 7b694d4b04 Fixes per code review 2017-01-29 02:55:31 -05:00
Justin Santa Barbara ba5434caf0 Relax DNS requirements on shared VPCs
Don't require EnableDNSHostnames on a shared VPC in >= 1.5.0

Create a feature flag for tolerating EnableDNSSupport=false.

Issue #786
2017-01-29 00:09:09 -05:00
Justin Santa Barbara d4122c03c7 Use instance group subnets instead of topology type
It looks like we can infer this from the instance group types, keeping
topology as an argument to `kops create cluster`.
2017-01-20 23:16:48 -05:00
Justin Santa Barbara 61011650dd Support private hosted zones in DNS 2017-01-09 09:32:52 -05:00