-
Notifications
You must be signed in to change notification settings - Fork 242
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Unattended upgrades For * APT based * YUM based * Flatcar Signed-off-by: Artiom Diomin <[email protected]> * Label nodes with detected OS Signed-off-by: Artiom Diomin <[email protected]> * Review changes Signed-off-by: Artiom Diomin <[email protected]> * add amzn2 Signed-off-by: Artiom Diomin <[email protected]> * Deploy kured to Amazon Linux 2 too Signed-off-by: Artiom Diomin <[email protected]>
- Loading branch information
Showing
8 changed files
with
794 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Unattended Upgrades | ||
|
||
This addon will automate upgrading system packages of the distro of your choice. | ||
|
||
## Requirements | ||
|
||
Since KubeOne 1.3+ we automatically label control-plane nodes with | ||
`v1.kubeone.io/operating-system` and worker nodes with | ||
`v1.machine-controller.kubermatic.io/operating-system` and use those labels as | ||
nodeAffinity in this addon manifests. | ||
|
||
## What's included | ||
|
||
This addon provides bunch of DaemonSets and operators: | ||
|
||
* **Debian/Ubuntu** | ||
DaemonSet that will install `unattended-upgrades` | ||
* **RHEL/CentOS/Amazon Linux 2** | ||
DaemonSet that will install and configure `yum-cron`/`dnf-automatic` | ||
* **Debian/Ubuntu/RHEL/CentOS/Amazon Linux 2** | ||
[Kured](https://github.com/weaveworks/kured) (DaemonSet and operator) that | ||
will orchestrate node rebootes in case when it's required (kernel upgrades) | ||
* **Flatcar Linux** | ||
[Flatcar Linux Update Operator](https://github.com/kinvolk/flatcar-linux-update-operator) | ||
|
||
## Deployment instructions | ||
|
||
Copy files from this directory to your configured addons directory. | ||
|
||
In `kubeone.yaml` config: | ||
```yaml | ||
addons: | ||
enable: true | ||
path: "./addons" | ||
``` | ||
## Information about permissions | ||
Since daemonSets provided by this addon are making changes on the nodes | ||
themselves they require elevated permissions like full root access to the host | ||
machine. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: DaemonSet | ||
metadata: | ||
name: unattended-upgrades-install | ||
namespace: kube-system | ||
spec: | ||
selector: | ||
matchLabels: | ||
name: unattended-upgrades-install | ||
updateStrategy: | ||
type: RollingUpdate | ||
template: | ||
metadata: | ||
labels: | ||
name: unattended-upgrades-install | ||
spec: | ||
affinity: | ||
nodeAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
nodeSelectorTerms: | ||
- matchExpressions: | ||
- key: v1.machine-controller.kubermatic.io/operating-system | ||
operator: In | ||
values: | ||
- ubuntu | ||
- matchExpressions: | ||
- key: v1.kubeone.io/operating-system | ||
operator: In | ||
values: | ||
- ubuntu | ||
- debian | ||
tolerations: | ||
- key: node-role.kubernetes.io/master | ||
effect: NoSchedule | ||
hostPID: true | ||
containers: | ||
- name: "unattended-upgrades-install" | ||
image: "alpine:3.12.4" | ||
securityContext: | ||
privileged: true | ||
command: | ||
- /bin/sh | ||
- -c | ||
- | | ||
set -xeuo pipefail | ||
apk add --no-cache bash util-linux | ||
nsenter -t 1 -m -u -i -n -p -- bash -c "${STARTUP_SCRIPT}" | ||
sleep inf | ||
env: | ||
- name: STARTUP_SCRIPT | ||
value: | | ||
set -xeuo pipefail | ||
export DEBIAN_FRONTEND=noninteractive | ||
apt-get install -y --no-install-recommends \ | ||
apt-utils \ | ||
unattended-upgrades |
Oops, something went wrong.