В связи с особенностями физического расположения мощностей ВМ в зоне RU* ,использование AKS не представляется возможным либо требует больших временных ,финансовых и прочих трудозатрат.
Для выполнения задачи была развернута Виртуальная Машина на облачной платформе cloud.ru.
- vCPU: 2
- RAM: 4GB
- HDD: 30GB
- Кластер Kubernetes с развернутым Nginx Ingress Controller
- Домен третьего уровня для тестового задания: turbonoda.rf.gd
- Установлен Cert-Manager для ротации сертификатов внутри Kubernetes кластера
- Используется Certbot для автоматизации получения и обновления сертификатов
- CRON для ежедневного запуска ротации сертификатов
В директории /opt/ssl_free/ расположены четыре ClusterIssuer:
- buypass-prod.yaml
- letsencrypt-prod.yaml
- sslforfree-prod.yaml
- zerossl-prod.yaml
Cert-Manager автоматически запрашивает и устанавливает SSL/TLS сертификаты для Ingress ресурсов от соответствующих поставщиков, указанных в ClusterIssuer. Certbot, встроенный в Cert-Manager, автоматически управляет процессом ротации сертификатов.
Скрипт для ротации сертификатов расположен в директории /usr/local/bin/rotate_certs.sh и выполняет следующие действия:
- Определяет список поставщиков сертификатов, включая Let's Encrypt, ZeroSSL, SSL For Free и Buypass.
- Задает домен для получения сертификата (turbonoda.rf.gd) и директорию для хранения сертификатов /opt/cert/live/.
- Выбирает случайного поставщика из списка и использует его для запроса сертификата с помощью Certbot.
- Запускает Certbot с заданными параметрами, такими как email-адрес, URL выбранного поставщика и имя домена.
- После получения сертификата скрипт выполняет перезагрузку Nginx для применения нового сертификата к серверу.
Из-за географического расположения ВМ, работа скрипта неполноценна и большинство провайдеров сертификатов не работают с зоной RU ,либо требуют регистрации не из зоны RU ,но данное исполнение задания позволяет понять логику работы по выпуску и ротации сертификатов.
Хостер infinityfree не поддерживает ни А запись ,ни ААА запись в бесплатном варианте ,также изменение dns и настройка на мой сервер с nginx не предоставляется возможным в бесплатной версии.
Due to the constraints of the physical location of the VM resources in the RU* zone, using AKS proves impractical or requires significant time, financial, and other resource investments. Consequently, a Virtual Machine was deployed on the cloud platform cloud.ru to fulfill the task.
- vCPU: 2
- RAM: 4GB
- HDD: 30GB
- Kubernetes Cluster with Nginx Ingress Controller deployed
- Third-level domain for the test task: turbonoda.rf.gd
- Cert-Manager installed for certificate rotation within the Kubernetes cluster
- Certbot used for automated certificate issuance and renewal
- CRON job scheduled for daily certificate rotation
In the directory /opt/ssl_free/, four ClusterIssuers are located:
- buypass-prod.yaml
- letsencrypt-prod.yaml
- sslforfree-prod.yaml
- zerossl-prod.yaml
Cert-Manager automatically requests and installs SSL/TLS certificates for Ingress resources from the specified providers indicated in ClusterIssuers. The integrated Certbot in Cert-Manager manages the certificate rotation process automatically.
The script for certificate rotation is located in the directory /usr/local/bin/rotate_certs.sh and performs the following actions:
- Identifies the certificate providers including Let's Encrypt, ZeroSSL, SSL For Free, and Buypass.
- Specifies the domain for certificate issuance (turbonoda.rf.gd) and the directory to store certificates (/opt/cert/live/).
- Randomly selects a provider from the list and utilizes Certbot for certificate issuance.
- Initiates Certbot with specified parameters such as email address, provider's URL, and domain name.
- Upon certificate issuance, the script reloads Nginx to apply the new certificate to the server.
The script runs daily at 2:00 AM via crontab. To manually execute the script, run the command /usr/local/bin/rotate_certs.sh.
Due to the VM's geographic location limitations, script operation is suboptimal as most certificate providers do not function in the RU zone or require registration from outside RU, yet this implementation provides insights into the certificate issuance and rotation process logic.