sidekick in k8s - cniackz/public GitHub Wiki

Objective:

To show how to configure sidekick in k8s

Diagram:

telegram-cloud-photo-size-1-5170343710838337176-y

Steps:

  1. Have a cluster ready

  2. Install Operator

  3. Install Tenant

  4. Deploy SideKick:

apiVersion: v1
kind: Pod
metadata:
  namespace: tenant-lite
  name: ubuntu
  labels:
    app: ubuntu
spec:
  volumes:
    - name: socket
      hostPath:
        path: /run/containerd/containerd.sock
  containers:
  - volumeMounts:
      - mountPath: /run/containerd/containerd.sock
        name: socket
        readOnly: false
    image: ubuntu
    command:
      - "sleep"
      - "604800"
    imagePullPolicy: IfNotPresent
    name: ubuntu
  - name: sidekick
    image: "minio/sidekick:latest"
    imagePullPolicy: Always
    args: ["--insecure", "--health-path", "/minio/health/ready", "--address", ":9000", "https://myminio-pool-0-{0...3}.myminio-hl.tenant-lite.svc.cluster.local:9000"]
    ports:
      - containerPort: 9000
  restartPolicy: Always

SideKick will listen and give 200 for ready endpoint:

sidekick: listening on ':9000'
 TRACE: 13:15:31.187 [200 OK]  myminio-pool-0-1.myminio-hl.tenant-lite.svc.cluster.local GET /minio/health/ready                   3.503ms      ↑ 0 B ↓ 0 B
 TRACE: 13:15:31.188 [200 OK]  myminio-pool-0-2.myminio-hl.tenant-lite.svc.cluster.local GET /minio/health/ready                   3.268ms      ↑ 0 B ↓ 0 B
 TRACE: 13:15:31.187 [200 OK]  myminio-pool-0-0.myminio-hl.tenant-lite.svc.cluster.local GET /minio/health/ready                   3.794ms      ↑ 0 B ↓ 0 B
 TRACE: 13:15:31.188 [200 OK]  myminio-pool-0-3.myminio-hl.tenant-lite.svc.cluster.local GET /minio/health/ready                   3.499ms      ↑ 0 B ↓ 0 B
 TRACE: 13:15:36.192 [200 OK]  myminio-pool-0-2.myminio-hl.tenant-lite.svc.cluster.local GET /minio/health/ready                   8.283ms      ↑ 0 B ↓ 0 B
 TRACE: 13:15:36.194 [200 OK]  myminio-pool-0-1.myminio-hl.tenant-lite.svc.cluster.local GET /minio/health/ready                   6.704ms      ↑ 0 B ↓ 0 B

With Ubuntu App, you can do s3 transactions:

root@ubuntu:/# mc config host add minio-distributed http://localhost:9000 minio minio123
mc: Configuration written to `/root/.mc/config.json`. Please update your access credentials.
mc: Successfully created `/root/.mc/share`.
mc: Initialized share uploads `/root/.mc/share/uploads.json` file.
mc: Initialized share downloads `/root/.mc/share/downloads.json` file.
Added `minio-distributed` successfully.

Things to highlight:

  1. For this to work, please use "--insecure" in sidekick

  2. If you are in the same cluster, sidekick must use headless service to load balance.

When outside the cluster:

  • You can use NodePort to run sidekick on:
sidekick --health-path=/minio/health/ready --address :9900 --insecure https://XXX.XXXX.XXXX.{66...73}:30023