Commit Graph

26 Commits

Author SHA1 Message Date
Phil Sphicas 41b3ad3dbb Adjust kube-apiserver anchor readiness
To avoid cycling the pods in the anchor daemonset too quickly, only
consider a kubernetes-apiserver-anchor pod ready if:
- it created the static manifest kubernetes-apiserver.yaml
- the kubernetes-apiserver pod on the same host is ready

Change-Id: I53dd1c044332946eeb965f07ae828910f00b04c6
2021-08-10 16:48:14 +00:00
Phil Sphicas c6b62ff414 apiserver(-webhook): Allow volume overrides
The existing apiserver chart supports volume overrides for the anchor
daemonset, but not for the apiserver static pod itself. The feature to
allow volume overrides in the apiserver-webhook chart was never fully
implemented.

This changes allows volume overrides via values.yaml for both charts,
and provides a more complete audit example that includes mounting the
audit log destination as a host path volume.

Change-Id: I27ccf77671a190e8cb6b66d8a9b13c2cde6c9a45
2021-04-21 21:52:29 +00:00
Phil Sphicas de9f8415d7 kube-apiserver: disable http2
There are several kubernetes bugs [0,1,2] involving connection problems
that seem related to the Go net/http2 library, where the stream state
and connection state can get out of sync. This can manifest as a kubelet
issue, where the node status gets stuck in a NotReady state, but can
also happen elsewhere.

In newer versions of the Go libraries some issues are fixed [3,4], but
the fixes are not present in k8s 1.18.

This change disables http2 in kube-apiserver and webhook-apiserver. This
should be sufficient to avoid the majority of the issues, as disabling
on one side of the connection is enough, and apiserver is generally
either the client or the server.

0: https://github.com/kubernetes/kubernetes/issues/87615
1: https://github.com/kubernetes/kubernetes/issues/80313
2: https://github.com/kubernetes/client-go/issues/374
3: https://github.com/golang/go/issues/40423
4: https://github.com/golang/go/issues/40201

Change-Id: Id693a7201acffccbc4b3db8f4e4b96290fd50288
2020-10-23 21:28:51 +00:00
Phil Sphicas fb36579e16 kube-apiserver: use HTTP probes instead of exec
The existing exec probes for apiserver rely on things that do not exist
in the official kubernetes release images (bash, socat).

This change modifies the apiserver to use HTTP probes of the recommended
liveness and readiness endpoints.[0]

Also sets `--anonymous-auth=true` (the default setting), as kubelet is
unable to provide a client certificate when performing the health check.
RBAC rules apply, but unauthenticated users will be able to access the
following endpoints:

    apiVersion: rbac.authorization.k8s.io/v1
    kind: ClusterRole
    metadata:
      name: system:public-info-viewer
    rules:
    - nonResourceURLs:
      - /healthz
      - /livez
      - /readyz
      - /version
      - /version/
      verbs:
      - get

0: https://v1-18.docs.kubernetes.io/docs/reference/using-api/health-checks/

Change-Id: I06d739c844fe85ec6cbf47d3bb69a39cd008ddd8
2020-09-28 03:27:58 +00:00
Phil Sphicas be7b82e1a1 kube-apiserver: Allow probe customization
Uses the standard helm-toolkit macros for liveness and readiness probes,
allowing them to be enabled or disabled, and params to be overridden.

Change-Id: Ie9aef97f56f2205ada24f17e7cafabc5943ae097
2020-09-28 03:25:50 +00:00
KHIYANI, RAHUL (rk0850) 880c6503c8 Add security context template for promenade charts
This changes adds security context template at pod level to
set run as user value

This also adds security context template at container level to
set readOnly-fs flag

Change-Id: Iba720e687218987cfefe7a9f08630fb11e8eac12
2020-07-22 05:24:50 +00:00
KHIYANI, RAHUL (rk0850) dfebe8f55f Add apparmor profile to promenade tpl files
Change-Id: I00d5c74e079f72f9837f8502dfa6ca805e2e0e04
2020-07-20 15:23:08 -05:00
Pete Birley 64807416b7 Probes: Ensure newline between key and cert in probe concat
This PS ensures there is a newline present between the cert and its
key when concatenating them together.

Change-Id: I72319c1a415d683f19ff8f96060eb39bbec34b75
Signed-off-by: Pete Birley <pete@port.direct>
2019-12-06 14:21:56 -06:00
Luna Das 7f63537f8a Add facility to configure log levels in kubernetes-components
Change-Id: Ib7c481b71818c6673cd0b9c47d282d4a3f42d307
2019-08-14 13:33:21 +05:30
Scott Hussey ad30aa7382 (apiserver) support key rotation
- Support key rotation for the etcd encryption key in the
  apiserver chart
- Remove configmap annotations from the apiserver anchor pods
  as the pod is built to pickup changes in configmap contents
  without restart.
- Also update the apiserver anchor DaemonSet to apps/v1 and
  make required updates to support that update.

Change-Id: I2d18996bbe04bada9da2bce01a502550d3681c97
2019-04-29 09:31:24 -05:00
Jared Miller 8f53933478 Do not quote tls arg values
If we enable these tls settings, then having quotes around the values
will prevent apiserver from starting.

Change-Id: I39d1e5861262074ef0c50f22d0fae47d822f8319
2019-03-12 19:45:00 +00:00
Jared Miller 8fe4333eda Allow tls versions and ciphers to be configured
Add the ability to set tls version and cipher suites

Change-Id: Ifb3d1ed315c0ed8d679e5ab71cf2484dc8329dbd
Vulnerability: https://sweet32.info/
2019-02-04 16:34:31 -05:00
Mark Burnett 04da7585ff Refactor API server
This change accomplishes 2 primary things:
1. It generalizes work to enable the EventRateLimit admission plugin.
2. It restructures the anchor so that during an upgrade an "old" anchor
   does not try to coordinate the injection of "new" data from
   configmaps/secrets.

It also includes these ancillary changes:
* Clean up apiserver argument specification in the chart.
* De-duplicate and realign apiserver arguments in bootstrapping templates.

It has the side effects of:
* Adding a new field, ".apiserver.arguments" to the Genesis config,
  which will be the preferred way to configure bootstrapping apiservers
  going forward (in lieu of command_prefix).

Change-Id: I33cfe80ee8e29cd79e479a7985e3c098a2288fda
2019-01-10 16:31:50 -06:00
Zuul 422d22ff9c Merge "Add release uuid to pods and rc objects (prom)" 2018-11-06 19:18:34 +00:00
Zuul a5a17ffe6d Merge "Add EventRateLimit admission controller" 2018-11-05 20:27:05 +00:00
Mark Burnett 6638b47cb9 Share process namespaces with exec probes
This avoids leaving zombies in cases where the processes don't reap
children.

Also fixes a certificate issue with the resiliency gate.

Change-Id: I8a795557b0d60338c40b360c947b81a20fd48877
2018-11-02 14:53:48 -05:00
Matt McEuen 178193be84 Add EventRateLimit admission controller
Add the EventRateLimit admission controller, to allow operators to
define rate limits for the k8s API server at the server, namespace,
or user account level.

This also
* cleans up some of the parameters passed into the API server
* replaces the deprecated --admission-control parameter
* applies --repair-malformed-updates consistently, incl examples
* removes unused batch/v2alpha1 runtime config
* https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/
* removes duplicate --service-cluster-ip-range setting

This PS adds EventRateLimits to the bootstrap and anchor API
servers; future work will need to add it to the Keystone
Webhook API server.

Change-Id: I32a2d4add880e50f470e4cb0687e20d16e6e926d
2018-10-27 15:35:43 -05:00
Matt McEuen eae60aba15 Add release uuid to pods and rc objects (prom)
This PS adds the ability to attach a release uuid to pods and rc
objects as desired.  This can be used, for example, to force an
artificial manifest change in CICD scenarios, for upgradability
testing purposes.

Change-Id: I8d0ffac306258f940c63799e86e7e26b5c2c5add
2018-10-16 12:43:32 -05:00
Mark Burnett 1399731096 Use separate CA for kubelet authorization
This increases isolation of actions against the node API.  With the
previous combined CA approach, each node would have a valid key to talk
to each other node.  With this separated approach, only the API servers
will have keys with access to the node APIs.

Change-Id: I2705016eb963ca9d2cc2a344047677f4b2cc3025
2018-08-28 09:38:34 -05:00
Aaron Sheffield 890964eca0 Add Additional Liveness Probes for apiserver
- Updated apiserver-anchor with a liveness probe.
- Changed apiserver liveness probe to query kubectl.
   This allows the pod to restart if it looses access to etcd.

Change-Id: I0ef9cbc941a0533268e4f499a1333e88be3e43a3
2018-06-26 09:29:07 -05:00
Aaron Sheffield 6fa106fe2a Disable anonymous-auth
- Turn off anonymous-auth.
- Reworked haproxy helm test and updated test images.
- Reworked kubernetes-apiserver readiness and liveness tests.

Change-Id: Ifb39ebed0f9f6e430e97247fceebbd7816f092c7
2018-05-08 14:57:24 -05:00
Mark Burnett 8bbb84af97 Add a second auxiliary etcd server for bootstrap
This adds stability to etcd and enables cleaner waiting by tiller during
deployment of the Kubernetes apiserver and etcd.

* Adds second auxiliary etcd process.
* Enables "sequenced" for remaining ChartGroups.
* Removes unused disks from test VMs.
* Add readiness and liveness probes for kubernetes components

Change-Id: I6f83bb912f76b0ec35503723b417ba45d69e39c5
2018-04-27 13:31:39 -05:00
Aaron Sheffield 2885218d35 Add Helm test for HAProxy
- Added a helm test to test HAProxy's health via kubernetes healthz endpoint.

Change-Id: I0ffba39d4e4245fad69c27f0fcafdcb58fdc9067
2018-04-19 12:16:27 -04:00
Scott Hussey 88681e754a Missing resource limits on apiserver pod
- Add resource limits to the static defintion for the
  apiserver pod

Change-Id: I473c67e53da148f92441563187d6e026cf697582
2018-04-03 10:15:29 -05:00
portdirect 12255d0d66 Kube: add labels to k8s component pods
This PS adds labels to k8s component pods.

Change-Id: I3438bae73080e0cbfec94280bf475a8ccb7ce47d
2018-01-18 22:21:52 -05:00
Anthony Lin dee0960ed7 Refactor apiserver Chart
Refactor apiserver chart to align with OSH
standards

Change-Id: I9d168226622d8fc2047a0b71cf390c086d3efe40
2017-11-07 23:41:26 +00:00