Skip to content

Commit

Permalink
MC job to setup buckets using STS
Browse files Browse the repository at this point in the history
Signed-off-by: pjuarezd <[email protected]>
  • Loading branch information
pjuarezd committed Nov 5, 2023
1 parent fc3d3f4 commit 3acbed5
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- iam-setup-bucket.yaml
- mc-job-sa.yaml
- mc-job-policy-binding.yaml
- mc-job-setup-bucket.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: sts.min.io/v1alpha1
kind: PolicyBinding
metadata:
name: mc-job-binding
namespace: minio-tenant-1
spec:
application:
namespace: minio-tenant-1
serviceaccount: mc-job-sa
policies:
- consoleAdmin
5 changes: 5 additions & 0 deletions examples/kustomization/sts-example/sample-data/mc-job-sa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v1
kind: ServiceAccount
metadata:
namespace: minio-tenant-1
name: mc-job-sa
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ spec:
backoffLimit: 5
template:
spec:
restartPolicy: OnFailure
serviceAccountName: mc-job-sa
restartPolicy: Never
volumes:
- name: start-config
configMap:
Expand All @@ -49,15 +50,9 @@ spec:
- name: start-config
mountPath: /start-config/
env:
- name: ACCESS_KEY
valueFrom:
secretKeyRef:
name: storage-user
key: CONSOLE_ACCESS_KEY
- name: SECRET_KEY
valueFrom:
secretKeyRef:
name: storage-user
key: CONSOLE_SECRET_KEY
- name: MC_HOST_local
value: https://$(ACCESS_KEY):$(SECRET_KEY)@minio.minio-tenant-1.svc.cluster.local
- name: MC_STS_ENDPOINT
value: https://sts.minio-operator.svc.cluster.local:4223/sts/minio-tenant-1
- name: MC_WEB_IDENTITY_TOKEN_FILE
value: /var/run/secrets/kubernetes.io/serviceaccount/token

0 comments on commit 3acbed5

Please sign in to comment.