Commit Graph

1946 Commits

Author SHA1 Message Date
Peter Rifel 701f01a26b
Use switch/case statement 2025-08-22 20:36:02 -05:00
Peter Rifel af86a55c81
Remove duplicate imports 2025-08-22 20:05:59 -05:00
justinsb 3f25b1eee1 metal: split host creation from enrollment
This is needeed for bootstrapping the control plane,
because it's a CRD so can't be registered until the control plane is running.

It's also quite nice because we might want to review the contents of the
host CRD, e.g. to verify the key out-of-band.
2025-07-26 20:01:12 -04:00
justinsb 05f8618306 metal: simple IPAM for IPv6 2025-07-26 20:01:12 -04:00
Ciprian Hacman c95f297c06 azure: Fix subscription ID check 2025-07-26 20:43:16 +03:00
Ciprian Hacman 1521dda087 Prefer using id_ed25519.pub instead of id_rsa.pub 2025-07-25 23:26:09 +03:00
Ciprian Hacman 29fb3d3587 azure: Use AZURE_SUBSCRIPTION_ID env var as fallback 2025-07-20 09:09:26 +03:00
Peter Rifel 3ea4a5dadd
Reduce verbosity of k8s version warning
This warning isnt particularly actionable - it is expected behavior for `kops create cluster` and any `kops update cluster` that experiences this (due to a broken cluster) will proceed as normal.
The user's subsequent `kops validate cluster` would surface any such errors
2025-07-16 19:35:09 -05:00
justinsb be5c325918 Introduce flag use-kubeconfig which allows loading from the local kubeconfig
This supports workflows that modify the local kubeconfig for advanced configurations,
which were accidentally broken by trying to always generate the config.

Issue #17262
2025-07-12 12:54:15 -04:00
justinsb 138e14b1ad Create flag override-api-endpoint which allows for custom DNS setups
Issue #17262
2025-06-28 17:39:56 -04:00
Ciprian Hacman 271a2dd1b4 Update dependencies 2025-06-27 13:53:05 +03:00
Kubernetes Prow Robot 9728daa90c
Merge pull request #17429 from tanelmae/tools-apply-fix
Fix toolbox addons apply command
2025-06-20 14:24:51 -07:00
Peter Rifel 477c4f3875
Add integration tests for 1.33 and 1.34 2025-06-18 05:39:30 -07:00
Tanel Mae c26d2b1ba8
Fix toolbox addons apply command 2025-06-07 21:30:53 +03:00
Peter Rifel 787f4f43e8
Fix minor version upgrade recommendations 2025-06-06 07:34:32 -04:00
justinsb 826a778f58 tests: add tests for kubectl get assets 2025-05-02 14:58:19 -04:00
justinsb e1afbab608 tests: verify that we can marshal tasks to json 2025-03-27 08:03:16 -04:00
Kubernetes Prow Robot 7c52ef7b74
Merge pull request #17274 from zetaab/feat/fixrollingupdatetime
make --admin configurable to rolling-update
2025-02-24 11:00:30 -08:00
Peter Rifel 5ac11aa55a
Cleanup logging for reconcile cluster 2025-02-23 21:04:31 -06:00
Jesse Haka d5cea90a82 make --admin configurable to rolling-update 2025-02-22 10:01:57 +02:00
justinsb 3ea73f47f8 Better dumping via private IP when bastion is not set
Previously this would always fail in a confusing way,
regardless of whether we had connectivity,
because we tried to connect to an empty-string host.

Now we are more explicit about the error,
and will at least try to connect directly.
2025-02-19 08:25:33 -05:00
justinsb 5c2c304b7f Remove reconcile flag from `kops update`
We have `kops reconcile`, and it's confusing having both.

We didn't ship the --reconcile flag in any released version.
2025-01-20 10:35:24 -05:00
justinsb 284b15be19 Support strong-typing for --target values
A small cleanup that makes our code a little more robust.
2025-01-19 09:21:05 -05:00
Kubernetes Prow Robot 961a786b65
Merge pull request #17214 from justinsb/reconcile_dryrun_should_be_an_update
reconcile: if --yes is not provided, print the same output as `update cluster` does
2025-01-15 04:20:33 -08:00
justinsb 48f12bed83 reconcile: if --yes is not provided, print the same output as `update cluster` does 2025-01-15 06:18:26 -05:00
justinsb f2d4eeb104 reconcile: wait for apiserver to response before trying rolling-update
The rolling-update requires the apiserver (when called without --cloudonly),
so reconcile should wait for apiserver to start responding.

Implement this by reusing "validate cluster", but filtering to only the instance groups
and pods that we expect to be online.
2025-01-13 17:47:48 -05:00
Ciprian Hacman eac132daae Add IPv6 support for kindnet 2025-01-09 17:50:06 +02:00
Antonio Ojea f2c239dd81 add kindnet network plugin
add kindnet as an experimental network addon

containerd adds the requirement to use the loopback cni plugin,
kindnet provides that capability and containerd does not require it
since containerd/containerd/pull/10238

Change-Id: I1397a90186885b02e98b5ffa444fe629c1046757
2025-01-08 01:09:37 +00:00
Kubernetes Prow Robot 7af9770c59
Merge pull request #17155 from justinsb/build_our_own_rest_config_2
chore: generate kubeconfig on the fly
2025-01-06 10:30:16 +01:00
Ciprian Hacman eaf796c3c0 Remove support for K8s 1.26 in kOps 1.32 2025-01-04 15:01:41 +02:00
Kubernetes Prow Robot 51db52f025
Merge pull request #17154 from justinsb/build_our_own_rest_config
chore: refactor factory to accept a cluster
2024-12-28 09:08:12 +01:00
justinsb 324117cc52 chore: generate kubeconfig on the fly
Some kOps actions require connecting to the cluster, but
we don't always have a kubeconfig available.

This commit adds a function to generate a client config on the fly
(including a certificate) when needed.
2024-12-27 16:37:59 -05:00
justinsb 859a9fd9f1 chore: refactor factory to accept a cluster
This should allow us to build our own rest config in future,
rather than relying on the kubeconfig being configured correctly.

To do this, we need to stop sharing the factory between the channels
and kops commands.
2024-12-27 15:36:37 -05:00
justinsb ebcfebe50e chore: add context to rolling update functions
Move it out of the struct, and into the function parameters.

This is more go idiomatic.
2024-12-27 14:22:51 -05:00
justinsb ab613ff114 Add `kops reconcile cluster` command
This all-in-one command is a replacement for having to run multiple commands,
while still respecting the version skew policy.

It does the same thing as `kops update cluster --reconcile`:

* Updates the control plane nodes
* Does a rolling update of the control plane nodes
* Updates "normal" nodes and bastion nodes
* Does a rolling update of these nodes
* Prunes old resources that are no longer used
2024-12-05 12:27:08 -05:00
justinsb 7c95effdb4 Introduce --reconcile flag to kOps
Kubernetes 1.31 now stops nodes joining a cluster if the minor version
of the node is greater than the minor version of the control plane.

The addition of the instance-group-roles flag to update means that we
can now update / rolling-update the control plane first.  However, we
must now issue four commands:

* Update control plane
* Rolling update control plane
* Update nodes
* Rolling update nodes

This adds a flag to automate this process.  It is implemented by
executing those 4 steps in sequence.

Update is also smart enough to not update the nodes if this would
violate the skew policy, but we do this explicitly in the reconcile
command to be clearer and safer.
2024-12-05 11:36:13 -05:00
justinsb 4a63a118b2 Remove unusued kubernetesVersion from AssetBuilder
This field is no longer used, and can be removed.
2024-12-04 08:57:17 -05:00
Rafael da Fonseca cc15357999 Automatically preserve kubelet supported version skew on worker nodes, while control plane is being updated
Co-authored-by: Peter Rifel <rifelpet@users.noreply.github.com>
2024-12-03 07:36:16 -05:00
justinsb b124625c62 toolbox dump: support dumping only k8s resources
Because metal does not support cloud-resource discovery, we need to
skip this in our metal tests.
2024-11-12 13:11:34 -05:00
Ciprian Hacman 1683894999 Allow updating the cluster one instance group at a time
Co-Authored-By: Ciprian Hacman <ciprianhacman@gmail.com>
2024-11-09 11:34:28 -05:00
justinsb 4be079c3e1 fix: upgrade cluster kubernetes selection logic
Currently it relies on us updating the channel version in two places,
but this makes `kops upgrade cluster` inconsistent with `kops update cluster`.

`kops update cluster` also tells us to run `kops upgrade cluster`,
which then might not recommend an upgrade.
2024-10-12 08:16:44 -04:00
justinsb 0963d73cc5 metal: initial support for adding hosts
The bulk of this work is implementing a clientset for use in kops-controller.
2024-09-18 09:03:43 -04:00
justinsb eda7c25fa9 metal: stub node identification for bare metal 2024-09-14 13:50:31 -04:00
Peter Rifel 3f3d0f11c5
Discover a bastion load balancer and use it for dumping artifacts 2024-09-06 19:34:31 -05:00
Peter Rifel 7581394f66
Give each controller unique names 2024-09-05 21:57:01 -05:00
justinsb 6a2a723bd2 refactor: give clear error message if challenge endpoint cannot be found
We were not handling this particularly clearly before, although it should only happen in development.
2024-08-29 05:32:51 -04:00
justinsb 3646a610b1 refactor: Move GetCloudProvider to cluster
This lets us use labels (or annotations), meaning we can experiment
with different clouds without changing the API.

We also add initial (experimental/undocumented) support for exposing a "Metal" provider.
2024-08-26 08:20:37 -04:00
Ciprian Hacman ec4e88a7f9 aws: Fix conversion for instance-selector flags 2024-08-25 20:00:50 +03:00
Kubernetes Prow Robot 2b39cbe78a
Merge pull request #16746 from hakman/dependencies/update-1723183478
Fix verify-golangci-lint
2024-08-09 13:18:09 -07:00
Kubernetes Prow Robot 2a1f1f287d
Merge pull request #16705 from hakman/gce-startup-script
gce: Add option to use startup script instead of user-data
2024-08-09 13:18:03 -07:00