181 Commits

Author SHA1 Message Date
Dalton Hubble
f04e07c001 Update kube-apiserver runtime-config flags
* MutatingAdmissionPolicy is available as a beta and alpha API
2025-11-23 16:05:07 -08:00
Dalton Hubble
c50071487c Add service_account_issuer variable for kube-apiserver
* Allow the service account token issuer to be adjusted or served
from a public bucket or static cache
* Output the public key used to sign service account tokens so that
it can be used to compute JWKS (JSON Web Key Sets) if desired

Docs: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#service-account-issuer-discovery
2025-02-07 10:58:54 -08:00
Dalton Hubble
997f6012b5 Update Kubernetes from v1.32.0 to v1.32.1
* Enable the Kubernetes MutatingAdmissionPolicy alpha via feature gate
* Update CoreDNS from v1.11.4 to v1.12.0
* Update flannel from v0.26.2 to v0.26.3

Docs: https://kubernetes.io/docs/reference/access-authn-authz/mutating-admission-policy/
2025-01-20 15:23:22 -08:00
Dalton Hubble
3edb0ae646 Change flannel port from 4789 to 8472
* flannel and Cilium default to UDP 8472 for VXLAN traffic to
avoid conflicts with other VXLAN usage (e.g. Open vSwith)
* Aligning flannel and Cilium to use the same vxlan port makes
firewall rules or security policies simpler across clouds
2024-12-30 11:59:36 -08:00
Dalton Hubble
79b8ae1280 Remove Calico and associated variables
* Drop support for Calico CNI
2024-12-28 20:34:29 -08:00
Dalton Hubble
1ddecb1cef Change Cilium configuration to use kube-proxy replacement
* Skip creating the kube-proxy DaemonSet when Cilium is chosen
2024-08-23 07:15:18 -07:00
Dalton Hubble
45b6b7e877 Rename context in kubeconfig-admin
* Use the cluster_name as the kubeconfig context, cluster,
and user. Drop the trailing -context suffix
2024-08-04 20:43:03 -07:00
Dalton Hubble
990286021a Organize CoreDNS and kube-proxy manifests so they're optional
* Add a `coredns` variable to configure the CoreDNS manifests,
with an `enable` field to determine whether CoreDNS manifests
are applied to the cluster during provisioning (default true)
* Add a `kube-proxy` variable to configure kube-proxy manifests,
with an `enable` field to determine whether the kube-proxy
Daemonset is applied to the cluster during provisioning (default
true)
* These optional allow for provisioning clusters without CoreDNS
or kube-proxy, so these components can be customized or managed
through separate plan/apply processes or automation
2024-05-12 18:05:55 -07:00
Dalton Hubble
e9d52a997e Update Calico from v2.26.3 to v2.27.2
* Calico update fixes https://github.com/projectcalico/calico/issues/8372
2024-02-25 12:01:23 -08:00
Dalton Hubble
720adbeb43 Configure Cilium agents to connect to apiserver explicitly
* Cilium v1.14 seems to have problems reliably accessing the
apiserver via default in-cluster service discovery (relies on
kube-proxy instead of DNS) after some time
* Configure Cilium agents to use the DNS name resolving to the
cluster's load balanced apiserver and port. Regrettably, this
relies on external DNS rather than being self-contained, but its
what Cilium pushes users towards
2023-10-29 16:08:21 -07:00
Dalton Hubble
251adf88d4 Emulate Cilium KubeProxyReplacement partial mode
* Cilium KubeProxyReplacement mode used to support a partial
option, but in v1.14 it became true or false
* Emulate the old partial mode by disabling KubeProxyReplacement
but turning on the individual features
* The alternative of enabling KubeProxyReplacement has ramifications
because Cilium then needs to be configured with the apiserver server
address, which creates a dependency on the cloud provider's DNS,
clashes with kube-proxy, and removing kube-proxy creates complications
for how node health is assessed. Removing kube-proxy is further
complicated by the fact its still used by other supported CNIs which
creates a tricky support matrix

Docs: https://docs.cilium.io/en/latest/network/kubernetes/kubeproxy-free/#kube-proxy-hybrid-modes
2023-08-26 10:45:23 -07:00
Dalton Hubble
a4fc73db7e Fix Cilium kube-proxy-replacement mode to true
* In Cilium v1.14, kube-proxy-replacement mode again changed
its valid values, this time from partial to true/false. The
value should be true for Cilium to support HostPort features
as expected

```
cilium status --verbose
Services:
  - ClusterIP:      Enabled
  - NodePort:       Enabled (Range: 30000-32767)
  - LoadBalancer:   Enabled
  - externalIPs:    Enabled
  - HostPort:       Enabled
```
2023-08-21 19:53:46 -07:00
Dalton Hubble
35848a50c6 Upgrade Cilium from v1.13.4 to v1.14.0
* https://github.com/cilium/cilium/releases/tag/v1.14.0
2023-07-30 09:17:31 -07:00
Dalton Hubble
162baaf5e1 Upgrade Calico from v3.25.1 to v3.26.1
* Calico made some changes related to how the install-cni init
container runs, RBAC, and adds a new CRD bgpfilters
* https://github.com/projectcalico/calico/releases/tag/v3.26.1
2023-06-19 12:25:36 -07:00
Tobias Jungel
7c559e15e2 Update cilium masquerade flag
14ced84f7e
introduced `enable-ipv6-masquerade` and `enable-ipv4-masquerade`. This
updates the ConfigMap of cilium to align with the expected flag.

enable-ipv4-masquerade is enabled and enable-ipv6-masquerade is
disabled.
2023-05-23 17:47:23 -07:00
Dalton Hubble
54ebf13564 Update Kubernetes from v1.26.3 to v1.27.0
* https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.27.md#v1270
2023-04-13 20:00:20 -07:00
Dalton Hubble
0a5d722de6 Change Cilium to use an init container to install CNI plugins
* Starting in Cilium v1.13.1, the cilium-cni plugin is installed
via an init container rather than by the Cilium agent container

Rel: https://github.com/cilium/cilium/issues/24457
2023-03-29 10:03:08 -07:00
Dalton Hubble
5fe3380d5f Update Cilium from v1.12.6 to v1.13.0
* https://github.com/cilium/cilium/releases/tag/v1.13.0
* Change kube-proxy-replacement from probe (deprecated) to
partial and disable nodeport health checks as recommended
* Add ciliumloadbalanacerippools to ClusterRole
* Enable BPF socket load balancing from host namespace
2023-03-14 11:13:23 -07:00
Dalton Hubble
4621c6b256 Update Calico from v3.24.5 to v3.25.0
* https://github.com/projectcalico/calico/blob/v3.25.0/calico/_includes/release-notes/v3.25.0-release-notes.md
2023-01-23 09:22:27 -08:00
Dalton Hubble
5b2fbbef84 Allow Kubelet kubeconfig to drain nodes
* Allow the Kubelet kubeconfig to get/list workloads and
evict pods to perform drain operations, via the kubelet-delete
ClusterRole bound to the system:nodes group
* Previously, the ClusterRole only allowed node deletion
2022-10-23 21:49:38 -07:00
Dalton Hubble
50d43778d0 Update Calico from v3.23.3 to v3.24.1
* https://github.com/projectcalico/calico/releases/tag/v3.24.1
2022-09-14 08:00:17 -07:00
Dalton Hubble
6d92cab7a0 Update Cilium from v1.11.7 to v1.12.0
* https://github.com/cilium/cilium/releases/tag/v1.12.0
2022-08-08 19:56:05 -07:00
Dalton Hubble
97fe45c93e Update Calico from v3.23.1 to v3.23.3
* https://github.com/projectcalico/calico/releases/tag/v3.23.3
2022-07-30 18:10:02 -07:00
Dalton Hubble
178664d84e Update Calico from v3.22.2 to v3.23.1
* https://github.com/projectcalico/calico/releases/tag/v3.23.1
2022-06-18 18:49:58 -07:00
Dalton Hubble
f325be5041 Update Cilium from v1.11.4 to v1.11.5
* https://github.com/cilium/cilium/releases/tag/v1.11.5
2022-05-31 15:21:36 +01:00
James Harmison
5bbca44f66 Update cilium ds name and label to align with upstream 2022-04-20 18:47:59 -07:00
Dalton Hubble
fa4745d155 Update Calico from v3.21.2 to v3.22.1
* Calico aims to fix https://github.com/projectcalico/calico/issues/5011
2022-03-11 10:57:07 -08:00
Dalton Hubble
37f45cb28b Update Cilium from v1.10.5 to v1.11.0
* https://github.com/cilium/cilium/releases/tag/v1.11.0
2021-12-10 11:23:56 -08:00
Dalton Hubble
8add7022d1 Normalize CA certs mounts in static Pods and kube-proxy
* Mount both /etc/ssl/certs and /etc/pki into control plane static
pods and kube-proxy, rather than choosing one based a variable
(set based on Flatcar Linux or Fedora CoreOS)
* Remove `trusted_certs_dir` variable
* Remove deprecated `--port` from `kube-scheduler` static Pod
2021-12-09 09:26:28 -08:00
Dalton Hubble
362158a6d6 Add missing caliconodestatuses CRD for Calico
* https://github.com/projectcalico/calico/pull/5012
2021-12-09 09:19:12 -08:00
Dalton Hubble
9f9d7708c3 Update Calico and flannel CNI providers
* Update Calico from v3.20.2 to v3.21.0
* Update flannel from v0.14.0 to v0.15.0
2021-11-11 14:25:11 -08:00
Dalton Hubble
0b102c4089 Update Calico from v3.20.1 to v3.20.2
* https://github.com/projectcalico/calico/releases/tag/v3.20.2
* Add support for iptables legacy vs nft detection
2021-10-05 19:33:09 -07:00
Dalton Hubble
c6fa09bda1 Update Calico and Cilium CNI providers
* Update Calico from v3.20.0 to v3.20.1
* Update Cilium from v1.10.3 to v1.10.4
* Remove Cilium wait for BGF mount
2021-09-21 09:11:49 -07:00
Dalton Hubble
bfc2fa9697 Fix ClusterIP access when using Cilium
* When a router sets node(s) as next-hops in a network,
ClusterIP Services should be able to respond as usual
* https://github.com/cilium/cilium/issues/14581
2021-09-15 19:43:58 -07:00
Dalton Hubble
a2e1cdfd8a Update Calico from v3.19.2 to v3.20.0
* https://github.com/projectcalico/calico/blob/v3.20.0/_includes/charts/calico/templates/calico-node.yaml
2021-08-18 19:43:40 -07:00
Dalton Hubble
b5f5d843ec Disable kube-scheduler insecure port
* Kubernetes v1.22.0 disables kube-controller-manager insecure
port which was used internally for Prometheus metrics scraping
In Typhoon, we'll switch to using the https port which requires
Prometheus present a bearer token
* Go ahead and disable the insecure port for kube-scheduler too,
we'll configure Prometheus to scrape it with a bearer token as
well
* Remove unused kube-apiserver `--port` flag

Rel:

* https://github.com/kubernetes/kubernetes/pull/96216
2021-08-10 21:11:30 -07:00
Dalton Hubble
5c0bebc1e7 Add Cilium init container to auto-mount cgroup2
* Add init container to auto-mount /sys/fs/cgroup cgroup2
at /run/cilium/cgroupv2 for the Cilium agent
* Enable CNI exclusive mode, to disable other configs
found in /etc/cni/net.d/
* https://github.com/cilium/cilium/pull/16259
2021-07-24 10:30:06 -07:00
Dalton Hubble
362f42a7a2 Update CoreDNS from v1.8.0 to v1.8.4
* https://coredns.io/2021/01/20/coredns-1.8.1-release/
* https://coredns.io/2021/02/23/coredns-1.8.2-release/
* https://coredns.io/2021/02/24/coredns-1.8.3-release/
* https://coredns.io/2021/05/28/coredns-1.8.4-release/
2021-06-23 23:26:27 -07:00
Dalton Hubble
7052c66882 Update Calico from v3.18.1 to v3.19.0
* https://docs.projectcalico.org/archive/v3.19/release-notes/
2021-05-13 11:17:48 -07:00
Dalton Hubble
a4ecf168df Update static Pod manifests for Kubernetes v1.21.0
* Set `kube-apiserver` `service-account-jwks-uri` because conformance
ServiceAccountIssuerDiscovery OIDC discovery will access a JWT endpoint
using the kube-apiserver's advertise address by default, instead of
using the intended in-cluster service (10.3.0.1) resolved by cluster DNS
`kubernetes.default.svc.cluster.local`, which causes a cert SAN error
* Set the authentication and authorization kubeconfig for kube-scheduler
and kube-controller-manager. Here, authn/z refer to aggregated API
use cases only, so its not strictly neccessary and warnings about
missing `extension-apiserver-authentication` when enable_aggregation
is false can be ignored
* Mount `/var/lib/kubelet/volumeplugins` to to the default location
expected within kube-controller-manager to remove the need for a flag
* Enable `tokencleaner` controller to automatically delete expired
bootstrap tokens (default node token is good 1 year, so cleanup won't
really matter at that point, but enable regardless)
* Remove unused `cloud-provider` flag, we never intend to use in-tree
cloud providers or support custom providers
2021-04-10 17:42:18 -07:00
Dalton Hubble
f87aa7f96a Change CNI config directory to /etc/cni/net.d
* Change CNI config directory from `/etc/kubernetes/cni/net.d`
to `/etc/cni/net.d` (Kubelet default)
2021-04-01 16:48:46 -07:00
Dalton Hubble
adcba1c211 Update Calico from v3.17.3 to v3.18.1
* https://docs.projectcalico.org/archive/v3.18/release-notes/
2021-03-14 10:15:39 -07:00
Dalton Hubble
84972373d4 Rename bootstrap-secrets directory to pki
* Change control plane static pods to mount `/etc/kubernetes/pki`,
instead of `/etc/kubernetes/bootstrap-secrets` to better reflect
their purpose and match some loose conventions upstream
* Require TLS assets to be placed at `/etc/kubernetes/pki`, instead
of `/etc/kubernetes/bootstrap-secrets` on hosts (breaking)
* Mount to `/etc/kubernetes/pki` to match the host (less surprise)
* https://kubernetes.io/docs/setup/best-practices/certificates/
2020-12-02 23:13:53 -08:00
Dalton Hubble
ac5cb95774 Generate kubeconfig's for kube-scheduler and kube-controller-manager
* Generate TLS client certificates for kube-scheduler and
kube-controller-manager with `system:kube-scheduler` and
`system:kube-controller-manager` CNs
* Template separate kubeconfigs for kube-scheduler and
kube-controller manager (`scheduler.conf` and
`controller-manager.conf`). Rename admin for clarity
* Before v1.16.0, Typhoon scheduled a self-hosted control
plane, which allowed the steady-state kube-scheduler and
kube-controller-manager to use a scoped ServiceAccount.
With a static pod control plane, separate CN TLS client
certificates are the nearest equiv.
* https://kubernetes.io/docs/setup/best-practices/certificates/
* Remove unused Kubelet certificate, TLS bootstrap is used
instead
2020-12-01 20:18:36 -08:00
Dalton Hubble
19c3ce61bd Add TokenReview and TokenRequestProjection kube-apiserver flags
* Add kube-apiserver flags for TokenReview and TokenRequestProjection
(beta, defaults on) to allow using Service Account Token Volume Projection
to create and mount service account tokens tied to a Pod's lifecycle
* Both features will be promoted from beta to stable in v1.20
* Rename `experimental-cluster-signing-duration` to just
`cluster-signing-duration`

Rel:

* https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#service-account-token-volume-projection
2020-12-01 19:50:25 -08:00
Dalton Hubble
fd10b94f87 Update Calico from v3.16.5 to v3.17.0
* Consider Calico's MTU auto-detection, but leave
Calico MTU variable for now (`network_mtu` ignored)
* Remove SELinux level setting workaround for
https://github.com/projectcalico/cni-plugin/issues/874
2020-11-25 11:18:59 -08:00
Starbuck
74c299bf2c Restore kube-controller-manager --use-service-account-credentials
* kube-controller-manager Pods can start control loops with credentials
that have been granted relevant controller manager roles or using
generated service accounts bound to each role
* During the migration of the control plane from self-hosted to static
pods (https://github.com/poseidon/terraform-render-bootstrap/pull/148)
the flag for using separate service accounts was inadvertently dropped
* Restore the --use-service-account-credentials flag used before v1.16

Related:

* https://kubernetes.io/docs/reference/access-authn-authz/rbac/#controller-roles
* https://github.com/poseidon/terraform-render-bootstrap/pull/225
2020-11-10 12:06:51 -08:00
Dalton Hubble
c6e3a2bcdc Update Cilium from v1.8.5 to v1.9.0-rc3
* https://github.com/cilium/cilium/releases/tag/v1.9.0-rc3
* https://github.com/cilium/cilium/releases/tag/v1.9.0-rc2
* https://github.com/cilium/cilium/releases/tag/v1.9.0-rc1
2020-11-03 00:05:32 -08:00
Dalton Hubble
7988fb7159 Update Calico from v3.15.3 to v3.16.3
* https://github.com/projectcalico/calico/releases/tag/v3.16.3
* https://docs.projectcalico.org/v3.16/release-notes/
2020-10-15 20:00:41 -07:00
Nesc58
016d4ebd0c Mount /run/xtables.lock in flannel Daemonset
* Mount xtables.lock (like Calico and Cilium) since iptables
may be called by other processes (kube-proxy)
2020-09-16 19:01:42 -07:00