Created
May 11, 2020 21:11
-
-
Save robrich/c05cc266ad8bf972608698f78269bc7d to your computer and use it in GitHub Desktop.
RedHat OpenShift + MemSQL Operator
This file contains hidden or 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
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: memsql-operator-envvar | |
namespace: memsql | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
name: memsql-operator-envvar | |
template: | |
metadata: | |
labels: | |
name: memsql-operator-envvar | |
spec: | |
serviceAccountName: memsql-operator | |
containers: | |
- name: memsql-operator | |
# NOTE: Download the MemSQL Operator and stage it locally | |
# Then modify below image: to your local OCP docker registry | |
image: docker-registry.default.svc:5000/memsql/operator:latest | |
imagePullPolicy: IfNotPresent | |
args: [ | |
"--merge-service-annotations", | |
# Args below are for local dev | |
"--dev-endpoint", "127.17.0.1", | |
"--dev-no-anti-affinity", | |
"--cores-per-unit", "0", | |
"--memory-per-unit", "0", | |
"--fs-group-id", "5555" | |
] | |
env: | |
- name: WATCH_NAMESPACE | |
valueFrom: | |
fieldRef: | |
fieldPath: metadata.namespace | |
- name: POD_NAME | |
valueFrom: | |
fieldRef: | |
fieldPath: metadata.name | |
- name: OPERATOR_NAME | |
value: "memsql-operator" | |
- name: RELATED_IMAGE_NODE | |
# NOTE: Download the MemSQL Operator and stage it locally | |
# Then modify below image: to your local OCP docker registry | |
value: docker-registry.default.svc:5000/memsql/node:latest |
This file contains hidden or 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
apiVersion: apiextensions.k8s.io/v1beta1 | |
kind: CustomResourceDefinition | |
metadata: | |
name: memsqlclusters.memsql.com | |
spec: | |
group: memsql.com | |
names: | |
kind: MemsqlCluster | |
listKind: MemsqlClusterList | |
plural: memsqlclusters | |
singular: memsqlcluster | |
shortNames: | |
- memsql | |
scope: Namespaced | |
version: v1alpha1 | |
subresources: | |
status: {} | |
additionalPrinterColumns: | |
- name: Aggregators | |
type: integer | |
description: Number of MemSQL Aggregators | |
JSONPath: .spec.aggregatorSpec.count | |
- name: Leaves | |
type: integer | |
description: Number of MemSQL Leaves (per availability group) | |
JSONPath: .spec.leafSpec.count | |
- name: Redundancy Level | |
type: integer | |
description: Redundancy level of MemSQL Cluster | |
JSONPath: .spec.redundancyLevel | |
- name: Age | |
type: date | |
JSONPath: .metadata.creationTimestamp |
This file contains hidden or 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
apiVersion: memsql.com/v1alpha1 | |
kind: MemsqlCluster | |
metadata: | |
name: memsql-envvar | |
namespace: memsql | |
spec: | |
license: <your memsql cluster license file> | |
adminHashedPassword: "<your memsql cluster password hashed value>" | |
redundancyLevel: 2 | |
serviceSpec: | |
objectMetaOverrides: | |
labels: | |
custom: label | |
annotations: | |
custom: annotations | |
aggregatorSpec: | |
count: 3 | |
height: 1 | |
storageGB: 200 | |
storageClass: default | |
objectMetaOverrides: | |
annotations: | |
optional: annotation | |
labels: | |
optional: label | |
nodeSelector: | |
reserved: memsql | |
leafSpec: | |
count: 4 | |
height: 1 | |
storageGB: 200 | |
storageClass: default | |
objectMetaOverrides: | |
annotations: | |
optional: annotation | |
labels: | |
optional: label | |
nodeSelector: | |
reserved: memsql | |
serviceSpec: | |
type: "ClusterIP" | |
headless: false | |
objectMetaOverrides: | |
labels: | |
Name: memsql |
This file contains hidden or 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
apiVersion: v1 | |
kind: ServiceAccount | |
metadata: | |
name: memsql-operator | |
--- | |
apiVersion: rbac.authorization.k8s.io/v1 | |
kind: Role | |
metadata: | |
name: memsql-operator | |
rules: | |
- apiGroups: | |
- "" | |
resources: | |
- pods | |
- services | |
- endpoints | |
- persistentvolumeclaims | |
- events | |
- configmaps | |
- secrets | |
verbs: | |
- '*' | |
- apiGroups: | |
- policy | |
resources: | |
- poddisruptionbudgets | |
verbs: | |
- '*' | |
- apiGroups: | |
- batch | |
resources: | |
- cronjobs | |
verbs: | |
- "*" | |
- apiGroups: | |
- "" | |
resources: | |
- namespaces | |
verbs: | |
- get | |
- apiGroups: | |
- apps | |
- extensions | |
resources: | |
- deployments | |
- daemonsets | |
- replicasets | |
- statefulsets | |
verbs: | |
- '*' | |
- apiGroups: | |
- memsql.com | |
resources: | |
- '*' | |
verbs: | |
- '*' | |
--- | |
kind: RoleBinding | |
apiVersion: rbac.authorization.k8s.io/v1 | |
metadata: | |
name: memsql-operator | |
subjects: | |
- kind: ServiceAccount | |
name: memsql-operator | |
- kind: Group | |
name: memsql | |
roleRef: | |
kind: Role | |
name: memsql-operator | |
apiGroup: rbac.authorization.k8s.io |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment