From 3277ad21e37c47094eea504f1402fc61c9f95a9c Mon Sep 17 00:00:00 2001 From: Sergio Ballesteros Date: Mon, 15 Oct 2018 12:08:08 +0200 Subject: [PATCH] Fix README links --- README.md | 6 +- .../all-redis-operator-resources.yaml | 86 +++++++++++++++++++ 2 files changed, 89 insertions(+), 3 deletions(-) create mode 100644 example/operator/all-redis-operator-resources.yaml diff --git a/README.md b/README.md index 8c0a0d15a..20c61abaa 100644 --- a/README.md +++ b/README.md @@ -18,12 +18,12 @@ The image versions deployed by the operator can be found on the [constants file] [![Redis Operator Image](https://quay.io/repository/spotahome/redis-operator/status "Redis Operator Image")](https://quay.io/repository/spotahome/redis-operator) ## Operator deployment on kubernetes -In order to create Redis failovers inside a Kubernetes cluster, the operator has to be deployed. It can be done with a [deployment](example/operator.yaml) or with the provided [Helm chart](charts/redisoperator). +In order to create Redis failovers inside a Kubernetes cluster, the operator has to be deployed. It can be done with [deployment](example/operator) or with the provided [Helm chart](charts/redisoperator). ### Using a Deployment To create the operator, you can directly create it with kubectl: ``` -kubectl create -f https://raw.githubusercontent.com/spotahome/redis-operator/master/example/operator.yaml +kubectl create -f https://raw.githubusercontent.com/spotahome/redis-operator/master/example/operator/all-redis-operator-resources.yaml ``` This will create a deployment named `redisoperator`. @@ -38,7 +38,7 @@ Once the operator is deployed inside a Kubernetes cluster, a new API will be acc In order to deploy a new redis-failover a [specification](example/redisfailover/all-options.yaml) has to be created: ``` -kubectl create -f https://raw.githubusercontent.com/spotahome/redis-operator/master/redisfailover/all-options.yaml +kubectl create -f https://raw.githubusercontent.com/spotahome/redis-operator/master/example/redisfailover/all-options.yaml ``` This redis-failover will be managed by the operator, resulting in the following elements created inside Kubernetes: diff --git a/example/operator/all-redis-operator-resources.yaml b/example/operator/all-redis-operator-resources.yaml new file mode 100644 index 000000000..a8acda746 --- /dev/null +++ b/example/operator/all-redis-operator-resources.yaml @@ -0,0 +1,86 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + labels: + app: redisoperator + name: redisoperator +spec: + replicas: 1 + selector: + matchLabels: + app: redisoperator + strategy: + type: RollingUpdate + template: + metadata: + labels: + app: redisoperator + spec: + containers: + - image: quay.io/spotahome/redis-operator:latest + imagePullPolicy: IfNotPresent + name: app + resources: + limits: + cpu: 100m + memory: 50Mi + requests: + cpu: 10m + memory: 50Mi + restartPolicy: Always +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: redisoperator +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: redisoperator +subjects: +- kind: ServiceAccount + name: redisoperator + namespace: default +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: redisoperator +rules: +- apiGroups: + - storage.spotahome.com + resources: + - redisfailovers + verbs: + - "*" +- apiGroups: + - apiextensions.k8s.io + resources: + - customresourcedefinitions + verbs: + - "*" +- apiGroups: + - "" + resources: + - pods + - services + - endpoints + - events + - configmaps + verbs: + - "*" +- apiGroups: + - apps + resources: + - deployments + - statefulsets + verbs: + - "*" +- apiGroups: + - policy + resources: + - poddisruptionbudgets + verbs: + - "*" +apiVersion: v1 +kind: ServiceAccount +metadata: + name: redisoperator