Skip to content

docs: API docs for encryptionAtRest #657

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions api/v1alpha1/clusterconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ type GenericClusterConfigSpec struct {
Users []User `json:"users,omitempty"`

// +optional
Encryption *Encryption `json:"encryption,omitempty"`
EncryptionAtRest *EncryptionAtRest `json:"encryptionAtRest,omitempty"`
}

type Image struct {
Expand Down Expand Up @@ -282,14 +282,15 @@ type User struct {
Sudo string `json:"sudo,omitempty"`
}

// Encryption defines the configuration to enable encryption at REST
// EncryptionAtRest defines the configuration to enable encryption at REST
// This configuration is used by API server to encrypt data before storing it in ETCD.
// Currently the encryption only enabled for secrets and configmaps.
type Encryption struct {
type EncryptionAtRest struct {
// Encryption providers
// +kubebuilder:default={aescbc:{}}
// +kubebuilder:default={{aescbc:{}}}
// +kubebuilder:validation:MaxItems=1
// +kubebuilder:validation:Optional
Providers *EncryptionProviders `json:"providers"`
Providers []EncryptionProviders `json:"providers"`
}

type EncryptionProviders struct {
Expand Down
21 changes: 12 additions & 9 deletions api/v1alpha1/crds/caren.nutanix.com_awsclusterconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -322,22 +322,25 @@ spec:
type: string
type: object
type: object
encryption:
encryptionAtRest:
description: |-
Encryption defines the configuration to enable encryption at REST
EncryptionAtRest defines the configuration to enable encryption at REST
This configuration is used by API server to encrypt data before storing it in ETCD.
Currently the encryption only enabled for secrets and configmaps.
properties:
providers:
default:
aescbc: {}
- aescbc: {}
description: Encryption providers
properties:
aescbc:
type: object
secretbox:
type: object
type: object
items:
properties:
aescbc:
type: object
secretbox:
type: object
type: object
maxItems: 1
type: array
type: object
etcd:
properties:
Expand Down
21 changes: 12 additions & 9 deletions api/v1alpha1/crds/caren.nutanix.com_dockerclusterconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -239,22 +239,25 @@ spec:
type: object
docker:
type: object
encryption:
encryptionAtRest:
description: |-
Encryption defines the configuration to enable encryption at REST
EncryptionAtRest defines the configuration to enable encryption at REST
This configuration is used by API server to encrypt data before storing it in ETCD.
Currently the encryption only enabled for secrets and configmaps.
properties:
providers:
default:
aescbc: {}
- aescbc: {}
description: Encryption providers
properties:
aescbc:
type: object
secretbox:
type: object
type: object
items:
properties:
aescbc:
type: object
secretbox:
type: object
type: object
maxItems: 1
type: array
type: object
etcd:
properties:
Expand Down
21 changes: 12 additions & 9 deletions api/v1alpha1/crds/caren.nutanix.com_genericclusterconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -233,22 +233,25 @@ spec:
- provider
type: object
type: object
encryption:
encryptionAtRest:
description: |-
Encryption defines the configuration to enable encryption at REST
EncryptionAtRest defines the configuration to enable encryption at REST
This configuration is used by API server to encrypt data before storing it in ETCD.
Currently the encryption only enabled for secrets and configmaps.
properties:
providers:
default:
aescbc: {}
- aescbc: {}
description: Encryption providers
properties:
aescbc:
type: object
secretbox:
type: object
type: object
items:
properties:
aescbc:
type: object
secretbox:
type: object
type: object
maxItems: 1
type: array
type: object
etcd:
properties:
Expand Down
21 changes: 12 additions & 9 deletions api/v1alpha1/crds/caren.nutanix.com_nutanixclusterconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -410,22 +410,25 @@ spec:
- machineDetails
type: object
type: object
encryption:
encryptionAtRest:
description: |-
Encryption defines the configuration to enable encryption at REST
EncryptionAtRest defines the configuration to enable encryption at REST
This configuration is used by API server to encrypt data before storing it in ETCD.
Currently the encryption only enabled for secrets and configmaps.
properties:
providers:
default:
aescbc: {}
- aescbc: {}
description: Encryption providers
properties:
aescbc:
type: object
secretbox:
type: object
type: object
items:
properties:
aescbc:
type: object
secretbox:
type: object
type: object
maxItems: 1
type: array
type: object
etcd:
properties:
Expand Down
20 changes: 11 additions & 9 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 55 additions & 0 deletions docs/content/customization/generic/encryption.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
+++
title = "Encryption At REST"
+++

`encryptionAtRest` variable enables encrypting kubernetes resources at REST using provided encryption provider.
When this variable is set, kuberntetes secrets and configmaps are encrypted before writing them at `etcd`.

If the `encryptionAtRest` property is not specified, then
the customization will be skipped. The secrets and configmaps will not be stored as encrypted in `etcd`.

We support following encryption providers
- aescbc
- secretbox

More information about encryption at REST: https://kubernetes.io/docs/tasks/administer-cluster/encrypt-data/

## Example

To encrypt configmaps and secrets for using `aescbc` and `secretbox` encryption providers:

```yaml
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
name: <NAME>
spec:
topology:
variables:
- name: clusterConfig
value:
encryptionAtRest:
providers:
- aescbc: {}
- secretbox: {}
```

Applying this configuration will result in `<CLUSTER_NAME>-encryption-config` secret generated and following value being set:

- `KubeadmControlPlaneTemplate`:

- ```yaml
spec:
kubeadmConfigSpec:
clusterConfiguration:
apiServer:
extraArgs:
encryption-provider-config: /etc/kubernetes/pki/encryptionconfig.yaml
files:
- contentFrom:
secret:
key: config
name: my-cluster-encryption-config
path: /etc/kubernetes/pki/encryptionconfig.yaml
permissions: "0640"
```
3 changes: 3 additions & 0 deletions examples/capi-quick-start/aws-cluster-calico-crs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ spec:
baseOS: ${AMI_LOOKUP_BASEOS}
format: ${AMI_LOOKUP_FORMAT}
org: "${AMI_LOOKUP_ORG}"
encryptionAtRest:
providers:
- aescbc: {}
- name: workerConfig
value:
aws:
Expand Down
3 changes: 3 additions & 0 deletions examples/capi-quick-start/aws-cluster-calico-helm-addon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ spec:
baseOS: ${AMI_LOOKUP_BASEOS}
format: ${AMI_LOOKUP_FORMAT}
org: "${AMI_LOOKUP_ORG}"
encryptionAtRest:
providers:
- aescbc: {}
- name: workerConfig
value:
aws:
Expand Down
3 changes: 3 additions & 0 deletions examples/capi-quick-start/aws-cluster-cilium-crs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ spec:
baseOS: ${AMI_LOOKUP_BASEOS}
format: ${AMI_LOOKUP_FORMAT}
org: "${AMI_LOOKUP_ORG}"
encryptionAtRest:
providers:
- aescbc: {}
- name: workerConfig
value:
aws:
Expand Down
3 changes: 3 additions & 0 deletions examples/capi-quick-start/aws-cluster-cilium-helm-addon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ spec:
baseOS: ${AMI_LOOKUP_BASEOS}
format: ${AMI_LOOKUP_FORMAT}
org: "${AMI_LOOKUP_ORG}"
encryptionAtRest:
providers:
- aescbc: {}
- name: workerConfig
value:
aws:
Expand Down
3 changes: 3 additions & 0 deletions examples/capi-quick-start/docker-cluster-calico-crs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ spec:
strategy: ClusterResourceSet
nfd:
strategy: ClusterResourceSet
encryptionAtRest:
providers:
- aescbc: {}
- name: workerConfig
value: {}
version: ${KUBERNETES_VERSION}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ spec:
strategy: HelmAddon
nfd:
strategy: HelmAddon
encryptionAtRest:
providers:
- aescbc: {}
- name: workerConfig
value: {}
version: ${KUBERNETES_VERSION}
Expand Down
3 changes: 3 additions & 0 deletions examples/capi-quick-start/docker-cluster-cilium-crs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ spec:
strategy: ClusterResourceSet
nfd:
strategy: ClusterResourceSet
encryptionAtRest:
providers:
- aescbc: {}
- name: workerConfig
value: {}
version: ${KUBERNETES_VERSION}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ spec:
strategy: HelmAddon
nfd:
strategy: HelmAddon
encryptionAtRest:
providers:
- aescbc: {}
- name: workerConfig
value: {}
version: ${KUBERNETES_VERSION}
Expand Down
3 changes: 3 additions & 0 deletions examples/capi-quick-start/nutanix-cluster-calico-crs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ spec:
systemDiskSize: 40Gi
vcpuSockets: 2
vcpusPerSocket: 1
encryptionAtRest:
providers:
- aescbc: {}
imageRegistries:
- credentials:
secretRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ spec:
systemDiskSize: 40Gi
vcpuSockets: 2
vcpusPerSocket: 1
encryptionAtRest:
providers:
- aescbc: {}
imageRegistries:
- credentials:
secretRef:
Expand Down
3 changes: 3 additions & 0 deletions examples/capi-quick-start/nutanix-cluster-cilium-crs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ spec:
systemDiskSize: 40Gi
vcpuSockets: 2
vcpusPerSocket: 1
encryptionAtRest:
providers:
- aescbc: {}
imageRegistries:
- credentials:
secretRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ spec:
systemDiskSize: 40Gi
vcpuSockets: 2
vcpusPerSocket: 1
encryptionAtRest:
providers:
- aescbc: {}
imageRegistries:
- credentials:
secretRef:
Expand Down
3 changes: 3 additions & 0 deletions hack/examples/bases/aws/cluster/kustomization.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ patches:
- target:
kind: Cluster
path: ../../../patches/aws/config-var.yaml
- target:
kind: Cluster
path: ../../../patches/encryption.yaml

# Delete the clusterclass-specific resources.
- target:
Expand Down
Loading
Loading