-
Notifications
You must be signed in to change notification settings - Fork 455
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Support for Kustomize based scripts to setup Operator (#141)
- Loading branch information
Showing
8 changed files
with
275 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
name: minioinstances.operator.min.io | ||
spec: | ||
group: operator.min.io | ||
scope: Namespaced | ||
names: | ||
kind: MinIOInstance | ||
singular: minioinstance | ||
plural: minioinstances | ||
versions: | ||
- name: v1 | ||
served: true | ||
storage: true | ||
schema: | ||
# openAPIV3Schema is the schema for validating custom objects. | ||
# Refer https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/#specifying-a-structural-schema | ||
# for more details | ||
openAPIV3Schema: | ||
type: object | ||
properties: | ||
spec: | ||
type: object | ||
x-kubernetes-preserve-unknown-fields: true | ||
properties: | ||
replicas: | ||
type: integer | ||
minimum: 1 | ||
maximum: 32 | ||
image: | ||
type: string | ||
serviceName: | ||
type: string | ||
volumesPerServer: | ||
type: integer | ||
mountPath: | ||
type: string | ||
podManagementPolicy: | ||
type: string | ||
enum: [Parallel,OrderedReady] | ||
default: Parallel | ||
requestAutoCert: | ||
type: boolean | ||
default: false | ||
version: | ||
type: string | ||
mountpath: | ||
type: string | ||
subpath: | ||
type: string | ||
mcs: | ||
type: object | ||
x-kubernetes-preserve-unknown-fields: true | ||
properties: | ||
image: | ||
type: string | ||
replicas: | ||
type: integer | ||
default: 2 | ||
mcsSecret: | ||
type: object | ||
properties: | ||
name: | ||
type: string | ||
kes: | ||
type: object | ||
x-kubernetes-preserve-unknown-fields: true | ||
properties: | ||
image: | ||
type: string | ||
replicas: | ||
type: integer | ||
default: 2 | ||
kesSecret: | ||
type: object | ||
properties: | ||
name: | ||
type: string | ||
status: | ||
type: object | ||
properties: | ||
currentState: | ||
type: string | ||
subresources: | ||
# status enables the status subresource. | ||
status: {} | ||
additionalPrinterColumns: | ||
- name: Current State | ||
type: string | ||
jsonPath: ".status.currentState" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: minio-operator | ||
namespace: default | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
name: minio-operator | ||
template: | ||
metadata: | ||
labels: | ||
name: minio-operator | ||
spec: | ||
serviceAccountName: minio-operator | ||
containers: | ||
- name: minio-operator | ||
image: minio/k8s-operator:2.0.5 | ||
imagePullPolicy: IfNotPresent | ||
env: | ||
- name: CLUSTER_DOMAIN | ||
value: $(CLUSTER_DOMAIN) | ||
- name: WATCHED_NAMESPACE | ||
value: $(WATCHED_NAMESPACE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
namespace: minio-operator | ||
|
||
# Configure number of MinIO Operator Deployment Replicas | ||
replicas: | ||
- name: minio-operator | ||
count: 1 | ||
|
||
# Configure repo and tag of MinIO Operator Image | ||
images: | ||
- name: minio/k8s-operator | ||
newName: minio/k8s-operator | ||
newTag: 2.0.5 | ||
|
||
# Configure the Cluster Domain and NameSpace to Watch | ||
configMapGenerator: | ||
- name: operator-env | ||
literals: | ||
- CLUSTER_DOMAIN="cluster.local" | ||
- WATCHED_NAMESPACE="default" | ||
|
||
# Configure the Namespace and ServiceAccount name | ||
patchesJson6902: | ||
- target: | ||
version: v1 | ||
kind: ServiceAccount | ||
name: minio-operator | ||
patch: |- | ||
- op: replace | ||
path: /metadata/name | ||
value: "minio-operator" | ||
- target: | ||
version: v1 | ||
kind: Namespace | ||
name: minio-operator | ||
patch: |- | ||
- op: replace | ||
path: /metadata/name | ||
value: "minio-operator" | ||
vars: | ||
- name: CLUSTER_DOMAIN | ||
objref: | ||
kind: ConfigMap | ||
name: operator-env | ||
apiVersion: v1 | ||
fieldref: | ||
fieldpath: data.CLUSTER_DOMAIN | ||
- name: WATCHED_NAMESPACE | ||
objref: | ||
kind: ConfigMap | ||
name: operator-env | ||
apiVersion: v1 | ||
fieldref: | ||
fieldpath: data.WATCHED_NAMESPACE | ||
|
||
resources: | ||
- namespace.yaml | ||
- service-account.yaml | ||
- crd.yaml | ||
- rbac.yaml | ||
- deployment.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: minio-operator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1beta1 | ||
kind: ClusterRole | ||
metadata: | ||
name: minio-operator-role | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- namespaces | ||
- secrets | ||
- pods | ||
- services | ||
- events | ||
verbs: | ||
- get | ||
- watch | ||
- create | ||
- list | ||
- delete | ||
- apiGroups: | ||
- apps | ||
resources: | ||
- statefulsets | ||
- deployments | ||
verbs: | ||
- get | ||
- create | ||
- list | ||
- patch | ||
- watch | ||
- update | ||
- delete | ||
- apiGroups: | ||
- batch | ||
resources: | ||
- jobs | ||
verbs: | ||
- get | ||
- create | ||
- list | ||
- patch | ||
- watch | ||
- update | ||
- delete | ||
- apiGroups: | ||
- "certificates.k8s.io" | ||
resources: | ||
- "certificatesigningrequests" | ||
- "certificatesigningrequests/approval" | ||
- "certificatesigningrequests/status" | ||
verbs: | ||
- update | ||
- create | ||
- get | ||
- delete | ||
- apiGroups: | ||
- operator.min.io | ||
resources: | ||
- "*" | ||
verbs: | ||
- "*" | ||
- apiGroups: | ||
- min.io | ||
resources: | ||
- "*" | ||
verbs: | ||
- "*" | ||
--- | ||
kind: ClusterRoleBinding | ||
apiVersion: rbac.authorization.k8s.io/v1beta1 | ||
metadata: | ||
name: minio-operator-binding | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: minio-operator-role | ||
subjects: | ||
- kind: ServiceAccount | ||
name: minio-operator | ||
namespace: default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: minio-operator | ||
namespace: default |