- OTHER CHANGES
- add flags
client-ca-file
,tls-cert-file
andtls-private-key-file
tok8s_controller_manager_settings
(contribution by @hajowieland). Fixes #69 - add flags
client-ca-file
,tls-cert-file
andtls-private-key-file
tok8s_scheduler_settings
- add flags
- UPDATE
- update
k8s_ctl_release
to1.31.5
- update
-
UPDATE
- update
k8s_ctl_release
to1.30.9
- update
-
OTHER CHANGES
- update
.gitignore
- fix
ansible-lint
issues
- update
-
UPDATE
- update
k8s_ctl_release
to1.30.5
- update
-
OTHER CHANGES
- support Ubuntu 24.04
- update
.yamllint
- OTHER CHANGES
- fix download URLs for Kubernetes binaries (see: Download Kubernetes - Binaries
- UPDATE
- update
k8s_ctl_release
to1.29.9
- update
- UPDATE
- update
k8s_ctl_release
to1.29.4
- update
- UPDATE
- update
k8s_ctl_release
to1.29.3
- Molecule: use
alvistack
instead ofgeneric
Vagrant boxes
- update
- UPDATE
- update
k8s_ctl_release
to1.28.8
- update
- BUGFIX
- ClusterRoleBinding
system:kube-apiserver
needs to honork8s_apiserver_csr_cn
value for as username - Because of the previous change move
files/kube-apiserver-to-kubelet_cluster_role.yaml -> templates/rbac/kube-apiserver-to-kubelet_cluster_role.yaml.j2
andfiles/kube-apiserver-to-kubelet_cluster_role_binding.yaml -> templates/rbac/kube-apiserver-to-kubelet_cluster_role_binding.yaml.j2
as both files became a Jinja2 template.
- ClusterRoleBinding
-
MOLECULE
- Change to Ubuntu 22.04 for test-assets VM
- Adjust common names for certificates / change algo to ecdsa and algo size
-
OTHER CHANGES
- Fix permissions for temporary directory
- Adjust Github action because of Ansible Galaxy changes
-
UPDATE
- Update
k8s_ctl_release
to1.28.5
- Update
-
BREAKING
- Extend
enable-admission-plugins
ink8s_apiserver_settings
by:PodSecurity,Priority,StorageObjectInUseProtection,RuntimeClass,CertificateApproval,CertificateSigning,ClusterTrustBundleAttest,CertificateSubjectRestriction,DefaultIngressClass
. These are enabled by default if this flag is not specified (see Admission Controllers Reference for more information).
- Extend
-
MOLECULE
- Change IP addresses
-
PLEASE READ CAREFULLY This release contains quite a few potential breaking changes! So review carefully before rolling out the new version of this role! A bigger part of the whole changes are related to increase security. While most of the new variables and defaults should be just fine and should just work out of the box side effects might occur.
All the newly introduced or changed variables have detailed comments in README. So please read them carefully!
This refactoring was needed to make it possible to have
githubixx.kubernetes_controller
andgithubixx.kubernetes_worker
deployed on the same host e.g. They were some intersections between the two roles that had to be fixed.Please remove
/var/lib/kubernetes/admin.kubeconfig
on the K8s controller nodes (if you didn't change the default directory for this file). Older versions of this role created this file. It's no longer needed. It contains thekubeconfig
(so basically the credentials file) for theadmin
user. This is a very powerful user (actually the user with the most permissions). So use with care and store the file in a secure place!admin.kubeconfig
should only be used at the very beginning to create a new user with less permissions. -
UPDATE
- update
k8s_ctl_release
to1.27.8
- update
-
BREAKING
- Rename variable
k8s_conf_dir
tok8s_ctl_conf_dir
. Additionally the default value changed from/usr/lib/kubernetes
to/etc/kubernetes/controller
. - Introduce variable
k8s_admin_conf_dir
. Currently it only storesadmin.kubeconfig
which is basically the credentials file of theadmin
"user". Formerly this file was stored in the directory specified in the (now removed)k8s_config_directory
variable. The default value ofk8s_admin_conf_dir
is the same as the removedk8s_config_directory
. Additionally to set permissions fork8s_admin_conf_dir
the following variables were introduced:k8s_admin_conf_dir_perm
,k8s_admin_conf_owner
andk8s_admin_conf_group
. - Introduce variable
k8s_ctl_pki_dir
. All certificate files specified ink8s_ctl_certificates
andk8s_ctl_etcd_certificates
(seevars/main.yml
) will be stored here. Related to this: Certificate related settings ink8s_apiserver_settings
usedk8s_conf_dir
before and now usek8s_ctl_pki_dir
. That'sclient-ca-file
,etcd-cafile
,etcd-certfile
,etcd-keyfile
,kubelet-certificate-authority
,kubelet-client-certificate
,kubelet-client-key
,service-account-key-file
,service-account-signing-key-file
,tls-cert-file
andtls-private-key-file
. Fork8s_controller_manager_settings
that's:cluster-signing-cert-file
,cluster-signing-key-file
,root-ca-file
,requestheader-client-ca-file
andservice-account-private-key-file
. And fork8s_scheduler_settings
that's:requestheader-client-ca-file
. - Rename variable
k8s_bin_dir
tok8s_ctl_bin_dir
. - Rename variable
k8s_release
tok8s_ctl_release
. - The default value for
k8s_interface
changed fromtap0
toeth0
. - Rename variable
k8s_controller_binaries
tok8s_ctl_binaries
. Additionally this variable is no longer defined indefaults/main.yml
but invars/main.yml
. Since this list is fixed anyways it makes no sense to allow to modify this list. - Rename variable
k8s_certificates
tok8s_ctl_certificates
. - Rename variable
etcd_certificates
tok8s_ctl_etcd_certificates
. Additionally this variable is no longer defined indefaults/main.yml
but invars/main.yml
. Since this list is fixed anyways it makes no sense to allow to modify this list. - Rename variable
etcd_client_port
tok8s_ctl_etcd_client_port
. - Rename variable
etcd_interface
tok8s_ctl_etcd_interface
. Additionally the default value changed fromtap0
toeth0
. - Use
k8s_ctl_etcd_interface
variable instead ofk8s_interface
for--etcd-servers
option intemplates/etc/systemd/system/kube-apiserver.service.j2
. Normallyetcd
andkube-apiserver
listen on the same interface. But if someone specifiedk8s_ctl_etcd_interface
(formerlyetcd_interface
in the context of this role) it was basically ignored as the value ofk8s_interface
was used instead. That's fixed now. - Rename variable
k8s_controller_delegate_to
tok8s_ctl_delegate_to
. - Introduce
k8s_apiserver_conf_dir
variable.encryption-config.yaml
is now located ink8s_apiserver_conf_dir
. - Change default value of
k8s_controller_manager_conf_dir
to"{{ k8s_ctl_conf_dir }}/kube-controller-manager"
. - Change default value of
k8s_scheduler_conf_dir
to"{{ k8s_ctl_conf_dir }}/kube-scheduler"
. - Rename
kube-controller-manager.kubeconfig
tokubeconfig
. This affectsk8s_controller_manager_settings
and the following settings:authentication-kubeconfig
,authorization-kubeconfig
andkubeconfig
. - Rename
kube-scheduler.kubeconfig
tokubeconfig
. This affectsk8s_scheduler_settings
and the following settings:authentication-kubeconfig"
andauthorization-kubeconfig
. - Added new option
encryption-provider-config-automatic-reload: "true"
tok8s_apiserver_settings
. In case the file specified inencryption-provider-config
changeskube-apiserver
will automatically reload that file. This is handy if one wants to change the encryption provider (also see new variablek8s_apiserver_encryption_provider_config
) - Introduce
k8s_ctl_service_options
variable. As mentioned above already previouslykube-apiserver
,kube-controller-manager
andkube-scheduler
were running as userroot
. Now these services will run ask8s_run_as_user
andk8s_run_as_group
. Additionallysystemd
allows to limit the exposure of the system towards the unit's processes. Basically all settings belowRestartSec=5
are related to increase security and limit what the process allowed to do. So these settings reduce the attack surface quite a bit already. They're not perfect but a starting point. If you want the previous behavior just remove all settings besidesRestart
andRestartSec
. But that also means that they'll run again asroot
user. - The following variables are no longer used and can be removed:
k8s_encryption_config_directory
,k8s_encryption_config_owner
,k8s_encryption_config_group
,k8s_encryption_config_directory_perm
andk8s_encryption_config_file_perm
. Previously these values were needed to specify permissions on the Ansible controller for this file/directory. Since this file is now generated directly on the K8s controller nodes they're no longer needed. That also means you can removeencryption-config.yaml
from Ansible controller node (like your workstation e.g.) - The variable
k8s_config_directory
is gone. It's no longer in use. After the upgrade to this release you can delete this directory (if you accept the new default!) and it's content (make a backup esp. ofadmin.kubeconfig
file - just in case!) - Rename
k8s_ca_conf_directory
tok8s_ctl_ca_conf_directory
- Rename variable
-
FEATURE
- Introduce
k8s_run_as_user
variable. Previously all control plane services likekube-apiserver
,kube-scheduler
andkube-controller-manager
run as userroot
. Security-wise that's not optimal. There is just no need to run them asroot
as long they use a listening port >1024
which they do by default. In this version all these services will run as the user specified withk8s_run_as_user
which isk8s
by default. Related to this variable are the new variablesk8s_run_as_user_shell
,k8s_run_as_user_system
,k8s_run_as_group
andk8s_run_as_group_system
. See README for further information about this variables. The defaults should be just fine even for upgrading from a previous version of this role. - Introduce
k8s_ctl_api_endpoint_host
andk8s_ctl_api_endpoint_port
variables. Previouslykube-scheduler
andkube-controller-manager
where configured to connect to the first host in the Ansiblek8s_controller
group and communicate with thekube-apiserver
that was running there. This was hard-coded and couldn't be changed. If that host was down the K8s worker nodes didn't receive any updates. Now one can install and use a load balancer likehaproxy
e.g. that distributes requests between allkube-apiserver
's and takes akube-apiserver
out of rotation if that one is down (also see my Ansible haproxy role for that use case). The default is still to use the first host/kube-apiserver in the Ansiblek8s_controller
group. So behavior-wise nothing changed basically. - Introduce
k8s_admin_api_endpoint_host
andk8s_admin_api_endpoint_port
variables. For these two variables the same is basically true as fork8s_ctl_api_endpoint_host
andk8s_ctl_api_endpoint_port
variables above. But these settings are meant to be used by theadmin
user that this role creates by default. These settings are written intoadmin.kubeconfig
. So it's possible to configure another host/load balancer for theadmin
user as for the K8s control plane services mentioned in the previous paragraph. - Introduce
k8s_ctl_log_base_dir
andk8s_ctl_log_base_dir_mode
. Normallykube-apiserver
,kube-controller-manager
andkube-scheduler
log tojournald
. But there are exceptions like the audit log. For this kind of log files this directory will be used as a base path. - Introduce
k8s_apiserver_audit_log_dir
. Directory to store kube-apiserver audit logs. - Introduce
k8s_apiserver_encryption_provider_config
variable. Previously the content of this file was hard-coded. Now it's exposed via this variable. The content of that variable and the previously hard-coded value are the same. So if you keep the default when upgrading everything stays the same in that regards. NOTE: Changing this configuration and deploy the changes can potentially cause quite some problems! Make sure to read Encrypting Confidential Data at Rest and esp. Rotating a decryption key! - Add task to generate
kubeconfig
foradmin
user (previously this was a separate playbook). - Add task to generate
kubeconfig
forkube-controller-manager
service (previously this was a separate playbook). - Add task to generate
kubeconfig
forkube-scheduler
service (previously this was a separate playbook). - When downloading the Kubernetes binaries the task checks the SHA512 checksum
- Make
kube-scheduler
andkube-controller-manager
wait untilkube-apiserver
has started and is listening on a port
- Introduce
-
OTHER CHANGES
- Extend
k8s_ctl_certificates
(formerlyk8s_certificates
) list bycert-k8s-scheduler
andcert-k8s-controller-manager
files. This was needed as thekubeconfig
files are now generated on the K8s controller nodes and no longer on the Ansible controller host. Previously it was needed to prepare these files upfront before installing this role. That's no longer needed. Also see FEATURES list above. - Use
kubernetes.core.*
modules instead ofkubectl
binary - Fix some
ansible-lint
issues
- Extend
-
MOLECULE
- Updated all files to reflect the changes introduces with this version
- Tasks for creating
kubeconfig
forkube-controller-manager
,kube-scheduler
,admin
user andencryption configuration
are no longer needed as they're now part ofkubernetes_controller
role - Add
haproxy
to Ubuntu 22 hosts to test newk8s_ctl_api_endpoint_host
andk8s_ctl_api_endpoint_port
settings - Add tasks to install ansible-role-cni and ansible-role-runc
- Use
kubernetes.core.k8s_info
module instead of callingkubectl
binary
- rename
githubixx.harden-linux
togithubixx.harden_linux
- rename
githubixx.kubernetes-ca
togithubixx.kubernetes_ca
molecule/default/molecule.yml
: use Ubuntu 20.04 instead of 22.04 fortest-assets
for now because of certificate problems with Pythonurllib
module
- add support for Ubuntu 22.04
- BREAKING:
meta/main.yml
: change role_name fromkubernetes-controller
tokubernetes_controller
. This is a requirement since quite some time for Ansible Galaxy. But the requirement was introduced after this role already existed for quite some time. So please update the name of the role in your playbook accordingly! - update
k8s_release
to1.27.5
meta/main.yml
: remove Ubuntu 18.04 as supported OS (reached EOL)
- update
k8s_release
to1.26.8
kube-apiserver
needs to have network-online.target readykube-controller-manager
needs to have network-online.target readykube-scheduler
needs to have network-online.target ready
- update
k8s_release
to1.26.4
- add Molecule test
- add Github workflow
- update
k8s_release
to1.25.9
kube-apiserver
: remove--apiserver-count
flag. It has been deprecated and will be removed in a future K8s release.templates/var/lib/kube-scheduler/kube-scheduler.yaml.j2
:KubeSchedulerConfiguration v1beta2
is deprecated in Kubernetes v1.25, will be removed in v1.26
- Introduce
k8s_controller_delegate_to
variable. By default it's set to127.0.0.1
and reflects the same value as before.
- update
k8s_release
to1.25.5
- update
k8s_release
to1.24.9
- update
k8s_release
to1.24.4
- update
k8s_release
to1.23.10
- update
k8s_release
to1.23.3
- add parameter
authentication-kubeconfig
,authorization-kubeconfig
andrequestheader-client-ca-file
tok8s_scheduler_settings
(see K8s Deprecations 1.23) - remove
healthzBindAddress
andmetricsBindAddress
fromkube-scheduler.yaml.j2
(deprecated) - this role now requires Ansible >= 2.9
- update
k8s_release
to1.22.6
- use
kubescheduler.config.k8s.io/v1beta2
intemplates/var/lib/kube-scheduler/kube-scheduler.yaml.j2
(v1beta1
will be removed in Kubernetes v1.23 - see Remove scheduler policy config and cc v1beta1
- update
k8s_release
to1.22.5
- add parameter
authentication-kubeconfig
,authorization-kubeconfig
andrequestheader-client-ca-file
tok8s_controller_manager_settings
(see K8s Deprecations 1.22) - removed
kubelet-https: "true"
fromk8s_apiserver_settings
as no longer supported bykube-apiserver
(see: Mark --kubelet-https deprecated)
- update
k8s_release
to1.21.8
- update
k8s_release
to1.21.4
- remove Ubuntu 16.04 support
- update
k8s_release
to1.20.10
- update
k8s_release
to1.20.8
- update
k8s_release
to1.19.12
- update 'k8s_release' to
1.19.4
KubeSchedulerConfiguration
graduates to Beta (see Scheduler Configuration). Upgradekubescheduler.config.k8s.io/v1alpha2
tokubescheduler.config.k8s.io/v1beta1
- update
k8s_release
to1.18.12
- update
k8s_release
to1.18.6
- added
"allocate-node-cidrs": "true"
tok8s_controller_manager_settings
otherwisecluster-cidr
setting won't be used bykube-controller-manager
- creating ClusterRole's and ClusterRoleBindings is now delegated to
127.0.0.1
(localhost) instead of picking the first Kubernetes controller node for that task
- added Ubuntu 20.04 (Focal Fossa) as supported platform
- update
k8s_release
to1.18.5
- renamed
cert-etcd.pem/cert-etcd-key.pem
tocert-k8s-apiserver-etcd.pem/cert-k8s-apiserver-etcd-key.pem
. This was also adjusted inetcd_certificates
list. The changed name makes it more obvious that this is a client certificate forkube-apiserver
used to connect to a TLS securedetcd
cluster. In factkube-apiserver
is just a client toetcd
as all clients. In my ansible-role-kubernetes-ca this was also changed accordingly (seeetcd_additional_clients
list). ansible-role-kubernetes-ca is now able to generate client certificates for other services like Traefik or Cilium which are often used in a Kubernetes cluster. So the already existingetcd
cluster for Kubernetes (esp. forkube-apiserver
) can be reused for other components. - replaced
cluster-signing-cert-file": "{{k8s_conf_dir}}/ca-k8s-apiserver.pem
withcluster-signing-cert-file": "{{k8s_conf_dir}}/cert-k8s-apiserver.pem
ink8s_controller_manager_settings
- removed deprecated
port
setting ink8s_controller_manager_settings
which was replaced bysecure-port
setting (default value10257
) - removed
k8s_apiserver_secure_port
as it makes no sense. The value6443
can be set ink8s_apiserver_settings
("secure-port": "6443"
) as it is not used elsewhere kubescheduler.config.k8s.io/v1alpha1
changed tokubescheduler.config.k8s.io/v1alpha2
inkube-scheduler.yaml.j2
(see: CHANGELOG)
- update
k8s_release
to1.17.4
rbac.authorization.k8s.io/v1beta1
changed torbac.authorization.k8s.io/v1
- update
runtime-config
(needs boolean expression now)
- update
k8s_release
to1.16.8
- The following tags are removed as they're not compatible with Ansible Galaxy and I guess nobody uses them anymore:
r2.0.0_v1.9.0
r2.0.1_v1.9.0
r2.0.2_v1.9.1
r3.0.0_v1.9.1
r3.0.0_v1.9.3
r3.0.0_v1.9.8
r4.0.1_v1.10.4
r4.0.2_v1.10.4
r4.0.3_v1.10.4
r4.0.4_v1.10.8
r5.0.1_v1.12.3
v1.0.0_r1.5.1
v1.0.0_v1.8.0
v1.0.0_v1.8.2
v1.1.0_v1.8.4
v1.1.1_v1.8.4
v1.1.2_v1.8.4
v1.2.0_v1.8.4
- strengthen file permissions for certificate files and other config files
- update
k8s_release
to1.16.3
- remove deprecated
enable-swagger-ui
option fromkube-apiserver
- update
k8s_release
to1.15.6
- update
k8s_release
to1.15.3
- update
k8s_release
to1.14.6
- update
k8s_release
to1.14.2
- add all admissions plugins to
enable-admission-plugins
option that are enabled by default in K8s 1.14 - remove
Initializers
admission plugin (no longer available in 1.14)
- update
k8s_release
to1.13.5
- introduce
bind-address
flag and bind on VPN IP by default - introduce
port
flag for kube-controller-manager and set value to 0 to disable unsecure port
- update
k8s_release
to1.13.2
- kube-apiserver:
--experimental-encryption-provider-config
flag is deprecated and replaced in favor of--encryption-provider-config
- kube-apiserver: the configuration file referenced by
--encryption-provider-config
now useskind: EncryptionConfiguration
andapiVersion: apiserver.config.k8s.io/v1
. Support forkind: EncryptionConfig
andapiVersion: v1
is deprecated and will be removed in a future release. See kubeencryptionconfig and Kubernetes the not so hard way with Ansible - Certificate authority (search forkubeencryptionconfig.yml
). To avoid deprecation warnings it makes sense to create a newencryption-config.yaml
before running this role to updatekube-apiserver
. - use correct semantic versioning as described in semver. Needed for Ansible Galaxy importer as it now insists on using semantic versioning.
- make Ansible linter happy
- update
k8s_release
to1.12.3
- kube-apiserver: added
Priority
admission plugin - kube-scheduler: deprecated group version changed from
componentconfig/v1alpha1
tokubescheduler.config.k8s.io/v1alpha1
- kube-controller-manager: replace deprecated
--address
setting with--bind-address
- update
k8s_release
to1.11.3
- update
k8s_release
to1.10.8
- support Ubuntu 18.04
- wait for kube-apiserver on port 8080 no longer needed (fixes #11)
- update
k8s_release
to1.10.4
- removed deprecated kube-apiserver parameter
insecure-bind-address
(see: #59018) - added variable
k8s_apiserver_secure_port: 6443
- added parameter
secure-port
tok8s_apiserver_settings
parameter list - added
kube-controller-manager-ca
certificate files tok8s_certificates
list - added variable
k8s_controller_manager_conf_dir
/ added kubeconfig for kube-controller-manager - added variable
k8s_scheduler_conf_dir
/ added kubeconfig for kube-scheduler / settings for kube-scheduler now intemplates/var/lib/kube-scheduler/kube-scheduler.yaml.j2
- added kubeconfig for
admin
user (located by default ink8s_conf_dir
). Thisadmin.kubeconfig
will be needed forkubectl
- new
service-account-key-file
value for kube-apiserver - changes in
k8s_controller_manager_settings
: removedmaster
parameter, addedkubeconfig
, new value forservice-account-private-key-file
, new parameteruse-service-account-credentials
- update
k8s_release
to1.9.8
- update
k8s_release
to1.9.3
- move advertise-address,bind-address,insecure-bind-address out of kube-apiserver.service.j2 template
- move address,master settings out of kube-controller-manager.service.j2 template / fix variable bug in
k8s_apiserver_settings
- move address,master settings out of kube-scheduler.service.j2 template
- fix: use
k8s_etcd
hosts group instead ofk8s_controller
group to generate etcd server list - we need to wait for kube-apiserver port 8080 to become ready before running kubectl tasks
- update to Kubernetes v1.9.1
- removed duplicate key cluster-signing-cert-file from
k8s_controller_manager_settings
dictionary
- introduce flexible parameter settings for API server via
k8s_apiserver_settings/k8s_apiserver_settings_user
- introduce flexible parameter settings for controller manager via
k8s_controller_manager_settings/k8s_controller_manager_settings_user
- introduce flexible parameter settings for kube-scheduler via
k8s_scheduler_settings/k8s_scheduler_settings_user
- change defaults for
k8s_ca_conf_directory
andk8s_config_directory
variables - update to Kubernetes v1.9.0
No changelog for releases < r2.0.0_v1.9.0 (see commit history if needed)