Задать вопрос
  • Какие есть программы для самостоятельного учёта рабочего времени?

    @historydev
    Василий Банников, а есть софт который непосредственно активность в каждой программе мониторит? (в идеале даже вкладки браузера по отдельности)
  • Как выгрузить в git сразу много файлов?

    @historydev
    RuRoman,

    Да, изменения лучше на отдельной ветке делать, чтобы потом мержить с коммитом и иметь возможность откатить изменения.

    В выводе git status вы должны увидеть список изменённых файлов.
  • Как на js сделать мобильное приложение?

    @historydev
    поставил андроид студию, добавил webview по любой инструкции и делай что тебе нужно.
  • Как пропустить клиентский заголовок в приложение с nginx прокси?

    @historydev Автор вопроса
    Lynn «Кофеман», как мне на стороне nginx понять что заголовок доходит? Заголовок Content-Type:

    upstream php {
            server unix:/run/php/php7.4-fpm.sock;
    }
    
    server {
    	server_name dev.ru *.dev.ru;
    	access_log /var/log/nginx/dev-access.log;
    	error_log /var/log/nginx/dev-error.log;
    	client_max_body_size 5000m;
    	client_header_buffer_size 5m;
    	large_client_header_buffers 16 5m;
    	error_page 502 /502.html;
    
    #	add_header 'Access-Control-Allow-Origin' '*';
    
    
    	location /socket.io/ {
    		proxy_pass http://127.0.0.1:3001;
    		proxy_http_version 1.1;
    		proxy_set_header Upgrade                $http_upgrade;
    		proxy_set_header Connection             "upgrade";
    		proxy_send_timeout                      86400;
    		proxy_read_timeout                      86400;
    		proxy_set_header Host                   $host;
    		proxy_set_header X-Forwarded-For        $proxy_add_x_forwarded_for;
    		proxy_set_header X-Real-IP              $remote_addr;
    		# New
    		proxy_connect_timeout 15s;
    		proxy_buffers 512 256M;
    		proxy_buffer_size 256M;
    	}
    
    	location /video/ {
    		rewrite /video/(.*) /$1  break;
    		proxy_pass                              http://127.0.0.1:3001;
    		proxy_pass_header                       Server;
    		proxy_set_header Host                   $host;
    		proxy_set_header X-Forwarded-For        $proxy_add_x_forwarded_for;
    		proxy_set_header X-Real-IP              $remote_addr;
    		client_max_body_size 5000m;
    		#add_header Access-Control-Allow-Origin *;
    	}
    
    	# calls-service
    	location /c-api/ {
                    rewrite /c-api/(.*) /$1  break;
                    proxy_pass                              http://127.0.0.1:3005;
                    proxy_pass_header                       Server;
                    proxy_set_header Host                   $host;
                    proxy_set_header X-Forwarded-For        $proxy_add_x_forwarded_for;
                    proxy_set_header X-Real-IP              $remote_addr;
                    client_max_body_size 5000m;
            }
    
    	location /pay/ {
    		rewrite /pay/(.*) /$1  break;
    		proxy_pass                              http://127.0.0.1:3000;
    		proxy_pass_header                       Server;
    		proxy_set_header Host                   $host;
    		proxy_set_header X-Forwarded-For        $proxy_add_x_forwarded_for;
    		proxy_set_header X-Real-IP              $remote_addr;
    		client_max_body_size 5000m;
    	}
            location /pay-moneta/ {
                    rewrite /pay-moneta/(.*) /$1  break;
                    proxy_pass                              http://127.0.0.1:4000/;
                    proxy_pass_header                       Server;
                    proxy_set_header Host                   $host;
                    proxy_set_header X-Forwarded-For        $proxy_add_x_forwarded_for;
                    proxy_set_header X-Real-IP              $remote_addr;
                    client_max_body_size 5000m;
            }
    
    	# viddev static
    	location /chat/(*\.(js|css|jpg)) {
    		try_files $uri =404;
    		rewrite /chat/(.*) /chat/$1  break;
    	}
    
            location /chats/ {
    		#add_header      Content-Type application/json;
    		proxy_pass	http://0.0.0.0:4444/;
    		#proxy_pass_request_headers      on;
    	}
    
    
    	location / {
    		try_files $uri $uri/ @rewrite;
    		index index.php index.html;
    		add_header Access-Control-Allow-Origin *;
    	}
    	location @rewrite {
    		rewrite ^/(.*)$ /index.php?q=$1;
    	}
    	location @proxy {
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
            proxy_set_header Host $host;
    
            proxy_pass https://.ru;
            proxy_redirect off;
        }
    	location ~ \.php$ {
    		try_files $uri =404;
    		fastcgi_split_path_info ^(.+\.php)(.*)$;
    		fastcgi_pass  unix:/var/run/php/php7.4-fpm.sock;
    		fastcgi_index  index.php;
    		fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
    		include fastcgi_params;
    		fastcgi_ignore_client_abort on;
    		fastcgi_param  SERVER_NAME $http_host;
    		client_max_body_size 5000m;
    		fastcgi_buffers 16 16k;
    		fastcgi_buffer_size 32k;
    	}
    
    	location = /500.html {
            root /usr/share/nginx/html/;
        }
    
    	set $need_redirect "0";
    	if ($host ~* ^www\.(.*)$) {
    		set $need_redirect "1";
    	}
    	if ($request_uri ~* "well-known") {
    		set $need_redirect "0";
    	}
    	if ( $need_redirect ~ "1") {
    		return 301 https://$server_name$request_uri;
    	}
    }
    
    #server {
    #    listen *:80;
    #    return 301 https://$server_name$request_uri;  # enforce https
    #    server_name .ru;
    #}
  • Как пропустить клиентский заголовок в приложение с nginx прокси?

    @historydev Автор вопроса
    С клиента заголовок передаётся, postman:
    650d94c2c6dfa129454017.png
  • Как пропустить клиентский заголовок в приложение с nginx прокси?

    @historydev Автор вопроса
    Я написал про set header, add header это понятно, не передаёт у меня, если сделать так, то моя мидлварина не жалуется:
    proxy_set_header Content-type application/json;
  • Как подключиться к второму роутеру?

    @historydev
    второму роутеру по идее должен быть назначен адрес и подсети первого, в клиентах tp-link его нет?
  • Как исправить ошибку kubeadm init?

    @historydev Автор вопроса
    chupasaurus, попробую сейчас, вот ошибки:
    [kubelet-check] It seems like the kubelet isn't running or healthy.
    [kubelet-check] The HTTP call equal to 'curl -sSL http://localhost:10248/healthz' failed with error: Get "http://localhost:10248/healthz": dial tcp 127.0.0.1:10248: connect: connection refused.
    [kubelet-check] It seems like the kubelet isn't running or healthy.
    [kubelet-check] The HTTP call equal to 'curl -sSL http://localhost:10248/healthz' failed with error: Get "http://localhost:10248/healthz": dial tcp 127.0.0.1:10248: connect: connection refused.
    
    Unfortunately, an error has occurred:
            timed out waiting for the condition
    
    This error is likely caused by:
            - The kubelet is not running
            - The kubelet is unhealthy due to a misconfiguration of the node in some way (required cgroups disabled)
    
    If you are on a systemd-powered system, you can try to troubleshoot the error with the following commands:
            - 'systemctl status kubelet'
            - 'journalctl -xeu kubelet'
    
    Additionally, a control plane component may have crashed or exited when started by the container runtime.
    To troubleshoot, list all containers using your preferred container runtimes CLI.
    Here is one example how you may list all running Kubernetes containers by using crictl:
            - 'crictl --runtime-endpoint unix:///var/run/containerd/containerd.sock ps -a | grep kube | grep -v pause'
            Once you have found the failing container, you can inspect its logs with:
            - 'crictl --runtime-endpoint unix:///var/run/containerd/containerd.sock logs CONTAINERID'
    error execution phase wait-control-plane: couldn't initialize a Kubernetes cluster
    To see the stack trace of this error execute with --v=5 or higher
    root@kuber:/home/kuber-user# systemctl status kubelet
    ● kubelet.service - kubelet: The Kubernetes Node Agent
         Loaded: loaded (/lib/systemd/system/kubelet.service; enabled; vendor preset: enabled)
        Drop-In: /usr/lib/systemd/system/kubelet.service.d
                 └─10-kubeadm.conf
         Active: activating (auto-restart) (Result: exit-code) since Fri 2023-09-08 10:04:11 UTC; 40ms ago
           Docs: https://kubernetes.io/docs/
        Process: 3426 ExecStart=/usr/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_CONFIG_ARGS $KUBELET_KUBEADM_ARGS $KUBELET_EXTRA_ARGS (code=exited, status=1/FAILURE)
       Main PID: 3426 (code=exited, status=1/FAILURE)
            CPU: 37ms
    root@kuber:/home/kuber-user# crictl --runtime-endpoint unix:///var/run/containerd/containerd.sock ps -a | grep kube | grep -v pause
    root@kuber:/home/kuber-user# journalctl -xeu kubelet
    ░░ Defined-By: systemd
    ░░ Support: http://www.ubuntu.com/support
    ░░ 
    ░░ A stop job for unit kubelet.service has finished.
    ░░ 
    ░░ The job identifier is 7806 and the job result is done.
    Sep 08 10:04:31 kuber systemd[1]: Started kubelet: The Kubernetes Node Agent.
    ░░ Subject: A start job for unit kubelet.service has finished successfully
    ░░ Defined-By: systemd
    ░░ Support: http://www.ubuntu.com/support
    ░░ 
    ░░ A start job for unit kubelet.service has finished successfully.
    ░░ 
    ░░ The job identifier is 7806.
    Sep 08 10:04:31 kuber kubelet[3454]: Flag --container-runtime-endpoint has been deprecated, This parameter should be set via the config file specified by the Kubelet's --config flag. See https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/ for more information.
    Sep 08 10:04:31 kuber kubelet[3454]: Flag --pod-infra-container-image has been deprecated, will be removed in a future release. Image garbage collector will get sandbox image information from CRI.
    Sep 08 10:04:31 kuber kubelet[3454]: I0908 10:04:31.645758    3454 server.go:203] "--pod-infra-container-image will not be pruned by the image garbage collector in kubelet and should also be set in the remote runtime"
    Sep 08 10:04:31 kuber kubelet[3454]: I0908 10:04:31.647568    3454 server.go:467] "Kubelet version" kubeletVersion="v1.28.1"
    Sep 08 10:04:31 kuber kubelet[3454]: I0908 10:04:31.647579    3454 server.go:469] "Golang settings" GOGC="" GOMAXPROCS="" GOTRACEBACK=""
    Sep 08 10:04:31 kuber kubelet[3454]: I0908 10:04:31.647663    3454 server.go:895] "Client rotation is on, will bootstrap in background"
    Sep 08 10:04:31 kuber kubelet[3454]: I0908 10:04:31.648466    3454 certificate_store.go:130] Loading cert/key pair from "/var/lib/kubelet/pki/kubelet-client-current.pem".
    Sep 08 10:04:31 kuber kubelet[3454]: I0908 10:04:31.649490    3454 dynamic_cafile_content.go:157] "Starting controller" name="client-ca-bundle::/etc/kubernetes/pki/ca.crt"
    Sep 08 10:04:31 kuber kubelet[3454]: I0908 10:04:31.652595    3454 server.go:725] "--cgroups-per-qos enabled, but --cgroup-root was not specified.  defaulting to /"
    Sep 08 10:04:31 kuber kubelet[3454]: E0908 10:04:31.652724    3454 run.go:74] "command failed" err="failed to run Kubelet: running with swap on is not supported, please disable swap! or set --fail-swap-on flag to false. /proc/swaps contained: [Filename\t\t\t\tType\t\tSize\t\tUsed\t\tPriority /swap.img     >
    Sep 08 10:04:31 kuber systemd[1]: kubelet.service: Main process exited, code=exited, status=1/FAILURE
    ░░ Subject: Unit process exited
    ░░ Defined-By: systemd
    ░░ Support: http://www.ubuntu.com/support
    ░░ 
    ░░ An ExecStart= process belonging to unit kubelet.service has exited.
    ░░ 
    ░░ The process' exit code is 'exited' and its exit status is 1.
    Sep 08 10:04:31 kuber systemd[1]: kubelet.service: Failed with result 'exit-code'.
    ░░ Subject: Unit failed
    ░░ Defined-By: systemd
    ░░ Support: http://www.ubuntu.com/support
    ░░ 
    ░░ The unit kubelet.service has entered the 'failed' state with result 'exit-code'.
    lines 3493-3530/3530 (END)
    ^C
    root@kuber:/home/kuber-user#


    И в добавок, я заметил устаревшую версию и начал гуглить: https://github.com/cri-o/cri-o/issues/6985
  • Как исправить ошибку kubeadm init?

    @historydev Автор вопроса
    chupasaurus,
    unknown command "preflight" for "kubeadm init"
  • Как исправить ошибку "TypeError: Cannot read properties of undefined (reading 'ws')"?

    @historydev
    Aetae, он просто сделал код)) Что-же так агрессивно то)
  • Как исправить ошибку kubeadm init?

    @historydev Автор вопроса
    chupasaurus,
    root@kuber:/home/kuber-user# apt list containernetworking-plugins
    Listing... Done
    containernetworking-plugins/jammy 0.9.1+ds1-1 amd64
  • Как исправить ошибку kubeadm init?

    @historydev Автор вопроса
    chupasaurus,

    Мне весь лог тостер не даёт скинуть, слишком много символов, я могу залить в файл и загрузить на файлообменник какой, если вам это поможет понять в чём проблема может быть.
  • Как исправить ошибку kubeadm init?

    @historydev Автор вопроса
    chupasaurus,

    Откатился к бэкапу, поставил всё заново, кроме cri-docker, переустановил containerd, т.к. ошибка была таже, вот по этой инструкции, ошибка аналогична той, что с cri-docker.

    Я не понимаю почему не заводится, дело в виртуалке или в чём может быть причина?

    [kubelet-check] It seems like the kubelet isn't running or healthy.
    [kubelet-check] The HTTP call equal to 'curl -sSL http://localhost:10248/healthz' failed with error: Get "http://localhost:10248/healthz": dial tcp 127.0.0.1:10248: connect: connection refused.
    [kubelet-check] It seems like the kubelet isn't running or healthy.
    [kubelet-check] The HTTP call equal to 'curl -sSL http://localhost:10248/healthz' failed with error: Get "http://localhost:10248/healthz": dial tcp 127.0.0.1:10248: connect: connection refused.
  • Как исправить ошибку kubeadm init?

    @historydev Автор вопроса
    chupasaurus, правильно ли я понимаю, я не могу установить докер и юзать его вместе с кубером в случае выбора containerd?
  • Как исправить ошибку kubeadm init?

    @historydev Автор вопроса
    chupasaurus,
    По этой причине необходимо установить дополнительную службу cri-dockerd


    Что я упускаю в слове "необходимо"?
  • Как исправить ошибку kubeadm init?

    @historydev Автор вопроса
    chupasaurus, Серьёзное заявление, особенно если брать в учёт факт того, что они рекомендуют cri-docker в связке с docker-engine.

    Я конечно попробовал, но выдаёт ошибку, возможно из-за того что я установил cri-docker.

    Попробую на чистой машине повторить сегодня.
  • Как исправить ошибку kubeadm init?

    @historydev Автор вопроса
    Alexey Dmitriev,

    Для изучения производственного k8s мне нужно купить ангар серверов?

    Полу-решения меня не устраивают. - я уже ставил minikube