You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I deploy cluster with this command: ansible-playbook -i ../inventory -b -vvvvv --private-key=~/.ssh/admin cluster.yml
Then, I check everything and find that about nothing from hardening.yaml have applied.
Next step, I try to specifically point to that file:
ansible-playbook -i ../inventory -b -vvvvv --private-key=~/.ssh/dev1-k8s-admin -e "@../inventory/group_vars/hardening.yaml" cluster.yml
After that command, about half options have applied:
tls_min_version
tls_cipher_suites
encryption at rest
kube_apiserver_enable_admission_plugins
kubelet_systemd_hardening
But other still missing, i.e. kube_audit logs, kube_scheduler_bind_address, kube_controller_manager_bind_address
Then I tried to run this command: ansible-playbook -i ../inventory -b -vvvvv --private-key=~/.ssh/dev1-k8s-admin -e "@../inventory/group_vars/hardening.yaml" -e upgrade_cluster_setup=true cluster.yml
but nothing changed. I've checked /etc/kubernetes/manifests/kube-api-server.yaml but it didn't change, however, file kubeadm-config.yaml contained audit logs parameters.
Then I've combined ALL variables into single file all.yaml, recreated infrastructure completely and ran ansible-playbook -i ../inventory -b -vvvvv --private-key=~/.ssh/admin cluster.yml
However, kubespray failed on a step when it tries to install kubelet-csr-approver and I got following error: kubespray stderr: Error: release kubelet-csr-approver failed, and has been uninstalled due to atomic being set: context deadline exceeded
When that happened i've noticed, that all nodes were tainted with the following taint: node.cloudprovider.kubernetes.io/uninitialized=true:NoSchedule
and kubelet-csr-approver failed to deploy because of that. I've tried to remove those taints and ran cluster.yaml again and kubelet-csr-approver successfully deployed.
Also, no matter what I do, some options simply not applying. Example:
kube_controller_manager_bind_address: 127.0.0.1
kube_scheduler_bind_address: 127.0.0.1
And other options completely breaks installation process, such as:
remove_anonymous_access: true
etcd_deployment_type: kubeadm
Regarding the remove_anonymous_access, the problem is similar to this issue
What happened?
For deploying k8s on Openstack, I've made following structure:
`
`
Obviously,
all.yaml
contains all necessary configuration for a cluster,openstack.yaml
contains some values for openstack that are generated by terraform, andhardening.yaml
contains most of the configuration from https://github.com/kubernetes-sigs/kubespray/blob/master/docs/operations/hardening.mdI deploy cluster with this command:
ansible-playbook -i ../inventory -b -vvvvv --private-key=~/.ssh/admin cluster.yml
Then, I check everything and find that about nothing from
hardening.yaml
have applied.Next step, I try to specifically point to that file:
ansible-playbook -i ../inventory -b -vvvvv --private-key=~/.ssh/dev1-k8s-admin -e "@../inventory/group_vars/hardening.yaml" cluster.yml
After that command, about half options have applied:
But other still missing, i.e. kube_audit logs, kube_scheduler_bind_address, kube_controller_manager_bind_address
Then I tried to run this command:
ansible-playbook -i ../inventory -b -vvvvv --private-key=~/.ssh/dev1-k8s-admin -e "@../inventory/group_vars/hardening.yaml" -e upgrade_cluster_setup=true cluster.yml
but nothing changed. I've checked
/etc/kubernetes/manifests/kube-api-server.yaml
but it didn't change, however, filekubeadm-config.yaml
contained audit logs parameters.Then I've combined ALL variables into single file
all.yaml
, recreated infrastructure completely and ranansible-playbook -i ../inventory -b -vvvvv --private-key=~/.ssh/admin cluster.yml
However, kubespray failed on a step when it tries to install
kubelet-csr-approver
and I got following error:kubespray stderr: Error: release kubelet-csr-approver failed, and has been uninstalled due to atomic being set: context deadline exceeded
When that happened i've noticed, that all nodes were tainted with the following taint:
node.cloudprovider.kubernetes.io/uninitialized=true:NoSchedule
and
kubelet-csr-approver
failed to deploy because of that. I've tried to remove those taints and rancluster.yaml
again andkubelet-csr-approver
successfully deployed.Also, no matter what I do, some options simply not applying. Example:
And other options completely breaks installation process, such as:
Regarding the
remove_anonymous_access
, the problem is similar to this issuekube-apiserver.yaml
kubeadm-config.yaml
What did you expect to happen?
I can deploy kubernetes from scratch with all hardening settings enabled.
How can we reproduce it (as minimally and precisely as possible)?
Create following structure:
`
`
and use my values
OS
Linux 5.15.0-130-generic x86_64
PRETTY_NAME="Ubuntu 22.04.5 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.5 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
Version of Ansible
ansible [core 2.16.14]
config file = /home/denys/project/k8s-svc/env/dev1/kubespray/ansible.cfg
configured module search path = ['/home/denys/project/k8s-svc/env/dev1/kubespray/library']
ansible python module location = /home/denys/project/k8s-svc/env/dev1/kubespray/venv/lib/python3.12/site-packages/ansible
ansible collection location = /home/denys/.ansible/collections:/usr/share/ansible/collections
executable location = /home/denys/project/k8s-svc/env/dev1/kubespray/venv/bin/ansible
python version = 3.12.3 (main, Nov 6 2024, 18:32:19) [GCC 13.2.0] (/home/denys/project/k8s-svc/env/dev1/kubespray/venv/bin/python3)
jinja version = 3.1.5
libyaml = True
Version of Python
Python 3.10.12
Version of Kubespray (commit)
3305ae9
Network plugin used
cilium
Full inventory with variables
all.yaml
hardening.yaml
Command used to invoke ansible
ansible-playbook -i ../inventory -b -vvvvv --private-key=~/.ssh/key cluster.yml
Output of ansible run
Anything else we need to know
No response
The text was updated successfully, but these errors were encountered: