Nais Docs

Type to search the documentation

↑↓ to navigate Enter to select Esc to close
  • Home
  • Explanations
    • What is Nais?
    • What is a team?
    • Under the hood
  • Tutorials
    • Hello Nais
  • Workloads
    • πŸ’‘ Explanations
      • The runtime environment
      • Good practices
      • Image repository
      • Migrating to GCP
      • The workload image
      • Zero Trust
    • 🎯 How-To
      • Set up access policies
      • Communicate with other workloads
      • Reduce costs
      • Debugging workloads
      • Disable read-only file system
      • Overriding user and group that runs container process
      • Troubleshooting
      • Upload third-party image to image repository
    • πŸ“š Reference
      • Access policy reference
      • Container security
      • Default workload variables
      • Environments
      • Validation and autocompletion in editors
      • Webproxy
    • Application
      • πŸ’‘ Explanations
        • Exposing your application
      • 🎯 How-To
        • Create application
        • Delete your application
        • Expose an application
        • Redirect a client
      • πŸ“š Reference
        • Nais Application example YAML
        • Nais Application reference
        • Automatic Scaling
        • Ingress reference
    • Nais job
      • 🎯 How-To
        • Create job
        • Delete your job
      • πŸ“š Reference
        • Nais Job example YAML
        • Nais Job reference
  • Build and deploy
    • 🎯 How-To
      • Build and deploy with GitHub Actions
      • Dependabot with auto-merge
      • Templating
      • Using the image outside of Nais
    • πŸ“š Reference
      • Deploy action configuration
  • Auth
    • πŸ’‘ Explanations
    • 🎯 How-To
      • Log in users
    • πŸ“š Reference
    • Entra ID
      • πŸ’‘ Explanations
      • 🎯 How-To
        • Consume internal API as an application
        • Consume internal API on behalf of an employee
        • Generate a token from Entra ID for development
        • Log in an employee
        • Secure your API with Entra ID
      • πŸ“š Reference
    • ID-porten
      • 🎯 How-To
        • Log in a citizen
      • πŸ“š Reference
    • Maskinporten
      • 🎯 How-To
        • Consume external API using Maskinporten
        • Secure your API with Maskinporten
        • Expose FSS apps with KrakenD
      • πŸ“š Reference
    • TokenX
      • 🎯 How-To
        • Consume internal API on behalf of a citizen
        • Generate a token from TokenX for development
        • Secure your API with TokenX
      • πŸ“š Reference
  • Observability
    • 🎯 How-To
      • Get started with auto-instrumentation
    • πŸ“š Reference
      • OpenTelemetry Auto-Instrumentation Configuration
      • Observability Glossary
    • Frontend
      • 🎯 How-To
        • Set up Faro
        • Set up Faro with Next.js
        • Sourcemap deobfuscation
        • Frontend-to-backend trace propagation
      • πŸ“š Reference
        • Auto-configuration reference
        • Frontend observability troubleshooting
    • Tracing
      • 🎯 How-To
        • Avoid false errors from expected 4xx responses
        • Trace context propagation
        • Correlate traces and logs
        • Get started with Grafana Tempo
      • πŸ“š Reference
        • Span Metrics
        • OpenTelemetry Trace Semantic Conventions
        • TraceQL Reference
    • Alerting
      • 🎯 How-To
        • Create alert in Grafana
        • Customize Prometheus alerts
        • Create alert with Prometheus
      • πŸ“š Reference
        • Prometheus Alerting Rule Reference
    • Logging
      • 🎯 How-To
        • Audit logs
        • Disable persistent application logs
        • View logs from the command line
        • Adding logs to your Grafana dashboard
        • Metrics and alerts for logs
        • Get started with Grafana Loki
        • Create alerts in nav-logs (OpenSearch Dashboards)
        • Get started with nav-logs
        • Get started with Team Logs
      • πŸ“š Reference
        • Log Destinations
        • DQL Reference
        • LogQL Reference
        • Loki Labels Reference
        • Loki Metrics Reference
    • Metrics
      • 🎯 How-To
        • Create a dashboard in Grafana
        • Expose metrics from your application
        • Show Grafana on infoscreen
        • Push metrics to Prometheus
      • πŸ“š Reference
        • Global Metrics
        • Grafana Glossary
        • Metrics reference
        • OpenTelemetry Metrics
        • PromQL Reference
    • Tutorials
      • Getting Started with Observability in Nais
      • Adding Custom Spans and Metrics with OpenTelemetry
  • Persistence
    • πŸ’‘ Explanations
      • Responsibilities
    • BigQuery
      • 🎯 How-To
        • Using BigQuery from your application
        • Create an instance of BigQuery
    • CloudSQL
      • πŸ’‘ Explanations
        • Cloud SQL credentials
        • Cloud SQL Instance
        • Cloud SQL Proxy
        • Cloud SQL System Users and Roles
        • Grants and privileges
        • Migrate to new instance
      • 🎯 How-To
        • Additional users
        • Certification sync issues
        • Change the tier of your database instance
        • Connect to a cloned database
        • Postgres database metrics
        • Debugging
        • Deleting the database
        • Enable audit logging
        • Failing to assign private IP to an existing Cloud SQL instance
        • Migrate to new instance
        • Migrating databases to GCP
        • Workaround for password synchronization issues
        • Personal database access
        • Reset database credentials
        • Upgrade major version
      • πŸ“š Reference
    • Buckets
      • 🎯 How-To
        • Create a bucket
        • Deleting a bucket
      • πŸ“š Reference
    • Kafka
      • πŸ’‘ Explanations
        • Working with Kafka Offsets
        • Tiered storage
      • 🎯 How-To
        • Accessing topics from an application
        • Create a Kafka topic
        • Delete Kafka topic and data
        • Using Kafka Streams with internal topics
        • Manage access
        • Remove access to topics from an application
        • Avro and schema
        • Get temporary Kafka credentials
        • How to turn on Tiered Storage for your Kafka topic
        • Troubleshooting
      • πŸ“š Reference
        • Environment variables for Kafka
        • Nais Topic example YAML
        • Nais Topic reference
        • Kafka metrics
        • Kafka Pools
    • OpenSearch
      • 🎯 How-To
        • Create OpenSearch
        • Use OpenSearch in your workload
        • Delete OpenSearch
        • Create an OpenSearch instance (legacy)
        • Get access to the dashboard
        • Migrate OpenSearch management to Nais Console
        • Get temporary OpenSearch credentials
        • Upgrade major version
      • πŸ“š Reference
    • PostgreSQL
      • πŸ’‘ Explanations
        • Postgres cluster
      • 🎯 How-To
        • Connect from laptop
        • Postgres database metrics
        • Debugging
        • Deleting the database
        • Upgrade major version
      • πŸ“š Reference
        • Nais Postgres example YAML
        • Nais Postgres reference
    • Valkey
      • 🎯 How-To
        • Create Valkey
        • Use Valkey in your workload
        • Delete Valkey
        • Create a Valkey instance explicitly (legacy)
        • Migrate Valkey management to Nais Console
      • πŸ“š Reference
  • Other services
    • CDN
      • 🎯 How-To
        • Upload assets to the CDN
        • Manage CDN assets
      • πŸ“š Reference
        • CDN Upload Action
    • Config
      • 🎯 How-To
        • Create and manage configs in Console
        • Use a config in your workload
      • πŸ“š Reference
    • Secrets
      • 🎯 How-To
        • Create and manage secrets in Console
        • Use a secret in your workload
        • Advanced: Secrets with binary data
      • πŸ“š Reference
    • Vulnerabilities
      • 🎯 How-To
        • Generate SBOM
      • πŸ“š Reference
    • Feature Toggling
    • Anti-Virus Scanning
    • Leader Election
      • 🎯 How-To
        • Enable Leader Election
  • Operate
    • 🎯 How-To
      • Setup command line access
      • Create a Nais team
    • Console
    • CLI
    • naisdevice
      • πŸ’‘ Explanations
        • Just In Time Access (JITA)
      • 🎯 How-To
        • Install naisdevice
        • Troubleshooting naisdevice
        • Uninstall naisdevice
        • Update naisdevice
  • Tags
  • Legal
    • Application privacy impact assessments (PVK)
    • Application risk assessments (ROS)
    • Arkivloven
    • Vendor Data Processor Agreements
      • Aiven Data Processor Agreement
      • Azure Data Processor Agreement
      • GCP Data Processor Agreement
    • Nais kontinuitetsplan
    • Platform privacy impact assessments (PVK)
    • Platform risk assessments (ROS)
    • Responsibilities - Nais and teams
All tags

leader-election

2 pages
  • Enable Leader Election

    This guide will show you how to enable leader election for your application. πŸ‘· Help Wanted! Please contribute with examples on how to use the Server Sent Events API.

  • Leader Election

    With leader election it is possible to have one responsible pod. This can be used to control that only one pod runs a batch-job or similar tasks. This is done by asking the elector container which…