From d7f707d682c11da0b085191d303ec2defaa5cfd7 Mon Sep 17 00:00:00 2001 From: Daniel Valdivia Date: Wed, 20 May 2020 11:04:55 -0700 Subject: [PATCH] Fix default namespace for install and add kustomize --- README.md | 5 ++--- kustomization.yaml | 4 ++++ minio-operator.yaml | 3 +++ 3 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 kustomization.yaml diff --git a/README.md b/README.md index 3d160516fb2..e8d06ca0821 100644 --- a/README.md +++ b/README.md @@ -30,11 +30,10 @@ kubectl apply -f https://raw.githubusercontent.com/minio/minio-operator/master/m This will create all relevant resources required for the Operator to work. -You could install the MinIO Operator a custom namespace by passing the `-n` flag +You could install the MinIO Operator a custom namespace by customizing the `minio-operator.yaml` file or using [kustomize](https://github.com/kubernetes-sigs/kustomize) ```bash -kubectl create namespace minio-operator-ns -kubectl apply -n minio-operator-ns -f https://raw.githubusercontent.com/minio/minio-operator/master/minio-operator.yaml +kustomize build | kubectl apply -f - ``` ### Create a MinIO instance diff --git a/kustomization.yaml b/kustomization.yaml new file mode 100644 index 00000000000..65fff6680fc --- /dev/null +++ b/kustomization.yaml @@ -0,0 +1,4 @@ +namespace: minio-operator-ns + +resources: + - minio-operator.yaml diff --git a/minio-operator.yaml b/minio-operator.yaml index eed7a3a6a9b..269eb7271df 100644 --- a/minio-operator.yaml +++ b/minio-operator.yaml @@ -133,6 +133,7 @@ apiVersion: v1 kind: ServiceAccount metadata: name: minio-operator-sa + namespace: default --- kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1beta1 @@ -145,11 +146,13 @@ roleRef: subjects: - kind: ServiceAccount name: minio-operator-sa + namespace: default --- apiVersion: apps/v1 kind: Deployment metadata: name: minio-operator + namespace: default spec: replicas: 1 selector: