docker stop $(docker ps -qa) && docker rm $(docker ps -qa) && docker rmi -f $(docker images -qa) && docker volume rm $(docker volume ls -q) && docker network rm $(docker network ls -q)For this particular setup we will need 3 machines to act as kubernetes (k3s) masters and one machine to act as a datastore
The datastore will be a mysql (mariadb) server although you can choose different options
The operating system chosen for this task is Debian 11 (theoretically the setup can be performed on any linux machine)
Setup etcdctl using the instructions at https://github.com/etcd-io/etcd/releases/tag/v3.4.13 (changed path to /usr/local/bin):
Note: if you want to match th etcdctl binaries with the embedded k3s etcd version, please run the curl command for getting the version first and adjust ETCD_VER below accordingly:
curl -L --cacert /var/lib/rancher/k3s/server/tls/etcd/server-ca.crt --cert /var/lib/rancher/k3s/server/tls/etcd/server-client.crt --key /var/lib/rancher/k3s/server/tls/etcd/server-client.key https://127.0.0.1:2379/version
Angie (Энджи) — эффективный, мощный и масштабируемый веб-сервер, реализованный как форк nginx:
- Создан бывшими разработчиками исходного проекта, чтобы двигаться в новом направлении, и может служить заменой предшественнику без переработки конфигурации и модулей.
- Включает все возможности nginx 1.27.4 и добавляет к ним целый ряд новых функций.
На основе официальной документации: https://angie.software/angie/docs/installation/
| <?php | |
| define('_JEXEC', 1); | |
| // Connect with Joomla | |
| define('JPATH_BASE', __DIR__); | |
| require_once JPATH_BASE . '/includes/defines.php'; | |
| require_once JPATH_BASE . '/includes/framework.php'; | |
| // Database connection | |
| $db = JFactory::getDBO(); |
| # Add Repository to your system (ondrej/php PPA) | |
| sudo apt install apt-transport-https lsb-release ca-certificates | |
| sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg | |
| sudo sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list' | |
| sudo apt update | |
| # Install PHP 7.1 | |
| sudo apt install php7.1 |
| wget -O phpstan.phar https://github.com/phpstan/phpstan/raw/HEAD/phpstan.phar | |
| chmod a+x phpstan.phar | |
| sudo mv phpstan.phar /usr/local/bin/phpstan | |
| phpstan |
The NGINX Unit control API includes a /status endpoint for usage statistics. This is a solution for exposing these metrics in Prometheus format.
The application (run by Unit) queries the /status URI on the control socket and converts the JSON response into Prometheus text format. PHP and Python implementations are available.
These instructions assume an existing Unit installation with a working configuration. We will add a new listener on the default prometheus port (9090) and route it directly to the Prometheus app.
Step 0. Install the preferred Unit language module (unit-php or unit-python)
| apiVersion: v1 | |
| kind: ServiceAccount | |
| metadata: | |
| name: admin-user | |
| namespace: kube-system | |
| --- | |
| apiVersion: rbac.authorization.k8s.io/v1beta1 | |
| kind: ClusterRoleBinding | |
| metadata: | |
| name: admin-user |