Create OpenSearch with GitHub Actions ΒΆ
Prerequisites ΒΆ
- You're part of a Nais team
- Your repository is authorized for your Nais team in Console
Create the manifest ΒΆ
Create .nais/opensearch.yaml:
version: v1
type: OpenSearch
name: myopensearch
spec:
http:
maxContentLength: 100Mi
indices:
queryBoolMaxClauseCount: 1024
memory: 4GB
shardIndexingPressure:
enabled: true
storageGB: 80
tier: SingleNode
version: "3.3"Change the name and configuration for your needs. See the complete generated example and OpenSearch manifest reference.
Set spec.version to a supported version listed in the manifest reference. To upgrade, check the OpenSearch breaking changes, update spec.version, and apply the manifest again. Downgrades are not supported.
Create the workflow ΒΆ
Create .github/workflows/deploy-opensearch.yaml:
name: Deploy OpenSearch
on:
push:
branches:
- main
paths:
- .nais/opensearch.yaml
workflow_dispatch:
permissions:
contents: read
id-token: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up the Nais CLI
uses: nais/setup@v1
- name: Apply OpenSearch manifest
run: nais apply .nais/opensearch.yaml --team <MY-TEAM> --environment <MY-ENV>Replace <MY-TEAM> with your Nais team and <MY-ENV> with a GCP environment available to your tenant, such as dev-gcp or prod-gcp for NAV.
The example uses major action tags for readability. Pin actions to full commit SHAs in production, and use Dependabot to keep them updated. See GitHub's secure use reference .
Commit and push both files to main. The push trigger runs when the manifest changes. If you only change the workflow, run it manually from the Actions tab in GitHub.
A manual run applies the manifest from the selected Git ref, regardless of the paths filter.