Deploying a Site on Selectel: Terraform, Kubernetes, CI/CD

Deploying a Site on Selectel: Terraform, Kubernetes, CI/CD

Development and maintenance of all types of websites:

Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Our competencies:

Frequently Asked Questions

Latest works

  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1281
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1237
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    977
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    1027
  • image_website-sbh_0.webp
    Website development for SBH Partners
    1103
  • image_website-_0.webp
    Website development for Red Pear
    550

Deploying a Site on Selectel: Terraform, Kubernetes, CI/CD

You've deployed a site on Selectel, but a week later it goes down due to incorrect security group configuration? Or deployment takes an hour, and rollback is a full operation? We solve these problems with automated deployment using Terraform, Kubernetes, and GitHub Actions. Rollouts take minutes, infrastructure is reliable, and it complies with 152-FZ. Once a project went down due to incorrect Object Storage configuration — images didn't load, LCP rose to 5 seconds. We rewrote the deployment with Terraform, set up CDN, and LCP dropped to 0.8 seconds. This is just one example of how automation saves business.

Our team has 5+ years of experience with Selectel infrastructure and has set up deployment for 30+ projects, from landing pages to high-load SaaS platforms. Here's how we do it.

Problems We Solve

When deploying on Selectel, we frequently encounter typical errors:

  • N+1 queries when working with Object Storage — incorrect CDN configuration leads to delays. We fix this through content preloading and proper Cache-Control headers.
  • Hydration mismatch in React/Next.js when using SSR — due to different server and client response times. We solve it by configuring synchronization via Edge Functions.
  • Data leaks due to incorrect security group configuration. We always use minimal privileges: only 80/443 and SSH from whitelisted IPs.

Each problem is accompanied by a concrete solution we've refined on dozens of projects.

How to Organize Deployment for 152-FZ Compliance

Selectel provides certified infrastructure. We configure:

  • Encryption at rest via OpenStack Barbican.
  • Access logging to Object Storage via S3 Access Logs.
  • Regular database backups to a separate project.

This ensures compliance without extra costs.

Why Selectel Is More Profitable Than Foreign Clouds

Selectel is 2–3 times cheaper than AWS/Azure for Russian projects when considering latency and compliance. For example, using Managed Kubernetes on Selectel reduces administration costs by 40% compared to manual deployment. Plus, data stays in Russia, which is critical for 152-FZ.

How to Set Up Deployment on Selectel from Scratch

We use a proven stack: Terraform 1.7 for infrastructure description, Ansible for configuration, GitHub Actions for CI/CD. One project — an online store on Laravel 11: we terraformed the project, set up Object Storage for media files, and Managed Kubernetes for the frontend. Deployment takes 3 minutes, rollback is 1 command.

# Creating a server via CLI pip install python-openstackclient export OS_AUTH_URL=https://cloud.api.selcloud.ru/identity/v3 export OS_PROJECT_ID=your_project_id export OS_USERNAME=your_username export OS_PASSWORD=your_password export OS_REGION_NAME=ru-1 openstack server create \ --flavor 1014 \ --image "Ubuntu 22.04 LTS 64-bit" \ --key-name my-key \ --security-group web-sg \ myapp-prod 
# Terraform for Selectel terraform { required_providers { selectel = { source = "selectel/selectel" version = "~> 5.0" } openstack = { source = "terraform-provider-openstack/openstack" version = "~> 1.53" } } } provider "selectel" { token = var.selectel_token } resource "selectel_vpc_project_v2" "myapp" { name = "myapp-project" theme = { color = "#4CAF50" } } resource "openstack_compute_instance_v2" "app" { name = "myapp-prod" flavor_name = "1014" image_name = "Ubuntu 22.04 LTS 64-bit" key_pair = openstack_compute_keypair_v2.mykey.name security_groups = ["web-sg", "ssh-sg"] region = "ru-1" network { name = "public" } user_data = file("cloud-init.yaml") } 
# Selectel Object Storage (Swift/S3) aws configure aws --endpoint-url https://s3.selcdn.ru s3 mb s3://myapp-assets aws --endpoint-url https://s3.selcdn.ru \ s3 sync ./dist/assets s3://myapp-assets \ --acl public-read \ --cache-control "public, max-age=31536000, immutable" 
# Managed Kubernetes (MKS) selectel mks kubeconfig --cluster-id CLUSTER_ID > kubeconfig.yaml export KUBECONFIG=./kubeconfig.yaml kubectl apply -f k8s/ kubectl get pods -n myapp 
# GitHub Actions for Selectel VPS jobs: deploy: steps: - name: Deploy uses: appleboy/ssh-action@v1 with: host: ${{ secrets.SELECTEL_SERVER_IP }} username: deploy key: ${{ secrets.SSH_KEY }} script: | cd /var/www/myapp git pull origin main composer install --no-dev --optimize-autoloader npm ci && npm run build php artisan migrate --force php artisan optimize sudo systemctl reload php8.3-fpm nginx 

Typical Deployment Mistakes and Their Prevention

  • Ignoring security groups — leaving SSH open to all IPs. We only use whitelists.
  • Incorrect CORS configuration for S3 — static files don't load on the frontend. We explicitly specify allowed origins.
  • Lack of monitoring — finding out about downtime from clients. We set up alerts via SendGrid or Telegram.

These mistakes are easy to avoid if you follow our practices.

Process

  1. Analysis — determine requirements for load, budget, compliance.
  2. Design — draw architecture: VPS vs Kubernetes, S3 vs DB, CDN.
  3. Infrastructure — deploy project, networks, security groups with Terraform code.
  4. Implementation — configure application, CI/CD, monitoring (Prometheus + Grafana).
  5. Testing — load testing, Core Web Vitals check.
  6. Deployment — canary rollout with automatic rollback on errors.

What's Included in Deployment Setup

  • Architecture design for your tasks.
  • Writing Terraform configurations for the entire infrastructure.
  • Setting up CI/CD (GitHub Actions or GitLab CI) with automatic deployment and rollback.
  • Configuring Object Storage and CDN for static files.
  • Integrating monitoring (Prometheus + Grafana) with alerts.
  • Documentation on deployment and training for your team.
  • Technical support after launch.

Comparison: VPS vs Managed Kubernetes

Parameter VPS Managed Kubernetes (MKS)
Deployment time 1–2 days 3–4 days
Scaling Manual (vertical) Automatic (horizontal)
Cost Low Medium, with admin savings
Suitable for Small projects High-load and microservices

Deployment Component Timelines

Deployment Component Timeline
VPS + Nginx + deploy 1–2 days
Object Storage + CDN 1 day
Managed Kubernetes 3–4 days
CI/CD (GitHub Actions) 1–2 days

The cost is calculated individually per project. Request a custom deployment cost estimate — we'll select the optimal architecture. Get a consultation — we'll assess your project in one business day. Contact us to set up a deployment that won't let you down.