Skip to content

operator‐2038

Allan Roger Reid edited this page Apr 26, 2024 · 1 revision

Deploy an operator and tenant using the current branch

(see example script to build against a specific branch of minio operator - https://github.com/allanrogerr/public/blob/main/minio/supporting-scripts/kes-k8s-operator-tenant-master.sh)

Patch tenant serviceMetadata

kubectl patch tenant -n tenant-kms-encrypted myminio --type='merge' -p '{"spec":{"serviceMetadata": {"minioServiceLabels": {"label": "minio-svc-label-0"},"minioServiceAnnotations": {"v2.min.io": "minio-svc-annotation-0"},"consoleServiceLabels": {"label": "console-svc-label-0"},"consoleServiceAnnotations": {"label": "console-svc-annotation-0"}}}}'

Observe tenant serviceMetadata

kubectl -n tenant-kms-encrypted get tenant myminio -o json | jq .spec.serviceMetadata
{
  "consoleServiceAnnotations": {
    "label": "console-svc-annotation-0"
  },
  "consoleServiceLabels": {
    "label": "console-svc-label-0"
  },
  "minioServiceAnnotations": {
    "v2.min.io": "minio-svc-annotation-0"
  },
  "minioServiceLabels": {
    "label": "minio-svc-label-0"
  }
}

Observe current states of console and minio services. They should match the previous output.

kubectl -n tenant-kms-encrypted get svc myminio-console -o json | jq '.metadata | "\(.annotations) \(.labels)"' -r | jq
kubectl -n tenant-kms-encrypted get svc minio -o json | jq '.metadata | "\(.annotations) \(.labels)"' -r | jq
{
  "label": "console-svc-annotation-0"
}
{
  "label": "console-svc-label-0",
  "v1.min.io/console": "myminio-console"
}
{
  "v2.min.io": "minio-svc-annotation-0"
}
{
  "label": "minio-svc-label-0",
  "v1.min.io/tenant": "myminio"
}

Ensure tenant is accessible

mc admin info kes-demo --insecure
●  myminio-pool-0-0.myminio-hl.tenant-kms-encrypted.svc.cluster.local:9000
   Uptime: 9 minutes 
   Version: 2024-03-15T01:07:19Z
   Network: 4/4 OK 
   Drives: 4/4 OK 
   Pool: 1

●  myminio-pool-0-1.myminio-hl.tenant-kms-encrypted.svc.cluster.local:9000
   Uptime: 9 minutes 
   Version: 2024-03-15T01:07:19Z
   Network: 4/4 OK 
   Drives: 4/4 OK 
   Pool: 1

●  myminio-pool-0-2.myminio-hl.tenant-kms-encrypted.svc.cluster.local:9000
   Uptime: 9 minutes 
   Version: 2024-03-15T01:07:19Z
   Network: 4/4 OK 
   Drives: 4/4 OK 
   Pool: 1

●  myminio-pool-0-3.myminio-hl.tenant-kms-encrypted.svc.cluster.local:9000
   Uptime: 9 minutes 
   Version: 2024-03-15T01:07:19Z
   Network: 4/4 OK 
   Drives: 4/4 OK 
   Pool: 1

Pools:
   1st, Erasure sets: 1, Drives per erasure set: 16

16 drives online, 0 drives offline

https://operator-2038.minio.training:30045 image

Remove annotations and labels for console and minio services

kubectl -n tenant-kms-encrypted  patch tenant myminio --type='json' -p='[{"op": "replace", "path": "/spec/serviceMetadata/consoleServiceAnnotations", "value": {}}]'
kubectl -n tenant-kms-encrypted  patch tenant myminio --type='json' -p='[{"op": "replace", "path": "/spec/serviceMetadata/consoleServiceLabels", "value": {}}]'

kubectl -n tenant-kms-encrypted  patch tenant myminio --type='json' -p='[{"op": "replace", "path": "/spec/serviceMetadata/minioServiceAnnotations", "value": {}}]'
kubectl -n tenant-kms-encrypted  patch tenant myminio --type='json' -p='[{"op": "replace", "path": "/spec/serviceMetadata/minioServiceLabels", "value": {}}]'

Observe tenant serviceMetadata

kubectl -n tenant-kms-encrypted get tenant myminio -o json | jq .spec.serviceMetadata
{
  "consoleServiceAnnotations": {},
  "consoleServiceLabels": {},
  "minioServiceAnnotations": {},
  "minioServiceLabels": {}
}

Observe current states of console and minio services

kubectl -n tenant-kms-encrypted get svc myminio-console -o json | jq '.metadata | "\(.annotations) \(.labels)"' -r | jq
kubectl -n tenant-kms-encrypted get svc minio -o json | jq '.metadata | "\(.annotations) \(.labels)"' -r | jq
null
{
  "v1.min.io/console": "myminio-console"
}
null
{
  "v1.min.io/tenant": "myminio"
}

Ensure tenant is accessible

mc admin info kes-demo --insecure
●  myminio-pool-0-0.myminio-hl.tenant-kms-encrypted.svc.cluster.local:9000
   Uptime: 9 minutes 
   Version: 2024-03-15T01:07:19Z
   Network: 4/4 OK 
   Drives: 4/4 OK 
   Pool: 1

●  myminio-pool-0-1.myminio-hl.tenant-kms-encrypted.svc.cluster.local:9000
   Uptime: 9 minutes 
   Version: 2024-03-15T01:07:19Z
   Network: 4/4 OK 
   Drives: 4/4 OK 
   Pool: 1

●  myminio-pool-0-2.myminio-hl.tenant-kms-encrypted.svc.cluster.local:9000
   Uptime: 9 minutes 
   Version: 2024-03-15T01:07:19Z
   Network: 4/4 OK 
   Drives: 4/4 OK 
   Pool: 1

●  myminio-pool-0-3.myminio-hl.tenant-kms-encrypted.svc.cluster.local:9000
   Uptime: 9 minutes 
   Version: 2024-03-15T01:07:19Z
   Network: 4/4 OK 
   Drives: 4/4 OK 
   Pool: 1

Pools:
   1st, Erasure sets: 1, Drives per erasure set: 16

16 drives online, 0 drives offline

image

Clone this wiki locally