Skip to content
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

Example k8s job to setup buckets using STS and mc #1850

Merged
merged 3 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
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
jiuker marked this conversation as resolved.
Show resolved Hide resolved
pjuarezd marked this conversation as resolved.
Show resolved Hide resolved
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
4 changes: 2 additions & 2 deletions testing/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -349,13 +349,13 @@ function install_tenant() {
}

function setup_sts_bucket() {
echo "Installing setub bucket job"
echo "Installing setup bucket job"
try kubectl apply -k "${SCRIPT_DIR}/../examples/kustomization/sts-example/sample-data"
namespace="minio-tenant-1"
condition="condition=Complete"
selector="metadata.name=setup-bucket"
try wait_for_resource_field_selector $namespace job $condition $selector
echo "Installing setub bucket job: DONE"
echo "Installing setup bucket job: DONE"
}

function install_sts_client() {
Expand Down