-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DCCLIP-913: Restore OpenSearch from snapshot (#384)
* DCCLIP-912: Mention in docs that OpenSearch is only supported from Confluence 8.9.0. * DCCLIP-913: Restore OpenSearch from snapshot if EBS volume snapshot id is provided. * DCCLIP-913: Added variable for OpenSearch persistence volume size. * DCCLIP-913: Added docs. * DCCLIP-913: Made OpenSearch password configurable.
- Loading branch information
Showing
13 changed files
with
207 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
data "aws_ebs_snapshot" "opensearch_snapshot" { | ||
count = var.opensearch_enabled && var.opensearch_snapshot_id != null ? 1 : 0 | ||
|
||
snapshot_ids = [var.opensearch_snapshot_id] | ||
most_recent = true | ||
} | ||
|
||
resource "aws_ebs_volume" "opensearch" { | ||
count = var.opensearch_enabled && var.opensearch_snapshot_id != null ? 1 : 0 | ||
|
||
availability_zone = var.eks.availability_zone | ||
snapshot_id = var.opensearch_snapshot_id | ||
size = data.aws_ebs_snapshot.opensearch_snapshot[0].volume_size | ||
type = local.opensearch_storage_class | ||
tags = { | ||
Name = "confluence-opensearch" | ||
} | ||
} | ||
|
||
resource "kubernetes_persistent_volume" "opensearch" { | ||
count = var.opensearch_enabled && var.opensearch_snapshot_id != null ? 1 : 0 | ||
|
||
metadata { | ||
name = "confluence-opensearch-pv" | ||
} | ||
spec { | ||
access_modes = ["ReadWriteOnce"] | ||
capacity = { | ||
storage = data.aws_ebs_snapshot.opensearch_snapshot[0].volume_size | ||
} | ||
storage_class_name = local.opensearch_storage_class | ||
persistent_volume_source { | ||
aws_elastic_block_store { | ||
volume_id = aws_ebs_volume.opensearch[0].id | ||
} | ||
} | ||
claim_ref { | ||
name = "opensearch-cluster-master-opensearch-cluster-master-0" | ||
namespace = var.namespace | ||
} | ||
} | ||
} | ||
|
||
resource "kubernetes_persistent_volume_claim" "opensearch" { | ||
count = var.opensearch_enabled && var.opensearch_snapshot_id != null ? 1 : 0 | ||
|
||
metadata { | ||
name = "opensearch-cluster-master-opensearch-cluster-master-0" | ||
namespace = var.namespace | ||
} | ||
spec { | ||
access_modes = ["ReadWriteOnce"] | ||
resources { | ||
requests = { | ||
storage = data.aws_ebs_snapshot.opensearch_snapshot[0].volume_size | ||
} | ||
} | ||
storage_class_name = local.opensearch_storage_class | ||
volume_name = kubernetes_persistent_volume.opensearch[0].metadata.0.name | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,9 @@ terraform { | |
helm = { | ||
version = "~> 2.4" | ||
} | ||
random = { | ||
source = "hashicorp/random" | ||
version = "3.6.1" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,9 @@ terraform { | |
helm = { | ||
version = "~> 2.4" | ||
} | ||
random = { | ||
source = "hashicorp/random" | ||
version = "3.6.1" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,4 +28,8 @@ provider "helm" { | |
command = "aws" | ||
} | ||
} | ||
} | ||
|
||
provider "random" { | ||
# Configuration options | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters