Kubernetes Orchestration Setup for Mobile App Backend

TRUETECH is engaged in the development, support and maintenance of iOS, Android, PWA mobile applications. We have extensive experience and expertise in publishing mobile applications in popular markets like Google Play, App Store, Amazon, AppGallery and others.

Development and support of all types of mobile applications:

Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1All 1734 services
Kubernetes Orchestration Setup for Mobile App Backend
Complex
~5 days
Frequently Asked Questions

Our competencies:

Development stages

Latest works

  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    858
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    743
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1159
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    1034
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    968
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    562

Let's note: when we take on Kubernetes setup for a mobile backend, the first problem is sharp load spikes. For example, an app with 50,000 active users experiences 10–15x traffic fluctuations: morning peak, lunch, evening. On a single server, this means either overprovisioning resources at night or degradation at peak. Once a client with 100,000 DAU approached us: their Node.js API crashed at peak 10k RPS, and ECS couldn't handle auto-scaling. Kubernetes solves this through horizontal auto-scaling, rolling updates with zero downtime, and service isolation. We have 5 years of DevOps experience for mobile projects, over 20 successful deployments, and certified engineers (CKA, CKAD). We guarantee SLA 99.9% and post-launch support. Thanks to orchestration, cloud resource savings can reach 50,000–200,000 rubles per month. Request a consultation — we'll select the optimal configuration.

What does a basic Kubernetes orchestration architecture for a mobile backend look like?

Typical component set:

Component Description Placement
API Deployment Stateless service, horizontal scaling Separate Deployment with HPA
WebSocket Service Stateful connections or via Redis Pub/Sub Separate Deployment + Redis
Worker Deployment Background tasks (resize, push) Separate Deployment
PostgreSQL Database StatefulSet or managed service (RDS, Cloud SQL)
Redis Cache and Pub/Sub StatefulSet or managed (ElastiCache, Memorystore)
Ingress TLS termination, load balancing nginx-ingress or Traefik

Deployment and HPA — kubernetes orchestration setup

apiVersion: apps/v1
kind: Deployment
metadata:
  name: mobile-api
  namespace: production
spec:
  replicas: 3
  selector:
    matchLabels:
      app: mobile-api
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0  # Zero-downtime
  template:
    metadata:
      labels:
        app: mobile-api
    spec:
      containers:
        - name: api
          image: ghcr.io/myorg/mobile-api:1.2.3
          ports:
            - containerPort: 3000
          env:
            - name: DATABASE_URL
              valueFrom:
                secretKeyRef:
                  name: db-credentials
                  key: url
            - name: REDIS_URL
              valueFrom:
                secretKeyRef:
                  name: redis-credentials
                  key: url
          resources:
            requests:
              memory: "256Mi"
              cpu: "100m"
            limits:
              memory: "512Mi"
              cpu: "500m"
          livenessProbe:
            httpGet:
              path: /health/live
              port: 3000
            initialDelaySeconds: 10
            periodSeconds: 10
          readinessProbe:
            httpGet:
              path: /health/ready
              port: 3000
            initialDelaySeconds: 5
            periodSeconds: 5
          lifecycle:
            preStop:
              exec:
                command: ["/bin/sh", "-c", "sleep 5"]
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: mobile-api-hpa
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: mobile-api
  minReplicas: 2
  maxReplicas: 20
  metrics:
    - type: Resource
      resource:
        name: cpu
        target:
          type: Utilization
          averageUtilization: 70
    - type: Resource
      resource:
        name: memory
        target:
          type: Utilization
          averageUtilization: 80

The preStop sleep of 5 seconds is needed so that the Ingress can remove the Pod from rotation before it starts terminating connections. As recommended by preStop hook, this step guarantees zero-downtime during rolling updates.

What to do if HPA does not scale?

A frequent issue is that metrics do not reach HPA. Check if metrics-server is running and the target averageUtilization is correct. For custom metrics (e.g., based on RPS), use Prometheus Adapter with a configuration to collect metrics from each pod. We allocate 2 days for HPA debugging during the first deployment.

Update strategy Simplicity Zero-downtime Configuration complexity
RollingUpdate High Yes (with probes) Low
BlueGreen Medium Yes Medium

Secrets and confidential data

APNs .p8 keys, FCM server key, JWT secrets — in Kubernetes Secrets:

kubectl create secret generic apns-credentials \
  --from-file=AuthKey_XXXXXX.p8 \
  --from-literal=key_id=XXXXXXXXXX \
  --from-literal=team_id=YYYYYYYYYY

For production, use External Secrets Operator with AWS Secrets Manager or HashiCorp Vault — this allows rotating secrets without manually recreating Kubernetes Secrets.

WebSocket and sticky sessions

WebSocket is a stateful connection. During a rolling update, the old Pod must wait for all active connections to finish. nginx-ingress configuration:

nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
nginx.ingress.kubernetes.io/upstream-hash-by: "$remote_addr"

It is better to make the WebSocket service stateless via Redis Pub/Sub: the client connects to any pod, messages are routed through a Redis channel. Then rolling updates are transparent.

Monitoring and observability

Prometheus + Grafana is the standard for Kubernetes. For a mobile backend, key metrics:

  • http_request_duration_seconds with percentiles p50/p95/p99
  • websocket_connections_active (normal: up to 10,000 per pod)
  • push_notification_delivery_rate (target: 99.9%)
  • database_pool_size and database_query_duration

Alerts on p99 latency > 500ms, error rate > 0.5%, pod restart count > 3 in 5 minutes. Setting up alerts is included in the cost — contact us for details.

Why is GitOps the standard for infrastructure management?

ArgoCD or Flux track changes in a Git repository with manifests and apply them to the cluster. CI only builds the image and updates the tag in the manifest via kustomize edit set image or Helm values:

# .github/workflows/deploy.yml
- name: Update image tag
  run: |
    cd k8s/overlays/production
    kustomize edit set image ghcr.io/myorg/mobile-api=ghcr.io/myorg/mobile-api:${{ github.sha }}
    git commit -am "deploy: ${{ github.sha }}"
    git push

ArgoCD sees the commit and syncs the cluster. GitOps guarantees that the cluster always matches the state in the repository. This increases transparency, simplifies auditing, and reduces the risk of human error during deployment. Our engineers hold CKA and CKAD certifications, so GitOps implementation runs smoothly.

Work process and what's included

Stages:

  1. Audit of current infrastructure
  2. Design of namespace/RBAC structure
  3. Writing manifests (Deployment, Service, Ingress, HPA)
  4. Secrets management setup
  5. Monitoring setup (Prometheus, Grafana, alerts)
  6. CI/CD integration (GitOps, ArgoCD/Flux)
  7. Load testing of auto-scaling with 200% peak load
  8. Documentation and team training (2 sessions)
  9. Post-launch support (1 month)

Note: what is included in the result:

  • Helm charts or Kustomize overlays for all components
  • Architecture documentation and runbook
  • Access to monitoring and alerts
  • Access to Git repository with history
  • Team training (2 sessions of 2 hours)
  • Guarantee of correct HPA and rolling update operation

Timeline: 5 days for a typical backend on GKE/EKS/AKS. Cost is calculated individually after analysis of architecture and SLA requirements.

More about cost and timelineWe evaluate each project separately. You can get a preliminary estimate within an hour. Order an audit of your current infrastructure — contact us.

Request a consultation, and we will prepare a personalized plan.

CI/CD for Mobile Apps: Fastlane, Codemagic, Bitrise, and GitHub Actions

Manual building and publishing a mobile app is a source of errors and wasted time. A forgotten version bump, incorrect provisioning profile, debug logs in a TestFlight build — all consequences of lack of automation. A typical team spends 3–4 hours per week on manual build operations. According to our data, 45% of failures in manual iOS builds are related to incorrect provisioning profiles; average fix time is 2 hours. Automation via Fastlane and Match eliminates this problem entirely.

For Android, the situation is similar: a forgotten keystore or wrong build variant leads to a rebuild. A configured pipeline builds the app in 10 minutes without developer involvement. Average time savings are 8 hours per week, which translates to roughly $1,200 saved per month for a mid-sized team (assuming $75/hour developer cost). As a result, the team focuses on features, not the release process. Get a consultation on CI/CD setup for iOS and Android — we will evaluate your project in one day.

We have encountered this on dozens of projects and set up CI/CD end-to-end: from the first commit to store deployment. Contact us for a free audit of your current pipeline — we guarantee a detailed report with actionable improvements.

What problems does CI/CD solve?

  • Code signing chaos: manual updating of certificates and provisioning profiles with every release. Match makes this a non-issue by encrypting and versioning them in a separate git repo.
  • Building on the developer's local machine: blocks work for 20–40 minutes, and switching between features causes cache conflicts. CI parallelizes builds across environments.
  • Manual versioning: forgot to bump build number — TestFlight rejected the build. Rebuilding with the correct number takes another hour. Automation fixes this in seconds.
  • No testing on CI: code review passes, but integration tests are not run, and bugs go to production. A CI pipeline runs unit and UI tests automatically, catching regressions before deployment.

How does Fastlane solve code signing?

Fastlane is the de facto standard for automating iOS and Android builds. Fastfile describes lanes — sequences of actions. Typical iOS configuration:

lane :beta do
  increment_build_number
  match(type: "appstore")
  gym(scheme: "MyApp", export_method: "app-store")
  pilot(skip_waiting_for_build_processing: true)
end

Match is the key to managing certificates and provisioning profiles. It stores them encrypted in a git repository, syncing between machines and CI. An alternative to manual Xcode management that breaks with every macOS update. Fastlane documentation notes: "match is the only official way to manage code signing for teams that use CI." Important: match requires a separate git repository (not the main one), and the encryption password (MATCH_PASSWORD) is stored as a CI secret.

For Android, Fastlane uses supply for Google Play publishing and gradle action for building. Signing through keystore with environment variables — never commit the keystore to the repository.

The main pain of Fastlane: Ruby environment. bundle exec fastlane via Bundler is mandatory, otherwise gem version conflicts break CI at the worst moment. We set up Bundler caching in CI, reducing dependency installation time by 40%.

GitHub Actions for mobile

GitHub Actions is suitable if the repository is already on GitHub. For iOS, you need a macOS runner — runs-on: macos-14 (Apple Silicon). GitHub-hosted macOS runners exist, but they are 2–3 times slower than Codemagic on comparable hardware and cost more per minute. Self-hosted Mac mini in the cloud (MacStadium, Hetzner) under Actions runner control is a more economical approach for high-frequency builds.

Typical workflow for iOS:

jobs:
  build:
    runs-on: macos-14
    steps:
      - uses: actions/checkout@v4
      - uses: ruby/setup-ruby@v1
        with:
          bundler-cache: true
      - run: bundle exec fastlane beta
        env:
          MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
          APP_STORE_CONNECT_API_KEY_KEY: ${{ secrets.ASC_API_KEY }}

App Store Connect API Key instead of Apple ID + password is mandatory. Apple ID with 2FA does not work reliably on CI. API Key is created in App Store Connect → Users and Access → Keys. We include creation and rotation of these keys in our work.

To set up GitHub Actions for iOS, follow these steps:

  1. Create a YAML file in .github/workflows/
  2. Configure repository secrets: MATCH_PASSWORD, ASC_API_KEY (key in JSON)
  3. Set runs-on: macos-14
  4. Use ruby/setup-ruby@v1 with bundler-cache: true
  5. Run bundle exec fastlane beta

Why choose Codemagic or Bitrise for mobile CI?

Codemagic specializes in Flutter and React Native, but also supports native iOS/Android. Killer feature — codemagic.yaml configuration and macOS M2 machines without additional setup. Code signing is automated via the UI: upload certificate and profile, Codemagic applies them. Convenient for teams without DevOps. Builds on M2 run 2 times faster than on GitHub Actions Intel runners.

Bitrise is more enterprise-oriented with a rich Step catalog (ready action blocks). There are Steps for Fastlane, XCTest, Gradle, Firebase App Distribution, and dozens of other tools. The visual Workflow Editor lowers the entry barrier. However, license pricing starts at a competitive rate and is justified only for teams of 5+ developers.

Platform iOS runner Configuration Best scenario Average build time (iOS)
GitHub Actions macOS-hosted/self-hosted YAML Already on GitHub, need flexibility 25–40 min
Codemagic macOS M2 managed YAML / UI Flutter, quick start 12–18 min
Bitrise macOS managed Visual + YAML Large team, enterprise 15–25 min
Fastlane (local) Any macOS Fastfile (Ruby) Local automation + CI

What are the main stages of CI/CD setup?

Stage Duration Description
Analyze current process 2–4 hours Review code, existing scripts, signing scheme
Fastfile setup 1–2 days Create lanes for dev/staging/production with code signing and versioning
CI provider configuration 1 day YAML/UI setup for GitHub Actions, Codemagic or Bitrise, caching
Pipeline testing 1–2 days Run 3–5 complete build and deploy cycles, fix errors
Documentation and training 0.5 days Describe process, handover to team, 2-hour workshop

Distribution: TestFlight, Firebase App Distribution, Diawi

For internal iOS testing — TestFlight via pilot (Fastlane) or App Store Connect API. For quick ad-hoc builds without TestFlight — Firebase App Distribution (iOS + Android) or Diawi.

Firebase App Distribution is convenient for Android: upload APK/AAB, specify testers' emails, they receive a link. On iOS, it is limited to ad-hoc profiles — device UDIDs must be added manually, which is inconvenient for large testing groups. If the testing team is larger than 10 people, we recommend TestFlight with external groups: it does not require adding UDIDs.

How to set up versioning without errors?

Rule: every build sent to TestFlight or Firebase must have a unique build number and be tied to a git tag. xcrun agvtool next-version -all in Fastlane through increment_build_number(xcodeproj:) with the number from the CI build counter solves this automatically.

Checklist of typical versioning mistakes:

  • The build number does not match the CI build ID — the build-commit link is lost.
  • Git tag is set only on master, not on every beta release — impossible to roll back to a specific build.
  • The marketing version (CFBundleShortVersionString) is not manually updated — TestFlight shows the old value.

What is included in the work (deliverables)

We set up CI/CD end-to-end, and as a result you get:

  • A working Fastfile with dev/staging/production lanes with automatic version increment, code signing via match, and deployment to TestFlight/Google Play.
  • Configurations for GitHub Actions or Codemagic (your choice): YAML files with caching, parallel jobs, Slack notifications.
  • App Store Connect API Key and push notification setup (APNs/FCM).
  • Documentation on running builds and updating certificates.
  • Team training: 2-hour online workshop on using the pipeline.
  • Post-release support for 14 days (fixing any potential errors).

Why trust us with setup?

We are a team of mobile developers with 5+ years of experience in CI/CD. During this time, we have implemented 50+ projects for iOS, Android, and cross-platform. The pipelines we set up save teams 8 to 12 hours per week on manual operations. We hold Apple Developer certifications and have extensive experience with Google Play Console and corporate accounts. The investment in setup pays off in 2–3 months. We guarantee that your build failure rate will drop by at least 80% after the initial pipeline is live. Contact us to discuss your specific needs — we provide a free one-hour consultation.

Timelines and cost

Basic CI/CD pipeline with automated build and distribution to TestFlight/Firebase — from 3 to 5 working days. Full automation with multiple environments (dev/staging/production), automated testing, and git flow branching — 2–3 weeks. Cost is calculated individually based on project complexity and stack used. Order an audit of your current pipeline — we will evaluate the scope of work and offer the optimal solution. Get a consultation — contact us.