Skip to content

Commit caffd2e

Browse files
authored
feat: Added support for adding boot/block volume and in-transit encryption for Operator (#472)
* feat: updated the operator version and added support for adding boot/block volume encryption and in-transit encryption in operator Signed-off-by: Nikhil Kota <srinivasa.nikhil.kota@oracle.com>
1 parent 2fec7c7 commit caffd2e

File tree

8 files changed

+64
-8
lines changed

8 files changed

+64
-8
lines changed

docs/configuration.adoc

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,16 +250,30 @@ The Kubernetes Metrics Server parameter controls the installation of {uri-metric
250250

251251
The KMS integration parameters control whether {uri-oci-kms}[OCI Key Management Service] will be used for encrypting Kubernetes secrets and boot volumes/block volumes. Additionally, the bastion and operator hosts must be enabled as well as instance_principal on the operator.
252252

253+
Bastion Variables
254+
253255
----
254256
create_bastion_host = true
255-
create_operator = true
256-
enable_operator_instance_principal = true
257+
----
258+
259+
OKE Variables:-
260+
261+
----
257262
use_encryption = true
258263
kms_key_id = <kms_key_id>
259264
enable_pv_encryption_in_transit = false
260265
node_pool_volume_kms_key_id = <node_pool_volume_kms_key_id>
261266
----
262267

268+
Operator Variables
269+
270+
----
271+
create_operator = true
272+
enable_operator_instance_principal = true
273+
enable_operator_pv_encryption_in_transit = false
274+
operator_volume_kms_id = <operator_volume_kms_id>
275+
----
276+
263277
OKE also supports enforcing the use of signed images. You can enforce the use of signed image using the following parameters:
264278

265279
----

docs/instructions.adoc

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,24 +64,37 @@ This section assumes you have completed the following:
6464

6565
=== KMS Integration
6666

67+
==== OKE Variables
68+
6769
If you wish to use {uri-oci-kms}[OCI KMS] to encrypt Kubernetes secrets, the following is required:
6870

6971
* the Terraform user must have the following rights
7072
** {uri-oci-manage-dynamic-groups}[manage dynamic groups]
7173
** {uri-oci-manage-policies}[manage policies in root tenancy]
7274
* link:#adding-the-bastion-host[bastion must be enabled]
7375
* link:#enabling-instance_principal-on-the-operator-host[operator instance_principal must be enabled]
74-
* use_encryption must be set to _true_
75-
* kms_key_id must be provided
76+
77+
use_encryption must be set to _true_
78+
kms_key_id must be provided
7679

7780
If you wish to use {uri-oci-kms}[OCI KMS] to encrypt OKE nodepool boot/block volume, the following is required:
7881

7982
* node_pool_volume_kms_key_id must be provided
8083

81-
If you wish to encrypt data in transit between the instance, the boot volume, and the block volumes.
84+
If you wish to encrypt data in transit between the instance, the boot volume, and the block volumes in OKE node pool.
8285

8386
* enable_pv_encryption_in_transit must be _true_
8487

88+
==== Operator Variables
89+
90+
If you wish to use {uri-oci-kms}[OCI KMS] to encrypt operator boot/block volume, the following is required:
91+
92+
* operator_volume_kms_id must be provided
93+
94+
If you wish to encrypt data in transit between the instance, the boot volume, and the block volumes in operator.
95+
96+
* enable_operator_pv_encryption_in_transit must be _true_
97+
8598
=== Creating the OKE Cluster
8699

87100
Initialize a working directory containing Terraform configuration files:

docs/terraformoptions.adoc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,11 @@ EOT
376376
|true/false
377377
|true
378378

379+
|`enable_operator_pv_encryption_in_transit`
380+
|Whether to encrypt data in transit between the instance, the boot volume, and the block volumes in Operator.
381+
|true/false
382+
|false
383+
379384
|operator_image_id
380385
|Custom image id for the operator host
381386
|image_id or Oracle. If the value is set to Oracle, an Oracle Platform image will be used instead.
@@ -407,6 +412,11 @@ EOT
407412
| RUNNING/STOPPED
408413
| RUNNING
409414

415+
|`operator_volume_kms_id`
416+
|The id of the OCI KMS key to be used as the master encryption key for Operator's boot volume/block volume encryption..
417+
|`ocid1.key.oc1....`
418+
|
419+
410420
|`operator_timezone`
411421
|The preferred timezone for the operator host. {uri-timezones}[List of timezones]. *Required*
412422
|e.g. Australia/Sydney

main.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ module "bastion" {
8585

8686
module "operator" {
8787
source = "oracle-terraform-modules/operator/oci"
88-
version = "3.0.2"
88+
version = "3.0.3"
8989

9090
tenancy_id = var.tenancy_id
9191

@@ -104,13 +104,15 @@ module "operator" {
104104
# operator host parameters
105105
operator_image_id = var.operator_image_id
106106
enable_operator_instance_principal = var.enable_operator_instance_principal
107+
enable_pv_encryption_in_transit = var.enable_operator_pv_encryption_in_transit
107108
operator_os_version = var.operator_os_version
108109
operator_shape = var.operator_shape
109110
operator_state = var.operator_state
110111
operator_timezone = var.operator_timezone
111112
ssh_public_key = var.ssh_public_key
112113
ssh_public_key_path = var.ssh_public_key_path
113114
upgrade_operator = var.upgrade_operator
115+
boot_volume_encryption_key = var.operator_volume_kms_id
114116

115117
# operator notification
116118
enable_operator_notification = var.enable_operator_notification

modules/oke/iam.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,4 @@ resource "oci_identity_policy" "oke_volume_kms" {
4141
description = "Policies for block volumes to access kms key"
4242
name = var.label_prefix == "none" ? "oke-volume-kms" : "${var.label_prefix}-oke-volume-kms"
4343
statements = local.oke_volume_kms_policy_statements
44-
count = var.node_pool_volume_kms_key_id == "" ? 0 : 1
4544
}

modules/oke/locals.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ locals {
1818
policy_statement = (var.use_encryption == true) ? "Allow dynamic-group ${oci_identity_dynamic_group.oke_kms_cluster[0].name} to use keys in compartment id ${var.compartment_id} where target.key.id = '${var.kms_key_id}'" : ""
1919

2020
# policy to allow block volumes inside oke to use kms
21-
oke_volume_kms_policy_statements = [
21+
oke_volume_kms_policy_statements = (var.node_pool_volume_kms_key_id == "") ? []: [
2222
"Allow service oke to use key-delegates in compartment id ${var.compartment_id} where target.key.id = '${var.node_pool_volume_kms_key_id}'",
2323
"Allow service blockstorage to use keys in compartment id ${var.compartment_id} where target.key.id = '${var.node_pool_volume_kms_key_id}'"
2424
]

terraform.tfvars.example

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,12 @@ operator_state = "RUNNING"
104104
operator_timezone = "Australia/Sydney"
105105
upgrade_operator = false
106106

107+
# Operator in-transit encryption for the data volume's paravirtualized attachment.
108+
enable_operator_pv_encryption_in_transit = false
109+
110+
# operator volume kms integration
111+
operator_volume_kms_id = ""
112+
107113
## operator notification
108114
enable_operator_notification = false
109115
operator_notification_endpoint = ""

variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,18 @@ variable "operator_image_id" {
296296
type = string
297297
}
298298

299+
variable "operator_volume_kms_id" {
300+
default = ""
301+
description = "The OCID of the OCI KMS key to assign as the master encryption key for the boot volume."
302+
type = string
303+
}
304+
305+
variable "enable_operator_pv_encryption_in_transit" {
306+
default = false
307+
description = "Whether to enable in-transit encryption for the data volume's paravirtualized attachment."
308+
type = bool
309+
}
310+
299311
variable "enable_operator_instance_principal" {
300312
default = true
301313
description = "Whether to enable the operator to call OCI API services without requiring api key."

0 commit comments

Comments
 (0)