1
0
mirror of https://github.com/minio/docs.git synced 2025-05-28 00:41:14 +03:00
docs/source/includes/k8s/common-minio-kes.rst
Ravind Kumar 94d1faa9c1
Port-Forwarding cleanups (#722)
As per https://github.com/minio/console/issues/2539 , the websocket
behavior integrated as part of Console 0.22.1
(https://github.com/minio/console/pull/2419) seems to break
port-forwarding behavior.

There's no easy fix for this. NodePorts are a workaround, but slightly
kludgy. Ingress is the better long-term solution, but requires more
work.

This is a stopgap:

- For Operator, point users towards NodePorts if port-forwarding fails
- For Tenant Console, simply drop port-forwarding entirely and point
only at Ingress/LB

Out of scope but in progress is Ingress guidance for Nginx and Traefik
so we can close the loop on this.
2023-02-07 11:17:24 -05:00

5.0 KiB

This procedure assumes an existing Hashicorp Vault installation accessible from the Kubernetes cluster.

  • For Vault deployments within the same Kubernetes cluster as the MinIO Tenant, you can use Kubernetes service names to allow the MinIO Tenant to establish connectivity to the Vault service.
  • For Vault deployments external to the Kubernetes cluster, you must ensure the cluster supports routing communications between Kubernetes services and pods and the external network. This may require configuration or deployment of additional Kubernetes network components and/or enabling access to the public internet.

Defer to the Vault Documentation for guidance on deployment and configuration.

You can use either the MinIO Tenant Console or the MinIO mc CLI to enable bucket-default SSE-KMS with the generated key:

MinIO Tenant Console

Connect to the MinIO Tenant Console service <create-tenant-connect-tenant> and log in. For clients internal to the Kubernetes cluster, you can specify the service DNS name <concepts/services-networking/dns-pod-service/#a-aaaa-records>. For clients external to the Kubernetes cluster, specify the hostname of the service exposed by Ingress, Load Balancer, or similar Kubernetes network control component.

Once logged in, create a new Bucket and name it to your preference. Select the Gear gear icon to open the management view.

Select the pencil pencil icon next to the Encryption field to open the modal for configuring a bucket default SSE scheme.

Select SSE-KMS, then enter the name of the key created in the previous step.

Once you save your changes, try to upload a file to the bucket. When viewing that file in the object browser, note that in the sidebar the metadata includes the SSE encryption scheme and information on the key used to encrypt that object. This indicates the successful encrypted state of the object.

MinIO CLI

Use the MinIO API Service <create-tenant-connect-tenant> to create a new alias <alias> for the MinIO deployment. You can then use the mc encrypt set command to enable SSE-KMS encryption for a bucket:

mc alias set k8s https://minio.minio-tenant-1.svc.cluster-domain.example:443 ROOTUSER ROOTPASSWORD

mc mb k8s/encryptedbucket
mc encrypt set SSE-KMS encrypted-bucket-key k8s/encryptedbucket

For clients external to the Kubernetes cluster, specify the hostname of the service exposed by Ingress, Load Balancer, or similar Kubernetes network control component.

Write a file to the bucket using mc cp or any S3-compatible SDK with a PutObject function. You can then run mc stat on the file to confirm the associated encryption metadata.

Unseal Vault Before Creating Key

You must unseal the backing Vault instance before creating new encryption keys. See the Vault documentation on Seal/Unseal for more information.

MinIO requires that the for a given bucket or object exist on the root KMS before performing operations using that key. You can use the mc admin kms key create command against the MinIO Tenant.

You must ensure your local host can access the MinIO Tenant pods and services before using mc to manage the Tenant. For hosts internal to the Kubernetes cluster, you can use the service DNS name <concepts/services-networking/dns-pod-service/#a-aaaa-records>. For hosts external to the Kubernetes cluster, specify the hostname of the service exposed by Ingress, Load Balancer, or similar Kubernetes network control component.

Run this command in a separate Terminal or Shell:

# Replace '-n minio' with the namespace of the MinIO deployment
# If you deployed the Tenant without TLS you may need to change the port range

# You can validate the ports in use by running
#  kubectl get svc/minio -n minio

kubectl port forward svc/minio 443:443 -n minio

The following commands in a new Terminal or Shell window:

  • Connect a local mc client to the Tenant.
  • Create the encryption key.

See mc-install for instructions on installing mc on your local host.

# Replace USERNAME and PASSWORD with a user on the tenant with administrative permissions
# such as the root user

mc alias add k8s https://localhost:443 ROOTUSER ROOTPASSWORD

# Replace my-new-key with the name of the key you want to use for SSE-KMS
mc admin kms key create k8s encrypted-bucket-key