Openstack over k8s: различия между версиями
Sirmax (обсуждение | вклад) |
Sirmax (обсуждение | вклад) |
||
Строка 68: | Строка 68: | ||
<BR> |
<BR> |
||
К сожалению я не сохранил список скриптов которые приходилось перезапускать |
К сожалению я не сохранил список скриптов которые приходилось перезапускать |
||
+ | |||
+ | ===Проверка OenStack=== |
||
+ | После окончания проверил самым простым способом - работает ли keystone: |
||
+ | |||
+ | <PRE> |
||
+ | root@openstack:~# export OS_CLOUD=openstack_helm |
||
+ | root@openstack:~# openstack token issue |
||
+ | </PRE> |
||
+ | |||
+ | На первый взгляд все PODы как минимум запустились |
||
+ | <PRE> |
||
+ | kubectl -n openstack get pods |
||
+ | NAME READY STATUS RESTARTS AGE |
||
+ | ceph-ks-endpoints-hkj77 0/3 Completed 0 3h |
||
+ | ceph-ks-service-l4wdx 0/1 Completed 0 3h |
||
+ | ceph-openstack-config-ceph-ns-key-generator-z82mk 0/1 Completed 0 17h |
||
+ | ceph-rgw-66685f585d-st7dp 1/1 Running 0 3h |
||
+ | ceph-rgw-storage-init-2vrpg 0/1 Completed 0 3h |
||
+ | cinder-api-85df68f5d8-j6mqh 1/1 Running 0 2h |
||
+ | cinder-backup-5f9598868-5kxxx 1/1 Running 0 2h |
||
+ | cinder-backup-storage-init-g627m 0/1 Completed 0 2h |
||
+ | cinder-bootstrap-r2295 0/1 Completed 0 2h |
||
+ | cinder-db-init-nk7jm 0/1 Completed 0 2h |
||
+ | cinder-db-sync-vlbcm 0/1 Completed 0 2h |
||
+ | cinder-ks-endpoints-cnwgb 0/9 Completed 0 2h |
||
+ | cinder-ks-service-6zs57 0/3 Completed 0 2h |
||
+ | cinder-ks-user-bp8zb 0/1 Completed 0 2h |
||
+ | cinder-rabbit-init-j97b7 0/1 Completed 0 2h |
||
+ | cinder-scheduler-6bfcd6476d-r87hm 1/1 Running 0 2h |
||
+ | cinder-storage-init-6ksjc 0/1 Completed 0 2h |
||
+ | cinder-volume-5fccd4cc5-dpxqm 1/1 Running 0 2h |
||
+ | cinder-volume-usage-audit-1549203300-25mkf 0/1 Completed 0 14m |
||
+ | cinder-volume-usage-audit-1549203600-hnh54 0/1 Completed 0 8m |
||
+ | cinder-volume-usage-audit-1549203900-v5t4w 0/1 Completed 0 4m |
||
+ | glance-api-745dc74457-42nwf 1/1 Running 0 3h |
||
+ | glance-bootstrap-j5wt4 0/1 Completed 0 3h |
||
+ | glance-db-init-lw97h 0/1 Completed 0 3h |
||
+ | glance-db-sync-dbp5s 0/1 Completed 0 3h |
||
+ | glance-ks-endpoints-gm5rw 0/3 Completed 0 3h |
||
+ | glance-ks-service-64jfj 0/1 Completed 0 3h |
||
+ | glance-ks-user-ftv9c 0/1 Completed 0 3h |
||
+ | glance-rabbit-init-m7b7k 0/1 Completed 0 3h |
||
+ | glance-registry-6cb86c767-2mkbx 1/1 Running 0 3h |
||
+ | glance-storage-init-m29p4 0/1 Completed 0 3h |
||
+ | heat-api-69db75bb6d-h24w9 1/1 Running 0 3h |
||
+ | heat-bootstrap-v9642 0/1 Completed 0 3h |
||
+ | heat-cfn-86896f7466-n5dnz 1/1 Running 0 3h |
||
+ | heat-db-init-lfrsb 0/1 Completed 0 3h |
||
+ | heat-db-sync-wct2x 0/1 Completed 0 3h |
||
+ | heat-domain-ks-user-4fg65 0/1 Completed 0 3h |
||
+ | heat-engine-6756c84fdd-44hzf 1/1 Running 0 3h |
||
+ | heat-engine-cleaner-1549203300-s48sb 0/1 Completed 0 14m |
||
+ | heat-engine-cleaner-1549203600-gffn4 0/1 Completed 0 8m |
||
+ | heat-engine-cleaner-1549203900-6hwvj 0/1 Completed 0 4m |
||
+ | heat-ks-endpoints-wxjwp 0/6 Completed 0 3h |
||
+ | heat-ks-service-v95sk 0/2 Completed 0 3h |
||
+ | heat-ks-user-z6xhb 0/1 Completed 0 3h |
||
+ | heat-rabbit-init-77nzb 0/1 Completed 0 3h |
||
+ | heat-trustee-ks-user-mwrf5 0/1 Completed 0 3h |
||
+ | heat-trusts-7x7nt 0/1 Completed 0 3h |
||
+ | horizon-5877548d5d-27t8c 1/1 Running 0 3h |
||
+ | horizon-db-init-jsjm5 0/1 Completed 0 3h |
||
+ | horizon-db-sync-wxwpw 0/1 Completed 0 3h |
||
+ | ingress-86cf786fd8-fbz8w 1/1 Running 4 18h |
||
+ | ingress-error-pages-7f574d9cd7-b5kwh 1/1 Running 0 18h |
||
+ | keystone-api-f658f747c-q6w65 1/1 Running 0 3h |
||
+ | keystone-bootstrap-ds8t5 0/1 Completed 0 3h |
||
+ | keystone-credential-setup-hrp8t 0/1 Completed 0 3h |
||
+ | keystone-db-init-dhgf2 0/1 Completed 0 3h |
||
+ | keystone-db-sync-z8d5d 0/1 Completed 0 3h |
||
+ | keystone-domain-manage-86b25 0/1 Completed 0 3h |
||
+ | keystone-fernet-rotate-1549195200-xh9lv 0/1 Completed 0 2h |
||
+ | keystone-fernet-setup-txgc8 0/1 Completed 0 3h |
||
+ | keystone-rabbit-init-jgkqz 0/1 Completed 0 3h |
||
+ | libvirt-427lp 1/1 Running 0 2h |
||
+ | mariadb-ingress-5cff98cbfc-24vjg 1/1 Running 0 17h |
||
+ | mariadb-ingress-5cff98cbfc-nqlhq 1/1 Running 0 17h |
||
+ | mariadb-ingress-error-pages-5c89b57bc-twn7z 1/1 Running 0 17h |
||
+ | mariadb-server-0 1/1 Running 0 17h |
||
+ | memcached-memcached-6d48bd48bc-7kd84 1/1 Running 0 3h |
||
+ | neutron-db-init-rvf47 0/1 Completed 0 2h |
||
+ | neutron-db-sync-6w7bn 0/1 Completed 0 2h |
||
+ | neutron-dhcp-agent-default-znxhn 1/1 Running 0 2h |
||
+ | neutron-ks-endpoints-47xs8 0/3 Completed 1 2h |
||
+ | neutron-ks-service-sqtwg 0/1 Completed 0 2h |
||
+ | neutron-ks-user-tpmrb 0/1 Completed 0 2h |
||
+ | neutron-l3-agent-default-5nbsp 1/1 Running 0 2h |
||
+ | neutron-metadata-agent-default-9ml6v 1/1 Running 0 2h |
||
+ | neutron-ovs-agent-default-mg8ln 1/1 Running 0 2h |
||
+ | neutron-rabbit-init-sgnwm 0/1 Completed 0 2h |
||
+ | neutron-server-9bdc765c9-bx6sf 1/1 Running 0 2h |
||
+ | nova-api-metadata-78fb54c549-zcmxg 1/1 Running 2 2h |
||
+ | nova-api-osapi-6c5c6dd4fc-7z5qq 1/1 Running 0 2h |
||
+ | nova-bootstrap-hp6n4 0/1 Completed 0 2h |
||
+ | nova-cell-setup-1549195200-v5bv8 0/1 Completed 0 2h |
||
+ | nova-cell-setup-1549198800-6d8sm 0/1 Completed 0 1h |
||
+ | nova-cell-setup-1549202400-c9vfz 0/1 Completed 0 29m |
||
+ | nova-cell-setup-dfdzw 0/1 Completed 0 2h |
||
+ | nova-compute-default-fmqtl 1/1 Running 0 2h |
||
+ | nova-conductor-5b9956bffc-5ts7s 1/1 Running 0 2h |
||
+ | nova-consoleauth-7f8dbb8865-lt5mr 1/1 Running 0 2h |
||
+ | nova-db-init-hjp2p 0/3 Completed 0 2h |
||
+ | nova-db-sync-zn6px 0/1 Completed 0 2h |
||
+ | nova-ks-endpoints-ldzhz 0/3 Completed 0 2h |
||
+ | nova-ks-service-c64tb 0/1 Completed 0 2h |
||
+ | nova-ks-user-kjskm 0/1 Completed 0 2h |
||
+ | nova-novncproxy-6f485d9f4c-6m2n5 1/1 Running 0 2h |
||
+ | nova-placement-api-587c888875-6cmmb 1/1 Running 0 2h |
||
+ | nova-rabbit-init-t275g 0/1 Completed 0 2h |
||
+ | nova-scheduler-69886c6fdf-hcwm6 1/1 Running 0 2h |
||
+ | nova-service-cleaner-1549195200-7jw2d 0/1 Completed 1 2h |
||
+ | nova-service-cleaner-1549198800-pvckn 0/1 Completed 0 1h |
||
+ | nova-service-cleaner-1549202400-kqpxz 0/1 Completed 0 29m |
||
+ | openvswitch-db-nx579 1/1 Running 0 2h |
||
+ | openvswitch-vswitchd-p4xj5 1/1 Running 0 2h |
||
+ | placement-ks-endpoints-vt4pk 0/3 Completed 0 2h |
||
+ | placement-ks-service-sw2b9 0/1 Completed 0 2h |
||
+ | placement-ks-user-zv755 0/1 Completed 0 2h |
||
+ | rabbitmq-rabbitmq-0 1/1 Running 0 4h |
||
+ | swift-ks-user-ktptt 0/1 Completed 0 3h |
||
+ | </PRE> |
||
+ | |||
+ | ===Конфигурация KeyStone=== |
Версия 16:30, 3 февраля 2019
Комплексное задание на знание K8s/Helm/OpenStack на 8 рабочих часов (1 день)
* Install openstack(ceph as storage) on top of K8s(All-in-one-installation) using openstack-helm project * change Keystone token expiration time afterwards to 24 hours * deploy 3 VMs connected to each other using heat
TL; DR
- Мне понадобилось примерно 13 рабочих часов что бы закончить задние
Хорошее:
- Задание можно сделать за 8 часов (и даже быстрее)
Плохое
- Практически невозможно сделать на ноутбуке без Linux.
- Примерно половину времени потрачено на попытку "взлететь" напрямую на Mac OS и использовать в качестве кластера K8s уже имевшийся minikube
Это был явный фейл - как минимум чарты ceph не совместимы с миникубом никак (https://github.com/ceph/ceph-helm/issues/73), до остальных я не дошел.
Деплоить без скриптовой обвязки явно заняло бы больше чем 1 день (на самом деле если не срезать углы пользуясь скриптами то минимум неделя)
- Когда я понял что задеплоить на миникуб за отведеннгое время не успеваю то решил настроить ВМку с убунтой и дальше работать с ней
Второй явный фейл (но не мой =) ) - то тчо задание требует минимум 8 гигов свободной памяти, а на самом деле даже на ВМке с 16-ю гигами и 8 ядрами все шевелилось очень медленно. (Человек с ноутом с 8 гигами не сделает это задание из-за недостатка памяти)
Как следствие - регулярные падения скриптов из-за таймаутов,
Отмечу так же что с не слишеом быстрым интернетом я наступил на проблему, что Pull образов был медленным и скрипты не дожидались и падали по таймауту. Хорошей идеей было бы скачать образы заранее, но об этом я подумал уже в середине процесса и тратить время на анализ какие образы нужны, не стал,
Решение
Возможно какие-то моменты я забыл сохранить так как вывода на консоль было достаточно много.
Создание ВМки с Убунтой
https://docs.openstack.org/openstack-helm/latest/install/developer/requirements-and-host-config.html
System Requirements¶ The recommended minimum system requirements for a full deployment are: 16GB of RAM 8 Cores 48GB HDD
На этом этапе изначально я совершил 2 ошибки
- Создал слишком маленькую (мало CPU Cores) машину
- Не проверил пересечения сетей
Warning By default the Calico CNI will use 192.168.0.0/16 and Kubernetes services will use 10.96.0.0/16 as the CIDR for services. Check that these CIDRs are not in use on the development node before proceeding, or adjust as required.
Кстати, похоже что тут ошибка в маске в документации - реально используется маска /12
Немного отредактированный для удобства чтения вывод ps
root 5717 4.0 1.7 448168 292172 ? Ssl 19:27 0:51 | \_ kube-apiserver --feature-gates=MountPropagation=true,PodShareProcessNamespace=true --service-node-port-range=1024-65535 --advertise-address=172.17.0.1 --service-cluster-ip-range=10.96.0.0/12
Подготовка
Если следовать инструкции и не пробовать ничего менять то никаких проблем на 18-й убунте не возникло.
Установка OpenStack
Если следовать инструкции то никаких проблем не возникает, за исключением таймаутов.
Насколько я смог выяснить - все скрипты делают корректную зачистку и потому перезапуск достаточно безопасен.
К сожалению я не сохранил список скриптов которые приходилось перезапускать
Проверка OenStack
После окончания проверил самым простым способом - работает ли keystone:
root@openstack:~# export OS_CLOUD=openstack_helm root@openstack:~# openstack token issue
На первый взгляд все PODы как минимум запустились
kubectl -n openstack get pods NAME READY STATUS RESTARTS AGE ceph-ks-endpoints-hkj77 0/3 Completed 0 3h ceph-ks-service-l4wdx 0/1 Completed 0 3h ceph-openstack-config-ceph-ns-key-generator-z82mk 0/1 Completed 0 17h ceph-rgw-66685f585d-st7dp 1/1 Running 0 3h ceph-rgw-storage-init-2vrpg 0/1 Completed 0 3h cinder-api-85df68f5d8-j6mqh 1/1 Running 0 2h cinder-backup-5f9598868-5kxxx 1/1 Running 0 2h cinder-backup-storage-init-g627m 0/1 Completed 0 2h cinder-bootstrap-r2295 0/1 Completed 0 2h cinder-db-init-nk7jm 0/1 Completed 0 2h cinder-db-sync-vlbcm 0/1 Completed 0 2h cinder-ks-endpoints-cnwgb 0/9 Completed 0 2h cinder-ks-service-6zs57 0/3 Completed 0 2h cinder-ks-user-bp8zb 0/1 Completed 0 2h cinder-rabbit-init-j97b7 0/1 Completed 0 2h cinder-scheduler-6bfcd6476d-r87hm 1/1 Running 0 2h cinder-storage-init-6ksjc 0/1 Completed 0 2h cinder-volume-5fccd4cc5-dpxqm 1/1 Running 0 2h cinder-volume-usage-audit-1549203300-25mkf 0/1 Completed 0 14m cinder-volume-usage-audit-1549203600-hnh54 0/1 Completed 0 8m cinder-volume-usage-audit-1549203900-v5t4w 0/1 Completed 0 4m glance-api-745dc74457-42nwf 1/1 Running 0 3h glance-bootstrap-j5wt4 0/1 Completed 0 3h glance-db-init-lw97h 0/1 Completed 0 3h glance-db-sync-dbp5s 0/1 Completed 0 3h glance-ks-endpoints-gm5rw 0/3 Completed 0 3h glance-ks-service-64jfj 0/1 Completed 0 3h glance-ks-user-ftv9c 0/1 Completed 0 3h glance-rabbit-init-m7b7k 0/1 Completed 0 3h glance-registry-6cb86c767-2mkbx 1/1 Running 0 3h glance-storage-init-m29p4 0/1 Completed 0 3h heat-api-69db75bb6d-h24w9 1/1 Running 0 3h heat-bootstrap-v9642 0/1 Completed 0 3h heat-cfn-86896f7466-n5dnz 1/1 Running 0 3h heat-db-init-lfrsb 0/1 Completed 0 3h heat-db-sync-wct2x 0/1 Completed 0 3h heat-domain-ks-user-4fg65 0/1 Completed 0 3h heat-engine-6756c84fdd-44hzf 1/1 Running 0 3h heat-engine-cleaner-1549203300-s48sb 0/1 Completed 0 14m heat-engine-cleaner-1549203600-gffn4 0/1 Completed 0 8m heat-engine-cleaner-1549203900-6hwvj 0/1 Completed 0 4m heat-ks-endpoints-wxjwp 0/6 Completed 0 3h heat-ks-service-v95sk 0/2 Completed 0 3h heat-ks-user-z6xhb 0/1 Completed 0 3h heat-rabbit-init-77nzb 0/1 Completed 0 3h heat-trustee-ks-user-mwrf5 0/1 Completed 0 3h heat-trusts-7x7nt 0/1 Completed 0 3h horizon-5877548d5d-27t8c 1/1 Running 0 3h horizon-db-init-jsjm5 0/1 Completed 0 3h horizon-db-sync-wxwpw 0/1 Completed 0 3h ingress-86cf786fd8-fbz8w 1/1 Running 4 18h ingress-error-pages-7f574d9cd7-b5kwh 1/1 Running 0 18h keystone-api-f658f747c-q6w65 1/1 Running 0 3h keystone-bootstrap-ds8t5 0/1 Completed 0 3h keystone-credential-setup-hrp8t 0/1 Completed 0 3h keystone-db-init-dhgf2 0/1 Completed 0 3h keystone-db-sync-z8d5d 0/1 Completed 0 3h keystone-domain-manage-86b25 0/1 Completed 0 3h keystone-fernet-rotate-1549195200-xh9lv 0/1 Completed 0 2h keystone-fernet-setup-txgc8 0/1 Completed 0 3h keystone-rabbit-init-jgkqz 0/1 Completed 0 3h libvirt-427lp 1/1 Running 0 2h mariadb-ingress-5cff98cbfc-24vjg 1/1 Running 0 17h mariadb-ingress-5cff98cbfc-nqlhq 1/1 Running 0 17h mariadb-ingress-error-pages-5c89b57bc-twn7z 1/1 Running 0 17h mariadb-server-0 1/1 Running 0 17h memcached-memcached-6d48bd48bc-7kd84 1/1 Running 0 3h neutron-db-init-rvf47 0/1 Completed 0 2h neutron-db-sync-6w7bn 0/1 Completed 0 2h neutron-dhcp-agent-default-znxhn 1/1 Running 0 2h neutron-ks-endpoints-47xs8 0/3 Completed 1 2h neutron-ks-service-sqtwg 0/1 Completed 0 2h neutron-ks-user-tpmrb 0/1 Completed 0 2h neutron-l3-agent-default-5nbsp 1/1 Running 0 2h neutron-metadata-agent-default-9ml6v 1/1 Running 0 2h neutron-ovs-agent-default-mg8ln 1/1 Running 0 2h neutron-rabbit-init-sgnwm 0/1 Completed 0 2h neutron-server-9bdc765c9-bx6sf 1/1 Running 0 2h nova-api-metadata-78fb54c549-zcmxg 1/1 Running 2 2h nova-api-osapi-6c5c6dd4fc-7z5qq 1/1 Running 0 2h nova-bootstrap-hp6n4 0/1 Completed 0 2h nova-cell-setup-1549195200-v5bv8 0/1 Completed 0 2h nova-cell-setup-1549198800-6d8sm 0/1 Completed 0 1h nova-cell-setup-1549202400-c9vfz 0/1 Completed 0 29m nova-cell-setup-dfdzw 0/1 Completed 0 2h nova-compute-default-fmqtl 1/1 Running 0 2h nova-conductor-5b9956bffc-5ts7s 1/1 Running 0 2h nova-consoleauth-7f8dbb8865-lt5mr 1/1 Running 0 2h nova-db-init-hjp2p 0/3 Completed 0 2h nova-db-sync-zn6px 0/1 Completed 0 2h nova-ks-endpoints-ldzhz 0/3 Completed 0 2h nova-ks-service-c64tb 0/1 Completed 0 2h nova-ks-user-kjskm 0/1 Completed 0 2h nova-novncproxy-6f485d9f4c-6m2n5 1/1 Running 0 2h nova-placement-api-587c888875-6cmmb 1/1 Running 0 2h nova-rabbit-init-t275g 0/1 Completed 0 2h nova-scheduler-69886c6fdf-hcwm6 1/1 Running 0 2h nova-service-cleaner-1549195200-7jw2d 0/1 Completed 1 2h nova-service-cleaner-1549198800-pvckn 0/1 Completed 0 1h nova-service-cleaner-1549202400-kqpxz 0/1 Completed 0 29m openvswitch-db-nx579 1/1 Running 0 2h openvswitch-vswitchd-p4xj5 1/1 Running 0 2h placement-ks-endpoints-vt4pk 0/3 Completed 0 2h placement-ks-service-sw2b9 0/1 Completed 0 2h placement-ks-user-zv755 0/1 Completed 0 2h rabbitmq-rabbitmq-0 1/1 Running 0 4h swift-ks-user-ktptt 0/1 Completed 0 3h