This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
система_kubernetes [2025/12/03 15:06] val [Развертывание через Kubespray] |
система_kubernetes [2025/12/04 13:25] (current) val [Volumes] |
||
|---|---|---|---|
| Line 444: | Line 444: | ||
| === Вариант 1 (ansible) === | === Вариант 1 (ansible) === | ||
| + | * [[https://github.com/kubernetes-sigs/kubespray/blob/v2.26.0/README.md]] | ||
| * [[Язык программирования Python#Виртуальная среда Python]] | * [[Язык программирования Python#Виртуальная среда Python]] | ||
| Line 570: | Line 571: | ||
| === Вариант 2 (docker) === | === Вариант 2 (docker) === | ||
| - | * [[https://github.com/kubernetes-sigs/kubespray/tree/v2.29.0]] | + | * [[https://github.com/kubernetes-sigs/kubespray/blob/v2.29.0/README.md]] |
| <code> | <code> | ||
| Line 581: | Line 582: | ||
| #kube2 ansible_host=192.168.X.222 | #kube2 ansible_host=192.168.X.222 | ||
| #kube3 ansible_host=192.168.X.223 | #kube3 ansible_host=192.168.X.223 | ||
| + | ##kube4 ansible_host=192.168.X.224 | ||
| [kube_control_plane] | [kube_control_plane] | ||
| Line 590: | Line 592: | ||
| [kube_node] | [kube_node] | ||
| kube[1:3] | kube[1:3] | ||
| + | #kube[1:4] | ||
| </code><code> | </code><code> | ||
| - | server:~# docker run --userns=host --rm -it --mount type=bind,source="$(pwd)"/inventory/sample,dst=/inventory --mount type=bind,source="${HOME}"/.ssh/,dst=/root/.ssh/ quay.io/kubespray/kubespray:v2.29.0 bash | + | server:~# docker run --userns=host --rm -it -v /root/inventory/sample:/inventory -v /root/.ssh/:/root/.ssh/ quay.io/kubespray/kubespray:v2.29.0 bash |
| root@cf764ca3b291:/kubespray# time ansible-playbook -i /inventory/inventory.ini cluster.yml | root@cf764ca3b291:/kubespray# time ansible-playbook -i /inventory/inventory.ini cluster.yml | ||
| ... | ... | ||
| - | 12 min | + | real 12m18.679s |
| ... | ... | ||
| </code> | </code> | ||
| Line 1509: | Line 1512: | ||
| ssh root@kube2 'chmod 777 /opt/local-path-provisioner' | ssh root@kube2 'chmod 777 /opt/local-path-provisioner' | ||
| ssh root@kube3 'chmod 777 /opt/local-path-provisioner' | ssh root@kube3 'chmod 777 /opt/local-path-provisioner' | ||
| + | ssh root@kube4 'mkdir /opt/local-path-provisioner' | ||
| + | ssh root@kube4 'chmod 777 /opt/local-path-provisioner' | ||
| $ ###kubectl patch storageclass local-path -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}' | $ ###kubectl patch storageclass local-path -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}' | ||
| Line 1528: | Line 1533: | ||
| (venv1) server:~# ansible all -f 4 -m apt -a 'pkg=open-iscsi state=present update_cache=true' -i /root/kubespray/inventory/mycluster/hosts.yaml | (venv1) server:~# ansible all -f 4 -m apt -a 'pkg=open-iscsi state=present update_cache=true' -i /root/kubespray/inventory/mycluster/hosts.yaml | ||
| + | |||
| + | root@a7818cd3f7c7:/kubespray# ansible all -f 4 -m apt -a 'pkg=open-iscsi state=present update_cache=true' -i /inventory/inventory.ini | ||
| </code> | </code> | ||
| * [[https://github.com/longhorn/longhorn]] | * [[https://github.com/longhorn/longhorn]] | ||
| Line 1540: | Line 1547: | ||
| </code> | </code> | ||
| - | Подключение через kubectl proxy | + | Подключение через [[#kubectl proxy]] |
| * [[https://stackoverflow.com/questions/45172008/how-do-i-access-this-kubernetes-service-via-kubectl-proxy|How do I access this Kubernetes service via kubectl proxy?]] | * [[https://stackoverflow.com/questions/45172008/how-do-i-access-this-kubernetes-service-via-kubectl-proxy|How do I access this Kubernetes service via kubectl proxy?]] | ||
| Line 1926: | Line 1933: | ||
| $ helm upgrade ingress-nginx -i ingress-nginx -f values.yaml --repo https://kubernetes.github.io/ingress-nginx -n ingress-nginx --create-namespace | $ helm upgrade ingress-nginx -i ingress-nginx -f values.yaml --repo https://kubernetes.github.io/ingress-nginx -n ingress-nginx --create-namespace | ||
| + | |||
| + | $ kubectl get all -n ingress-nginx | ||
| $ kubectl exec -n ingress-nginx pods/ingress-nginx-controller-<TAB> -- cat /etc/nginx/nginx.conf | tee nginx.conf | grep use_forwarded_headers | $ kubectl exec -n ingress-nginx pods/ingress-nginx-controller-<TAB> -- cat /etc/nginx/nginx.conf | tee nginx.conf | grep use_forwarded_headers | ||