Commit Graph

106 Commits

Author SHA1 Message Date
John Gardiner Myers be8933b577 Remove code for unsupported features 2021-08-28 13:49:55 -07:00
John Gardiner Myers abd95d14f4 Implement completion for "kops get clusters" 2021-07-19 14:58:41 -07:00
John Gardiner Myers cac4d2c080 More "kops set" cleanup 2021-07-14 13:09:08 -07:00
John Gardiner Myers be30a61983 Move EditorEnvs to pkg 2021-07-11 23:05:06 -07:00
John Gardiner Myers e3451030ff Implement completion for "kops rolling-update cluster" 2021-07-03 22:57:15 -07:00
John Gardiner Myers 22b8ad2d48 Implement completion for "kops create keypair" 2021-06-28 23:26:47 -07:00
John Gardiner Myers 26a5aa179b Improve completion for kops root command 2021-06-27 21:51:15 -07:00
John Gardiner Myers 76fc012f96 Allow unsetting fields from the command line 2021-06-14 08:52:32 -07:00
John Gardiner Myers 3cf8234d01 Cilium: disable masquerade by default when in ENI IPAM mode 2021-06-13 21:36:56 -07:00
John Gardiner Myers e0915887ed Move asset copying out of apply_cluster 2021-06-05 21:17:50 -07:00
John Gardiner Myers dd605fdbc3 Subsume StatusStore into fi.Cloud 2021-05-15 17:39:32 -07:00
John Gardiner Myers 1dab19f499 Require fi.Cloud to implement kops.StatusStore 2021-05-15 15:54:38 -07:00
bjhaid 88ed9f68bd Add support for configuring Cilium enable-host-reachable-services.
After upgrading Cilium to 1.8 via kops one of our clusters had a total
outage due to cilium reporting errors as below:

```
level=error msg="endpoint regeneration failed" containerID= datapathPolicyRevision=0 desiredPolicyRevision=1 endpointID=592 error="Failed to load tc filter: exit status 1" identity=40147 ipv4= ipv6= k8sPodName=/ subsys=endpoint
```

upon searching Cilium slack we found the below thread:

https://cilium.slack.com/archives/C1MATJ5U5/p1616400216167600

which recommended setting `enable-host-reachable-services` to true will
address the problems. We set the field and it fixed our issues too,
however we observed that kops does not have a means to configure this
hence this PR.

We will like to have this backported after it has been merged.
2021-04-27 12:49:27 -05:00
Bharath Vedartham 49f3ab0703 Throw error if path being set by kops set is not present in struct 2021-01-31 12:00:42 +05:30
Bharath Vedartham 515fbf1c1c set_cluster: Remove unused instanceGroup parameter from setClusterFields 2021-01-30 14:31:49 +05:30
Gabe Jackson 45afe1d968 Switch validation to CrossValidateInstanceGroup 2021-01-25 01:05:07 -05:00
Gabe Jackson e90050f134 Add `set instancegroup` command
This change adds a new command and functionality for updating
instance group configuration via command line arguments. This
behavior mimics the `set cluster` command.
2021-01-15 12:19:26 -05:00
Kenji Kaneda a61caea8d2 Add Azure support
This commit contains all changes required to support Azure
(https://github.com/kubernetes/kops/issues/3957).
2020-12-21 08:27:54 -08:00
Christian Joun e91ed11449
Implement API load balancer class with NLB and ELB support on AWS (#9011)
* refactor TargetLoadBalancer to use DNSTarget interface instead of LoadBalancer

* add LoadBalancerClass fields into api

* make api machinery

* WIP: Implemented API loadbalancer class, allowing NLB and ELB support on AWS for new clusters.

* perform vendoring related tasks and apply fixes identified from hack/

dissallow spotinst + nlb
remove reflection in status_discovery.go
Add precreated additional security groups to the Master nodes in case of NLB
Remove support for attaching individual instances to NLB; only rely on ASG attachments
Don't specify Classic loadbalancer in GCE integration test

* add utility function to the kops model context to make LoadBalancer comparisons simpler

* use DNSTarget interface when locating DNSName of API ELB

* wip: create target group task

* Consolidate TargetGroup tasks

* Use context helper for determining api load balancer type to avoid nil pointers

* Update NLB creation to use target group ARN from separate task rather than creating a TG in-line

* Address staticcheck and bazel failures

* Removing NLB Attachment tasks because they're not used since we switched to defining them as a part of the ASGs

* Address PR review feedback

* Only set LB Class field for AWS clusters, fix nil pointer

* Move target group attributes from NLB task to TG task, removing unused attributes

* Add terraform and cloudformation support for NLBs, listeners, and target groups

* Update integration test for NLB support

* Fix NLB name format to pass terraform validation

* Preserve security group rule names when switching ELB to NLB to reduce destructive terraform changes

* Use elbv2 enums and address some TODOs

* Set healthcheck values in target group

* Find TG tags, fix NLB name detection

* Fix more spurious changes reported by lifecycle integration test

* Fix spotinst validation, more code cleanup

* Address more PR feedback

* ReconcileTargetGroups unit test + more code simplification

* Addressing PR feedback Renaming task 1. awstasks.LoadBalancer -> awstasks.ClassicLoadBalancer

* Addressing PR feedback Renaming task: ELBName() -> CLBName() / LinkToELB() -> LinkToCLB()

* Addressing PR feedback: Various text changes

* fix export of kubecfg

* address TargetGroup should have the same name as the NLB

* should address error when fetching tags due to missing ARN

* Update expected and crds

* Add feature table to NLB docs

* Address more feedback and remove some TODOs that arent applicable anymore

* Update spotinst validation error message

Co-authored-by: Peter Rifel <pgrifel@gmail.com>
2020-11-02 05:28:52 -08:00
Ole Markus With 1d922af364 Pass cloud into populate cluster 2020-09-24 07:22:13 +02:00
Ole Markus With 7bc17f4b1f Build cloud outside of PerformAssignments
We tend to build cloud, call some method, and then build cloud over
again. It would be easier to just pass the first one along.

Passing along cloud would also make it easier to mock cloud.
2020-09-23 07:54:28 +02:00
Justin SB 8757a2ce2a kubeconfig generation: add tests for kops plugin
Also slightly simplify the tests and Kubecfg Builder signature by
passing in the ConfigAccess only when needed.
2020-08-30 15:17:36 -04:00
Justin SB 0cda0f5068 Support authentication helper for kubectl
We create a simple exec plugin command which can create and renew
short-lived admin credentials on the fly, essentially leveraging the
security of the underlying cloud credentials.

Co-authored-by: John Gardiner Myers <jgmyers@proofpoint.com>
2020-08-30 15:16:20 -04:00
Justin SB c63ce4b5ab Implement setter by reflection
This means we no longer have to individually hard-code the `kops set`
fields, however we use the "language" we're now demonstrated.

We add tests to ensure we have parity with our existing (hard-coded)
setter logic.
2020-08-30 09:59:52 -04:00
Peter Rifel 7d9f0a06cf
Update API slice fields to not use pointers
This is causing problems with the Kubernetes 1.19 code-generator.
A nil entry in these slices wouldn't be valid anyways, so this should have no impact.
2020-08-24 07:46:38 -05:00
Ole Markus With cf9a5c0289 Add ability to set various cilium flags through CLI
Needed for a new e2e cilium test
2020-07-07 21:04:23 +02:00
Ciprian Hacman 1bd7f633ca Update override flag for Docker SELinux 2020-06-12 06:19:09 +03:00
Kubernetes Prow Robot 1076eec7c6
Merge pull request #9324 from bertinatto/selinux
Allow docker options to be specified by create cluster overrides
2020-06-10 12:56:19 -07:00
Fabio Bertinatto 0d5a565920 Allow docker options to be specified by create cluster overrides
This will allow our end-to-end testing to enable SELinux.
2020-06-10 15:55:58 +02:00
Peter Rifel bc074e857c
Use ec2.DescribeInstanceTypes in awsup.GetMachineTypeInfo
This requires passing a cloud object in additional places throughout the validation package and originating mostly from cmd/kops

This means that some kops commands now require valid cloud provider credentials, but I don't think this is an issue because the vast majority of use-cases already require the same cloud provider credentials in order to interact with the state store.
2020-06-09 10:13:01 -05:00
Srikanth 5d3f2447e4 Changes for handling kops update 2020-05-11 15:10:52 +05:30
Justin Santa Barbara 31bb16d4d1 Add context.Context to most signatures
The client-go signature for most methods adds a context.Context
object, and also makes Options mandatory.  Feed through a
context.Context through many of our methods (but use context.TODO to
stop it getting totally out of hand!)
2020-04-11 14:44:17 -04:00
John Gardiner Myers 8844b97fe3 Fix field names in api validation 2020-02-15 14:52:27 -08:00
Srikanth 42e88a7f89 Initial changes for load balancer task
Add load balancer fi tasks

Add load balancer builder for DO

Fix go imports

Implement FindIPAddress functionality

Add load balancer api ingress status calls

Add error checks for FindIPAddress

Add delete LB option

Update load balancer delete logic

Revert make file changes

revert utils code changes

Revert NewDOCloud changes

Remove minor code comments

Update with gomod for dependencies
2020-01-27 15:03:05 +05:30
Peter Rifel b7960f04d4 Allow CoreDNS to be specified by create cluster overrides
This will more easily allow our end-to-end testing to use CoreDNS rather than KubeDNS
2020-01-14 08:14:33 -06:00
tanjunchen 8acb51e061 pkg/apis/ pkg/commands/ pkg/model/ staticcheck 2019-12-30 21:13:40 +08:00
Xiaoyu Zhong 2eeca3a9a6 Alicloud: fix status discovery 2019-10-16 22:16:03 +08:00
mikesplain 9e55b8230a Update copyright notices
Also cleans some white spaces
2019-09-09 14:47:51 -04:00
Camilo Santana 78d16f2467
fixes typo - s/(Spec.)m(asterPublicName)/$1M$2/
pull-kops-e2e-kubernetes-aws — Job failed. [Details](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/kops/7160/pull-kops-e2e-kubernetes-aws/1141685394924900352/)
```
I0620 12:37:27.976] /root/.cache/bazel/_bazel_prow/ae5d1f01453377487c630b230ced7d61/sandbox/linux-sandbox/836/execroot/__main__/pkg/commands/set_cluster.go:97:16: cluster.Spec.masterPublicName undefined (type "k8s.io/kops/pkg/apis/kops".ClusterSpec has no field or method masterPublicName, but does have MasterPublicName)
```

fixes typo
2019-06-20 13:43:46 -07:00
Camilo Santana 1bff3f1841
add masterPublicName support in kops set cluster 2019-06-18 13:07:49 -07:00
Adrian Fedoreanu e3f7fa5768
add support to set cluster spec.kubelet
* spec.kubelet.authorizationMode
* spec.kubelet.authenticationTokenWebhook
2019-03-15 11:04:45 +01:00
Justin SB 83ea1c491b
Normalize etcd cluster provider names
Instead of just casting a string, we validate and normalize.
2019-01-29 23:22:29 -05:00
Kubernetes Prow Robot 70484c009a
Merge pull request #6232 from justinsb/ask_kops_for_its_version
kops version: Add --short flag, use it to get version in scripts
2019-01-27 13:50:37 -08:00
Jesse Haka 335d3f7e73 implement etcd status for openstack 2019-01-24 08:25:56 +02:00
Justin SB b40c9034bd
kops version: Add --short flag, use it to get version in scripts
We upload to a location that includes the version, but we need to
specify the version in KOPS_BASE_URL.  We expose an option to make
`kops version` more amenable to this scripting.
2019-01-22 22:27:33 -05:00
Derek Lemon -T (delemon - AEROTEK INC at Cisco) 5cae86c2ce dep ensure and gofmt updates 2019-01-16 15:09:20 -07:00
Sergiu Marsavela (smarsave) 922e5dfe3f Discover hosts to populate 2019-01-16 09:27:45 -07:00
Derek Lemon -T (delemon - AEROTEK INC at Cisco) 64b63ba6ae Removing references to drekle repo 2019-01-15 14:21:11 -07:00
Derek Lemon -T (delemon - AEROTEK INC at Cisco) af91543345 Checking in model and task dependencies 2019-01-15 14:13:53 -07:00
Justin Santa Barbara b56457dc05 kops set: support for enableEtcdTLS and enableTLSAuth
These shortcut commands make it easy to set enableEtcdTLS and
enableTLSAuth.

`kops set cluster cluster.spec.etcdClusters[*].enableEtcdTLS=true`

`kops set cluster cluster.spec.etcdClusters[*].enableTLSAuth=true`
2018-11-24 22:27:15 -05:00
Justin Santa Barbara 54c499fe9b Introduce field to specify whether we are using etcd-manager or legacy mode
Splitting this out from the bigger bundle PR
2018-10-01 15:36:24 -07:00
LilyFaFa b3aabfdebc support edit cluster and rolling-update cluster for AliCloud 2018-07-07 15:42:44 +08:00
Justin Santa Barbara 73eb8270b7 Create override for etcd-manager image 2018-05-26 12:48:55 -07:00
Justin Santa Barbara 81d5f06a58 Unify create-create overrides and set-cluster fields
Supports e2e upgrade tests
2018-05-09 11:55:44 -04:00
chrislovecnm 658d1bb484 fixing bazel file 2018-02-26 13:03:44 -07:00
Justin Santa Barbara 6f52996c2a Experimental kops set cluster command
Introduce an experimental kops set cluster command, for setting
individual fields in the same style as the kops create cluster
--override flags.

For now, feature flag gated by the same SpecOverrideFlag feature flag.

Also split out pkg/commands package to facilitate testing.
2018-02-26 09:33:16 -05:00