diff --git a/example/v1beta1/additional_config/clusterd.yaml b/example/v1beta1/additional_config/clusterd.yaml new file mode 100644 index 000000000..a546cc114 --- /dev/null +++ b/example/v1beta1/additional_config/clusterd.yaml @@ -0,0 +1,32 @@ +--- +apiVersion: redis.redis.opstreelabs.in/v1beta1 +kind: RedisCluster +metadata: + name: redis-cluster +spec: + clusterSize: 3 + clusterVersion: v7 + securityContext: + runAsUser: 1000 + fsGroup: 1000 + persistenceEnabled: true + kubernetesConfig: + image: quay.io/opstree/redis:v7.0.5 + imagePullPolicy: IfNotPresent + redisExporter: + enabled: false + image: quay.io/opstree/redis-exporter:v1.44.0 + redisLeader: + redisConfig: + additionalRedisConfig: redis-external-config + redisFollower: + redisConfig: + additionalRedisConfig: redis-external-config + storage: + volumeClaimTemplate: + spec: + # storageClassName: standard + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi diff --git a/example/additional_config/configmap.yaml b/example/v1beta1/additional_config/configmap.yaml similarity index 100% rename from example/additional_config/configmap.yaml rename to example/v1beta1/additional_config/configmap.yaml diff --git a/example/additional_config/replication.yaml b/example/v1beta1/additional_config/replication.yaml similarity index 96% rename from example/additional_config/replication.yaml rename to example/v1beta1/additional_config/replication.yaml index 4e243da19..5bfd37d9d 100644 --- a/example/additional_config/replication.yaml +++ b/example/v1beta1/additional_config/replication.yaml @@ -10,7 +10,7 @@ spec: kubernetesConfig: image: quay.io/opstree/redis:v7.0.5 imagePullPolicy: IfNotPresent - podSecurityContext: + securityContext: runAsUser: 1000 fsGroup: 1000 storage: diff --git a/example/additional_config/standalone.yaml b/example/v1beta1/additional_config/standalone.yaml similarity index 96% rename from example/additional_config/standalone.yaml rename to example/v1beta1/additional_config/standalone.yaml index a6055b940..94ea81831 100644 --- a/example/additional_config/standalone.yaml +++ b/example/v1beta1/additional_config/standalone.yaml @@ -9,7 +9,7 @@ spec: kubernetesConfig: image: quay.io/opstree/redis:v7.0.5 imagePullPolicy: IfNotPresent - podSecurityContext: + securityContext: runAsUser: 1000 fsGroup: 1000 storage: diff --git a/example/v1beta1/advance_config/clusterd.yaml b/example/v1beta1/advance_config/clusterd.yaml new file mode 100644 index 000000000..305a13c19 --- /dev/null +++ b/example/v1beta1/advance_config/clusterd.yaml @@ -0,0 +1,39 @@ +--- +apiVersion: redis.redis.opstreelabs.in/v1beta1 +kind: RedisCluster +metadata: + name: redis-cluster +spec: + clusterSize: 3 + clusterVersion: v7 + securityContext: + runAsUser: 1000 + fsGroup: 1000 + persistenceEnabled: true + kubernetesConfig: + image: quay.io/opstree/redis:v7.0.5 + resources: + requests: + cpu: 101m + memory: 128Mi + limits: + cpu: 101m + memory: 128Mi + imagePullSecrets: + - name: regcred + redisExporter: + enabled: false + image: quay.io/opstree/redis-exporter:v1.44.0 + storage: + volumeClaimTemplate: + spec: + # storageClassName: standard + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi + # nodeSelector: {} + # securityContext: {} + # priorityClassName: "" + # affinity: {} + # Tolerations: [] diff --git a/example/v1beta1/advance_config/standalone.yaml b/example/v1beta1/advance_config/standalone.yaml new file mode 100644 index 000000000..e76625154 --- /dev/null +++ b/example/v1beta1/advance_config/standalone.yaml @@ -0,0 +1,35 @@ +--- +apiVersion: redis.redis.opstreelabs.in/v1beta1 +kind: Redis +metadata: + name: redis-standalone +spec: + kubernetesConfig: + image: quay.io/opstree/redis:v7.0.5 + imagePullPolicy: IfNotPresent + resources: + requests: + cpu: 101m + memory: 128Mi + limits: + cpu: 101m + memory: 128Mi + securityContext: + runAsUser: 1000 + fsGroup: 1000 + storage: + volumeClaimTemplate: + spec: + # storageClassName: standard + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi + redisExporter: + enabled: false + image: quay.io/opstree/redis-exporter:v1.44.0 + # nodeSelector: {} + # securityContext: {} + # priorityClassName: "" + # affinity: {} + # Tolerations: [] diff --git a/example/v1beta1/affinity/clusterd.yaml b/example/v1beta1/affinity/clusterd.yaml new file mode 100644 index 000000000..535a98fde --- /dev/null +++ b/example/v1beta1/affinity/clusterd.yaml @@ -0,0 +1,50 @@ +--- +apiVersion: redis.redis.opstreelabs.in/v1beta1 +kind: RedisCluster +metadata: + name: redis-cluster +spec: + clusterSize: 3 + clusterVersion: v7 + securityContext: + runAsUser: 1000 + fsGroup: 1000 + persistenceEnabled: true + kubernetesConfig: + image: quay.io/opstree/redis:v7.0.5 + imagePullPolicy: IfNotPresent + redisExporter: + enabled: false + image: quay.io/opstree/redis-exporter:v1.44.0 + redisLeader: + affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: app + operator: In + values: + - redis-cluster-leader + - redis-cluster-follower + topologyKey: "kubernetes.io/hostname" + redisFollower: + affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: app + operator: In + values: + - redis-cluster-follower + - redis-cluster-leader + topologyKey: "kubernetes.io/hostname" + storage: + volumeClaimTemplate: + spec: + # storageClassName: standard + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi diff --git a/example/affinity/replication.yaml b/example/v1beta1/affinity/replication.yaml similarity index 97% rename from example/affinity/replication.yaml rename to example/v1beta1/affinity/replication.yaml index 5ec87a954..7efc207ed 100644 --- a/example/affinity/replication.yaml +++ b/example/v1beta1/affinity/replication.yaml @@ -8,7 +8,7 @@ spec: kubernetesConfig: image: quay.io/opstree/redis:v7.0.5 imagePullPolicy: IfNotPresent - podSecurityContext: + securityContext: runAsUser: 1000 fsGroup: 1000 storage: diff --git a/example/affinity/standalone.yaml b/example/v1beta1/affinity/standalone.yaml similarity index 97% rename from example/affinity/standalone.yaml rename to example/v1beta1/affinity/standalone.yaml index 8a0278b5d..e5703a51c 100644 --- a/example/affinity/standalone.yaml +++ b/example/v1beta1/affinity/standalone.yaml @@ -7,7 +7,7 @@ spec: kubernetesConfig: image: quay.io/opstree/redis:v7.0.5 imagePullPolicy: IfNotPresent - podSecurityContext: + securityContext: runAsUser: 1000 fsGroup: 1000 storage: diff --git a/example/v1beta1/disruption_budget/clusterd.yaml b/example/v1beta1/disruption_budget/clusterd.yaml new file mode 100644 index 000000000..2059162ad --- /dev/null +++ b/example/v1beta1/disruption_budget/clusterd.yaml @@ -0,0 +1,58 @@ +--- +apiVersion: redis.redis.opstreelabs.in/v1beta1 +kind: RedisCluster +metadata: + name: redis-cluster +spec: + clusterSize: 3 + clusterVersion: v7 + securityContext: + runAsUser: 1000 + fsGroup: 1000 + persistenceEnabled: true + kubernetesConfig: + image: quay.io/opstree/redis:v7.0.5 + imagePullPolicy: IfNotPresent + redisExporter: + enabled: false + image: "quay.io/opstree/redis-exporter:v1.44.0" + redisFollower: + affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - + labelSelector: + matchExpressions: + - + key: app + operator: In + values: + - redis-cluster-follower + topologyKey: kubernetes.io/hostname + pdb: + enabled: true + minAvailable: 1 + redisLeader: + affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - + labelSelector: + matchExpressions: + - + key: app + operator: In + values: + - redis-cluster-leader + topologyKey: kubernetes.io/hostname + pdb: + enabled: true + minAvailable: 1 + storage: + volumeClaimTemplate: + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi diff --git a/example/eks-cluster.yaml b/example/v1beta1/eks-cluster.yaml similarity index 100% rename from example/eks-cluster.yaml rename to example/v1beta1/eks-cluster.yaml diff --git a/example/external_service/cluster-svc.yaml b/example/v1beta1/external_service/cluster-svc.yaml similarity index 100% rename from example/external_service/cluster-svc.yaml rename to example/v1beta1/external_service/cluster-svc.yaml diff --git a/example/v1beta1/external_service/clusterd.yaml b/example/v1beta1/external_service/clusterd.yaml new file mode 100644 index 000000000..26b89a8fb --- /dev/null +++ b/example/v1beta1/external_service/clusterd.yaml @@ -0,0 +1,26 @@ +--- +apiVersion: redis.redis.opstreelabs.in/v1beta1 +kind: RedisCluster +metadata: + name: redis-cluster +spec: + clusterSize: 3 + clusterVersion: v7 + securityContext: + runAsUser: 1000 + fsGroup: 1000 + persistenceEnabled: true + kubernetesConfig: + image: quay.io/opstree/redis:v7.0.5 + imagePullPolicy: IfNotPresent + redisExporter: + enabled: false + image: quay.io/opstree/redis-exporter:v1.44.0 + storage: + volumeClaimTemplate: + spec: + # storageClassName: standard + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi diff --git a/example/external_service/replication-svc.yaml b/example/v1beta1/external_service/replication-svc.yaml similarity index 100% rename from example/external_service/replication-svc.yaml rename to example/v1beta1/external_service/replication-svc.yaml diff --git a/example/external_service/replication.yaml b/example/v1beta1/external_service/replication.yaml similarity index 96% rename from example/external_service/replication.yaml rename to example/v1beta1/external_service/replication.yaml index 4c806ca73..4f84f2467 100644 --- a/example/external_service/replication.yaml +++ b/example/v1beta1/external_service/replication.yaml @@ -8,7 +8,7 @@ spec: kubernetesConfig: image: quay.io/opstree/redis:v7.0.5 imagePullPolicy: IfNotPresent - podSecurityContext: + securityContext: runAsUser: 1000 fsGroup: 1000 storage: diff --git a/example/external_service/standalone-svc.yaml b/example/v1beta1/external_service/standalone-svc.yaml similarity index 100% rename from example/external_service/standalone-svc.yaml rename to example/v1beta1/external_service/standalone-svc.yaml diff --git a/example/external_service/standalone.yaml b/example/v1beta1/external_service/standalone.yaml similarity index 95% rename from example/external_service/standalone.yaml rename to example/v1beta1/external_service/standalone.yaml index fb93de629..bfc4ff974 100644 --- a/example/external_service/standalone.yaml +++ b/example/v1beta1/external_service/standalone.yaml @@ -7,7 +7,7 @@ spec: kubernetesConfig: image: quay.io/opstree/redis:v7.0.5 imagePullPolicy: IfNotPresent - podSecurityContext: + securityContext: runAsUser: 1000 fsGroup: 1000 storage: diff --git a/example/v1beta1/node-selector/clusterd.yaml b/example/v1beta1/node-selector/clusterd.yaml new file mode 100644 index 000000000..df8520ca8 --- /dev/null +++ b/example/v1beta1/node-selector/clusterd.yaml @@ -0,0 +1,32 @@ +--- +apiVersion: redis.redis.opstreelabs.in/v1beta1 +kind: RedisCluster +metadata: + name: redis-cluster +spec: + clusterSize: 3 + clusterVersion: v7 + securityContext: + runAsUser: 1000 + fsGroup: 1000 + persistenceEnabled: true + kubernetesConfig: + image: quay.io/opstree/redis:v7.0.5 + imagePullPolicy: IfNotPresent + redisExporter: + enabled: false + image: quay.io/opstree/redis-exporter:v1.44.0 + redisLeader: + nodeSelector: + kubernetes.io/os: linux + redisFollower: + nodeSelector: + kubernetes.io/os: linux + storage: + volumeClaimTemplate: + spec: + # storageClassName: standard + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi diff --git a/example/node-selector/replication.yaml b/example/v1beta1/node-selector/replication.yaml similarity index 96% rename from example/node-selector/replication.yaml rename to example/v1beta1/node-selector/replication.yaml index a1dbd5002..991de4243 100644 --- a/example/node-selector/replication.yaml +++ b/example/v1beta1/node-selector/replication.yaml @@ -8,7 +8,7 @@ spec: kubernetesConfig: image: quay.io/opstree/redis:v7.0.5 imagePullPolicy: IfNotPresent - podSecurityContext: + securityContext: runAsUser: 1000 fsGroup: 1000 storage: diff --git a/example/node-selector/standalone.yaml b/example/v1beta1/node-selector/standalone.yaml similarity index 96% rename from example/node-selector/standalone.yaml rename to example/v1beta1/node-selector/standalone.yaml index 6837c955c..72596236b 100644 --- a/example/node-selector/standalone.yaml +++ b/example/v1beta1/node-selector/standalone.yaml @@ -7,7 +7,7 @@ spec: kubernetesConfig: image: quay.io/opstree/redis:v7.0.5 imagePullPolicy: IfNotPresent - podSecurityContext: + securityContext: runAsUser: 1000 fsGroup: 1000 storage: diff --git a/example/v1beta1/password_protected/clusterd.yaml b/example/v1beta1/password_protected/clusterd.yaml new file mode 100644 index 000000000..a978fdfe8 --- /dev/null +++ b/example/v1beta1/password_protected/clusterd.yaml @@ -0,0 +1,29 @@ +--- +apiVersion: redis.redis.opstreelabs.in/v1beta1 +kind: RedisCluster +metadata: + name: redis-cluster +spec: + clusterSize: 3 + clusterVersion: v7 + securityContext: + runAsUser: 1000 + fsGroup: 1000 + persistenceEnabled: true + kubernetesConfig: + image: quay.io/opstree/redis:v7.0.5 + imagePullPolicy: IfNotPresent + redisSecret: + name: redis-secret + key: password + redisExporter: + enabled: false + image: quay.io/opstree/redis-exporter:v1.44.0 + storage: + volumeClaimTemplate: + spec: + # storageClassName: standard + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi diff --git a/example/password_protected/replication.yaml b/example/v1beta1/password_protected/replication.yaml similarity index 96% rename from example/password_protected/replication.yaml rename to example/v1beta1/password_protected/replication.yaml index f925b36e7..ef3311d61 100644 --- a/example/password_protected/replication.yaml +++ b/example/v1beta1/password_protected/replication.yaml @@ -22,6 +22,6 @@ spec: redisExporter: enabled: false image: quay.io/opstree/redis-exporter:v1.44.0 - podSecurityContext: + securityContext: runAsUser: 1000 fsGroup: 1000 diff --git a/example/password_protected/secret.yaml b/example/v1beta1/password_protected/secret.yaml similarity index 100% rename from example/password_protected/secret.yaml rename to example/v1beta1/password_protected/secret.yaml diff --git a/example/password_protected/standalone.yaml b/example/v1beta1/password_protected/standalone.yaml similarity index 96% rename from example/password_protected/standalone.yaml rename to example/v1beta1/password_protected/standalone.yaml index e0da3beb4..8be97ea57 100644 --- a/example/password_protected/standalone.yaml +++ b/example/v1beta1/password_protected/standalone.yaml @@ -21,6 +21,6 @@ spec: redisExporter: enabled: false image: quay.io/opstree/redis-exporter:v1.44.0 - podSecurityContext: + securityContext: runAsUser: 1000 fsGroup: 1000 diff --git a/example/v1beta1/private_registry/clusterd.yaml b/example/v1beta1/private_registry/clusterd.yaml new file mode 100644 index 000000000..3e41c0caa --- /dev/null +++ b/example/v1beta1/private_registry/clusterd.yaml @@ -0,0 +1,28 @@ +--- +apiVersion: redis.redis.opstreelabs.in/v1beta1 +kind: RedisCluster +metadata: + name: redis-cluster +spec: + clusterSize: 3 + clusterVersion: v7 + securityContext: + runAsUser: 1000 + fsGroup: 1000 + persistenceEnabled: true + kubernetesConfig: + image: quay.io/opstree/redis:v7.0.5 + imagePullPolicy: IfNotPresent + imagePullSecrets: + - name: regcred + redisExporter: + enabled: false + image: quay.io/opstree/redis-exporter:v1.44.0 + storage: + volumeClaimTemplate: + spec: + # storageClassName: standard + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi diff --git a/example/private_registry/replication.yaml b/example/v1beta1/private_registry/replication.yaml similarity index 96% rename from example/private_registry/replication.yaml rename to example/v1beta1/private_registry/replication.yaml index 4d14e3254..c33ca9d1a 100644 --- a/example/private_registry/replication.yaml +++ b/example/v1beta1/private_registry/replication.yaml @@ -21,6 +21,6 @@ spec: redisExporter: enabled: false image: quay.io/opstree/redis-exporter:v1.44.0 - podSecurityContext: + securityContext: runAsUser: 1000 fsGroup: 1000 diff --git a/example/private_registry/standalone.yaml b/example/v1beta1/private_registry/standalone.yaml similarity index 96% rename from example/private_registry/standalone.yaml rename to example/v1beta1/private_registry/standalone.yaml index 3b83130fa..dc1d640b6 100644 --- a/example/private_registry/standalone.yaml +++ b/example/v1beta1/private_registry/standalone.yaml @@ -20,6 +20,6 @@ spec: redisExporter: enabled: false image: quay.io/opstree/redis-exporter:v1.44.0 - podSecurityContext: + securityContext: runAsUser: 1000 fsGroup: 1000 diff --git a/example/v1beta1/probes/clusterd.yaml b/example/v1beta1/probes/clusterd.yaml new file mode 100644 index 000000000..9c2992d88 --- /dev/null +++ b/example/v1beta1/probes/clusterd.yaml @@ -0,0 +1,51 @@ +--- +apiVersion: redis.redis.opstreelabs.in/v1beta1 +kind: RedisCluster +metadata: + name: redis-cluster +spec: + clusterSize: 3 + clusterVersion: v7 + securityContext: + runAsUser: 1000 + fsGroup: 1000 + persistenceEnabled: true + kubernetesConfig: + image: quay.io/opstree/redis:v7.0.5 + redisExporter: + enabled: false + image: quay.io/opstree/redis-exporter:v1.44.0 + redisLeader: + readinessProbe: + failureThreshold: 5 + initialDelaySeconds: 15 + periodSeconds: 15 + successThreshold: 1 + timeoutSeconds: 5 + livenessProbe: + failureThreshold: 5 + initialDelaySeconds: 15 + periodSeconds: 15 + successThreshold: 1 + timeoutSeconds: 5 + redisFollower: + readinessProbe: + failureThreshold: 5 + initialDelaySeconds: 15 + periodSeconds: 15 + successThreshold: 1 + timeoutSeconds: 5 + livenessProbe: + failureThreshold: 5 + initialDelaySeconds: 15 + periodSeconds: 15 + successThreshold: 1 + timeoutSeconds: 5 + storage: + volumeClaimTemplate: + spec: + # storageClassName: standard + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi diff --git a/example/probes/replication.yaml b/example/v1beta1/probes/replication.yaml similarity index 97% rename from example/probes/replication.yaml rename to example/v1beta1/probes/replication.yaml index cda33b96b..02513b28c 100644 --- a/example/probes/replication.yaml +++ b/example/v1beta1/probes/replication.yaml @@ -5,7 +5,7 @@ metadata: name: redis-replication spec: clusterSize: 3 - podSecurityContext: + securityContext: runAsUser: 1000 fsGroup: 1000 kubernetesConfig: diff --git a/example/probes/standalone.yaml b/example/v1beta1/probes/standalone.yaml similarity index 97% rename from example/probes/standalone.yaml rename to example/v1beta1/probes/standalone.yaml index af5d5fc93..70797aced 100644 --- a/example/probes/standalone.yaml +++ b/example/v1beta1/probes/standalone.yaml @@ -4,7 +4,7 @@ kind: Redis metadata: name: redis-standalone spec: - podSecurityContext: + securityContext: runAsUser: 1000 fsGroup: 1000 kubernetesConfig: diff --git a/example/v1beta1/recreate-statefulset/clusterd.yaml b/example/v1beta1/recreate-statefulset/clusterd.yaml new file mode 100644 index 000000000..f944f8b2c --- /dev/null +++ b/example/v1beta1/recreate-statefulset/clusterd.yaml @@ -0,0 +1,29 @@ +--- +apiVersion: redis.redis.opstreelabs.in/v1beta1 +kind: RedisCluster +metadata: + name: redis-cluster + annotations: + redis.opstreelabs.in/recreate-statefulset: "true" +spec: + clusterSize: 3 + clusterVersion: v7 + securityContext: + runAsUser: 1000 + fsGroup: 1000 + persistenceEnabled: true + kubernetesConfig: + image: quay.io/opstree/redis:v7.0.5 + imagePullPolicy: IfNotPresent + redisExporter: + enabled: false + image: quay.io/opstree/redis-exporter:v1.44.0 + storage: + volumeClaimTemplate: + spec: + # storageClassName: standard + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi + priorityClassName: priority-100 diff --git a/example/recreate-statefulset/replication.yaml b/example/v1beta1/recreate-statefulset/replication.yaml similarity index 96% rename from example/recreate-statefulset/replication.yaml rename to example/v1beta1/recreate-statefulset/replication.yaml index 08fc3406a..bdeb9db87 100644 --- a/example/recreate-statefulset/replication.yaml +++ b/example/v1beta1/recreate-statefulset/replication.yaml @@ -10,7 +10,7 @@ spec: kubernetesConfig: image: quay.io/opstree/redis:v7.0.5 imagePullPolicy: IfNotPresent - podSecurityContext: + securityContext: runAsUser: 1000 fsGroup: 1000 storage: diff --git a/example/recreate-statefulset/standalone.yaml b/example/v1beta1/recreate-statefulset/standalone.yaml similarity index 96% rename from example/recreate-statefulset/standalone.yaml rename to example/v1beta1/recreate-statefulset/standalone.yaml index 5d9fb97f5..03b62796f 100644 --- a/example/recreate-statefulset/standalone.yaml +++ b/example/v1beta1/recreate-statefulset/standalone.yaml @@ -9,7 +9,7 @@ spec: kubernetesConfig: image: quay.io/opstree/redis:v7.0.5 imagePullPolicy: IfNotPresent - podSecurityContext: + securityContext: runAsUser: 1000 fsGroup: 1000 storage: diff --git a/example/v1beta1/redis-cluster.yaml b/example/v1beta1/redis-cluster.yaml new file mode 100644 index 000000000..148c4f74b --- /dev/null +++ b/example/v1beta1/redis-cluster.yaml @@ -0,0 +1,71 @@ +--- +apiVersion: redis.redis.opstreelabs.in/v1beta1 +kind: RedisCluster +metadata: + name: redis-cluster +spec: + clusterSize: 3 + clusterVersion: v7 + persistenceEnabled: true + securityContext: + runAsUser: 1000 + fsGroup: 1000 + kubernetesConfig: + image: quay.io/opstree/redis:v7.0.5 + imagePullPolicy: IfNotPresent + resources: + requests: + cpu: 101m + memory: 128Mi + limits: + cpu: 101m + memory: 128Mi + redisSecret: + name: redis-secret + key: password + # imagePullSecrets: + # - name: regcred + redisExporter: + enabled: false + image: quay.io/opstree/redis-exporter:v1.44.0 + imagePullPolicy: Always + resources: + requests: + cpu: 100m + memory: 128Mi + limits: + cpu: 100m + memory: 128Mi +# Environment Variables for Redis Exporter + # env: + # - name: REDIS_EXPORTER_INCL_SYSTEM_METRICS + # value: "true" + # - name: UI_PROPERTIES_FILE_NAME + # valueFrom: + # configMapKeyRef: + # name: game-demo + # key: ui_properties_file_name + # - name: SECRET_USERNAME + # valueFrom: + # secretKeyRef: + # name: mysecret + # key: username +# redisLeader: +# redisConfig: +# additionalRedisConfig: redis-external-config +# redisFollower: +# redisConfig: +# additionalRedisConfig: redis-external-config + storage: + volumeClaimTemplate: + spec: + # storageClassName: standard + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi + # nodeSelector: + # kubernetes.io/hostname: minikube + # priorityClassName: + # Affinity: + # Tolerations: [] diff --git a/example/v1beta1/redis-replication.yaml b/example/v1beta1/redis-replication.yaml new file mode 100644 index 000000000..5170612f9 --- /dev/null +++ b/example/v1beta1/redis-replication.yaml @@ -0,0 +1,60 @@ +--- +apiVersion: redis.redis.opstreelabs.in/v1beta1 +kind: RedisReplication +metadata: + name: redis-replication +spec: + clusterSize: 3 + securityContext: + runAsUser: 1000 + fsGroup: 1000 + # redisConfig: + # additionalRedisConfig: redis-external-config + kubernetesConfig: + image: quay.io/opstree/redis:v7.0.5 + imagePullPolicy: IfNotPresent + resources: + requests: + cpu: 101m + memory: 128Mi + limits: + cpu: 101m + memory: 128Mi + # redisSecret: + # name: redis-secret + # key: password + # imagePullSecrets: + # - name: regcred + redisExporter: + enabled: false + image: quay.io/opstree/redis-exporter:v1.44.0 + imagePullPolicy: Always + resources: + requests: + cpu: 100m + memory: 128Mi + limits: + cpu: 100m + memory: 128Mi +# Environment Variables for Redis Exporter + # env: + # - name: REDIS_EXPORTER_INCL_SYSTEM_METRICS + # value: "true" + # - name: UI_PROPERTIES_FILE_NAME + # valueFrom: + # configMapKeyRef: + # name: game-demo + # key: ui_properties_file_name + # - name: SECRET_USERNAME + # valueFrom: + # secretKeyRef: + # name: mysecret + # key: username + storage: + volumeClaimTemplate: + spec: + # storageClassName: standard + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi \ No newline at end of file diff --git a/example/v1beta1/redis-sentinel.yaml b/example/v1beta1/redis-sentinel.yaml new file mode 100644 index 000000000..4eec84b51 --- /dev/null +++ b/example/v1beta1/redis-sentinel.yaml @@ -0,0 +1,22 @@ +--- +apiVersion: redis.redis.opstreelabs.in/v1beta1 +kind: RedisSentinel +metadata: + name: redis-sentinel +spec: + clusterSize: 3 + securityContext: + runAsUser: 1000 + fsGroup: 1000 + redisSentinelConfig: + redisReplicationName : redis-replication + kubernetesConfig: + image: quay.io/opstree/redis-sentinel:v7.0.7 + imagePullPolicy: IfNotPresent + resources: + requests: + cpu: 101m + memory: 128Mi + limits: + cpu: 101m + memory: 128Mi diff --git a/example/v1beta1/redis-standalone.yaml b/example/v1beta1/redis-standalone.yaml new file mode 100644 index 000000000..00340ed64 --- /dev/null +++ b/example/v1beta1/redis-standalone.yaml @@ -0,0 +1,62 @@ +--- +apiVersion: redis.redis.opstreelabs.in/v1beta1 +kind: Redis +metadata: + name: redis-standalone +spec: + # redisConfig: + # additionalRedisConfig: redis-external-config + kubernetesConfig: + image: quay.io/opstree/redis:v7.0.5 + imagePullPolicy: IfNotPresent + resources: + requests: + cpu: 101m + memory: 128Mi + limits: + cpu: 101m + memory: 128Mi + # redisSecret: + # name: redis-secret + # key: password + # imagePullSecrets: + # - name: regcred + redisExporter: + enabled: false + image: quay.io/opstree/redis-exporter:v1.44.0 + imagePullPolicy: Always + resources: + requests: + cpu: 100m + memory: 128Mi + limits: + cpu: 100m + memory: 128Mi +# Environment Variables for Redis Exporter + # env: + # - name: REDIS_EXPORTER_INCL_SYSTEM_METRICS + # value: "true" + # - name: UI_PROPERTIES_FILE_NAME + # valueFrom: + # configMapKeyRef: + # name: game-demo + # key: ui_properties_file_name + # - name: SECRET_USERNAME + # valueFrom: + # secretKeyRef: + # name: mysecret + # key: username + storage: + volumeClaimTemplate: + spec: + # storageClassName: standard + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi + # nodeSelector: + # kubernetes.io/hostname: minikube + # securityContext: {} + # priorityClassName: + # affinity: + # Tolerations: [] diff --git a/example/v1beta1/redis_monitoring/clusterd.yaml b/example/v1beta1/redis_monitoring/clusterd.yaml new file mode 100644 index 000000000..119d86ef2 --- /dev/null +++ b/example/v1beta1/redis_monitoring/clusterd.yaml @@ -0,0 +1,29 @@ +--- +apiVersion: redis.redis.opstreelabs.in/v1beta1 +kind: RedisCluster +metadata: + name: redis-cluster +# annotations: +# rediscluster.opstreelabs.in/skip-reconcile: "true" +spec: + clusterSize: 3 + clusterVersion: v7 + securityContext: + runAsUser: 1000 + fsGroup: 1000 + persistenceEnabled: true + kubernetesConfig: + image: quay.io/opstree/redis:v7.0.5 + imagePullPolicy: Always + redisExporter: + enabled: true + image: quay.io/opstree/redis-exporter:v1.44.0 + imagePullPolicy: Always + storage: + volumeClaimTemplate: + spec: + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi + # storageClassName: standard diff --git a/example/redis_monitoring/replication.yaml b/example/v1beta1/redis_monitoring/replication.yaml similarity index 97% rename from example/redis_monitoring/replication.yaml rename to example/v1beta1/redis_monitoring/replication.yaml index a2a22ce2d..bf3602ae2 100644 --- a/example/redis_monitoring/replication.yaml +++ b/example/v1beta1/redis_monitoring/replication.yaml @@ -25,6 +25,6 @@ spec: # env: # - name: REDIS_EXPORTER_INCL_SYSTEM_METRICS # value: "true" - podSecurityContext: + securityContext: runAsUser: 1000 fsGroup: 1000 diff --git a/example/redis_monitoring/standalone.yaml b/example/v1beta1/redis_monitoring/standalone.yaml similarity index 96% rename from example/redis_monitoring/standalone.yaml rename to example/v1beta1/redis_monitoring/standalone.yaml index 4484970f9..500010068 100644 --- a/example/redis_monitoring/standalone.yaml +++ b/example/v1beta1/redis_monitoring/standalone.yaml @@ -24,6 +24,6 @@ spec: # env: # - name: REDIS_EXPORTER_INCL_SYSTEM_METRICS # value: "true" - podSecurityContext: + securityContext: runAsUser: 1000 fsGroup: 1000 diff --git a/example/redis_sentinel/sentinel.yaml b/example/v1beta1/redis_sentinel/sentinel.yaml similarity index 95% rename from example/redis_sentinel/sentinel.yaml rename to example/v1beta1/redis_sentinel/sentinel.yaml index 4e790b4e2..4eec84b51 100644 --- a/example/redis_sentinel/sentinel.yaml +++ b/example/v1beta1/redis_sentinel/sentinel.yaml @@ -5,7 +5,7 @@ metadata: name: redis-sentinel spec: clusterSize: 3 - podSecurityContext: + securityContext: runAsUser: 1000 fsGroup: 1000 redisSentinelConfig: diff --git a/example/v1beta1/tls_enabled/redis-cluster.yaml b/example/v1beta1/tls_enabled/redis-cluster.yaml new file mode 100644 index 000000000..2bda3bf2a --- /dev/null +++ b/example/v1beta1/tls_enabled/redis-cluster.yaml @@ -0,0 +1,51 @@ +--- +apiVersion: redis.redis.opstreelabs.in/v1beta1 +kind: RedisCluster +metadata: + name: redis-cluster +spec: + clusterSize: 3 + + TLS: + ca: ca.key + cert: tls.crt + key: tls.key + secret: + secretName: redis-tls-cert + clusterVersion: v7 + persistenceEnabled: true + securityContext: + runAsUser: 1000 + fsGroup: 1000 + kubernetesConfig: + image: quay.io/opstree/redis:v7.0.5 + imagePullPolicy: IfNotPresent + resources: + requests: + cpu: 101m + memory: 128Mi + limits: + cpu: 101m + memory: 128Mi + redisSecret: + name: redis-secret + key: password + + redisExporter: + enabled: false + image: quay.io/opstree/redis-exporter:v1.44.0 + imagePullPolicy: Always + resources: + requests: + cpu: 100m + memory: 128Mi + limits: + cpu: 100m + memory: 128Mi + storage: + volumeClaimTemplate: + spec: + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi diff --git a/example/tls_enabled/redis-replication.yaml b/example/v1beta1/tls_enabled/redis-replication.yaml similarity index 97% rename from example/tls_enabled/redis-replication.yaml rename to example/v1beta1/tls_enabled/redis-replication.yaml index ad722400d..ac8b34490 100644 --- a/example/tls_enabled/redis-replication.yaml +++ b/example/v1beta1/tls_enabled/redis-replication.yaml @@ -12,7 +12,7 @@ spec: key: tls.key secret: secretName: redis-tls-cert - podSecurityContext: + securityContext: runAsUser: 1000 fsGroup: 1000 kubernetesConfig: diff --git a/example/tls_enabled/redis-standalone.yaml b/example/v1beta1/tls_enabled/redis-standalone.yaml similarity index 97% rename from example/tls_enabled/redis-standalone.yaml rename to example/v1beta1/tls_enabled/redis-standalone.yaml index 3fea31c00..3e254fd65 100644 --- a/example/tls_enabled/redis-standalone.yaml +++ b/example/v1beta1/tls_enabled/redis-standalone.yaml @@ -11,7 +11,7 @@ spec: key: tls.key secret: secretName: redis-tls-cert - podSecurityContext: + securityContext: runAsUser: 1000 fsGroup: 1000 kubernetesConfig: diff --git a/example/v1beta1/tolerations/clusterd.yaml b/example/v1beta1/tolerations/clusterd.yaml new file mode 100644 index 000000000..77fe6a068 --- /dev/null +++ b/example/v1beta1/tolerations/clusterd.yaml @@ -0,0 +1,38 @@ +--- +apiVersion: redis.redis.opstreelabs.in/v1beta1 +kind: RedisCluster +metadata: + name: redis-cluster +spec: + clusterSize: 3 + clusterVersion: v7 + securityContext: + runAsUser: 1000 + fsGroup: 1000 + persistenceEnabled: true + kubernetesConfig: + image: quay.io/opstree/redis:v7.0.5 + imagePullPolicy: IfNotPresent + redisExporter: + enabled: false + image: quay.io/opstree/redis-exporter:v1.44.0 + redisLeader: + tolerations: + - key: "key1" + operator: "Equal" + value: "value1" + effect: "NoSchedule" + redisFollower: + tolerations: + - key: "key1" + operator: "Equal" + value: "value1" + effect: "NoSchedule" + storage: + volumeClaimTemplate: + spec: + # storageClassName: standard + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi diff --git a/example/tolerations/standalone.yaml b/example/v1beta1/tolerations/standalone.yaml similarity index 96% rename from example/tolerations/standalone.yaml rename to example/v1beta1/tolerations/standalone.yaml index 3f6362182..378409fa9 100644 --- a/example/tolerations/standalone.yaml +++ b/example/v1beta1/tolerations/standalone.yaml @@ -7,7 +7,7 @@ spec: kubernetesConfig: image: quay.io/opstree/redis:v7.0.5 imagePullPolicy: IfNotPresent - podSecurityContext: + securityContext: runAsUser: 1000 fsGroup: 1000 storage: diff --git a/example/v1beta1/upgrade-strategy/clusterd.yaml b/example/v1beta1/upgrade-strategy/clusterd.yaml new file mode 100644 index 000000000..32e7cd7f0 --- /dev/null +++ b/example/v1beta1/upgrade-strategy/clusterd.yaml @@ -0,0 +1,29 @@ +--- +apiVersion: redis.redis.opstreelabs.in/v1beta1 +kind: RedisCluster +metadata: + name: redis-cluster +spec: + clusterSize: 3 + clusterVersion: v7 + securityContext: + runAsUser: 1000 + fsGroup: 1000 + persistenceEnabled: true + kubernetesConfig: + image: quay.io/opstree/redis:v7.0.5 + imagePullPolicy: IfNotPresent + updateStrategy: + type: OnDelete + # type: RollingUpdate + redisExporter: + enabled: false + image: quay.io/opstree/redis-exporter:v1.44.0 + storage: + volumeClaimTemplate: + spec: + # storageClassName: standard + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi diff --git a/example/upgrade-strategy/standalone.yaml b/example/v1beta1/upgrade-strategy/standalone.yaml similarity index 96% rename from example/upgrade-strategy/standalone.yaml rename to example/v1beta1/upgrade-strategy/standalone.yaml index 9038464cc..bfc1b445e 100644 --- a/example/upgrade-strategy/standalone.yaml +++ b/example/v1beta1/upgrade-strategy/standalone.yaml @@ -10,7 +10,7 @@ spec: updateStrategy: type: OnDelete # type: RollingUpdate - podSecurityContext: + securityContext: runAsUser: 1000 fsGroup: 1000 storage: diff --git a/example/volume_mount/configmap.yaml b/example/v1beta1/volume_mount/configmap.yaml similarity index 100% rename from example/volume_mount/configmap.yaml rename to example/v1beta1/volume_mount/configmap.yaml diff --git a/example/v1beta1/volume_mount/redis-cluster.yaml b/example/v1beta1/volume_mount/redis-cluster.yaml new file mode 100644 index 000000000..1b74ee260 --- /dev/null +++ b/example/v1beta1/volume_mount/redis-cluster.yaml @@ -0,0 +1,53 @@ +apiVersion: redis.redis.opstreelabs.in/v1beta1 +kind: RedisCluster +metadata: + name: redis-cluster +spec: + clusterSize: 3 + clusterVersion: v7 + persistenceEnabled: true + securityContext: + runAsUser: 1000 + fsGroup: 1000 + kubernetesConfig: + image: quay.io/opstree/redis:v7.0.5 + imagePullPolicy: IfNotPresent + resources: + requests: + cpu: 101m + memory: 128Mi + limits: + cpu: 101m + memory: 128Mi + redisSecret: + name: redis-secret + key: password + # imagePullSecrets: + # - name: regcred + redisExporter: + enabled: false + image: quay.io/opstree/redis-exporter:v1.44.0 + imagePullPolicy: Always + resources: + requests: + cpu: 100m + memory: 128Mi + limits: + cpu: 100m + memory: 128Mi + storage: + volumeClaimTemplate: + spec: + # storageClassName: standard + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi + volumemount: + volume: + - name: example-config + configMap: + name: example-configmap + mount: + - mountPath: /config + name: example-config \ No newline at end of file diff --git a/example/volume_mount/redis-replication.yaml b/example/v1beta1/volume_mount/redis-replication.yaml similarity index 100% rename from example/volume_mount/redis-replication.yaml rename to example/v1beta1/volume_mount/redis-replication.yaml diff --git a/example/volume_mount/redis-standalone.yaml b/example/v1beta1/volume_mount/redis-standalone.yaml similarity index 100% rename from example/volume_mount/redis-standalone.yaml rename to example/v1beta1/volume_mount/redis-standalone.yaml diff --git a/example/acl_config/acl-secret.yaml b/example/v1beta2/acl_config/acl-secret.yaml similarity index 100% rename from example/acl_config/acl-secret.yaml rename to example/v1beta2/acl_config/acl-secret.yaml diff --git a/example/acl_config/cluster.yaml b/example/v1beta2/acl_config/cluster.yaml similarity index 96% rename from example/acl_config/cluster.yaml rename to example/v1beta2/acl_config/cluster.yaml index 5f025c9ae..70671263f 100644 --- a/example/acl_config/cluster.yaml +++ b/example/v1beta2/acl_config/cluster.yaml @@ -1,5 +1,5 @@ --- -apiVersion: redis.redis.opstreelabs.in/v1beta1 +apiVersion: redis.redis.opstreelabs.in/v1beta2 kind: RedisCluster metadata: name: redis-cluster diff --git a/example/acl_config/replication.yaml b/example/v1beta2/acl_config/replication.yaml similarity index 95% rename from example/acl_config/replication.yaml rename to example/v1beta2/acl_config/replication.yaml index c30998e1a..fbc8d0ccc 100644 --- a/example/acl_config/replication.yaml +++ b/example/v1beta2/acl_config/replication.yaml @@ -1,5 +1,5 @@ --- -apiVersion: redis.redis.opstreelabs.in/v1beta1 +apiVersion: redis.redis.opstreelabs.in/v1beta2 kind: RedisReplication metadata: name: redis-replication diff --git a/example/acl_config/standalone.yaml b/example/v1beta2/acl_config/standalone.yaml similarity index 95% rename from example/acl_config/standalone.yaml rename to example/v1beta2/acl_config/standalone.yaml index a711260cd..f586f9727 100644 --- a/example/acl_config/standalone.yaml +++ b/example/v1beta2/acl_config/standalone.yaml @@ -1,5 +1,5 @@ --- -apiVersion: redis.redis.opstreelabs.in/v1beta1 +apiVersion: redis.redis.opstreelabs.in/v1beta2 kind: Redis metadata: name: redis-standalone diff --git a/example/acl_config/user.acl b/example/v1beta2/acl_config/user.acl similarity index 100% rename from example/acl_config/user.acl rename to example/v1beta2/acl_config/user.acl diff --git a/example/additional_config/clusterd.yaml b/example/v1beta2/additional_config/clusterd.yaml similarity index 94% rename from example/additional_config/clusterd.yaml rename to example/v1beta2/additional_config/clusterd.yaml index a02e2c6a4..fa1f21078 100644 --- a/example/additional_config/clusterd.yaml +++ b/example/v1beta2/additional_config/clusterd.yaml @@ -1,5 +1,5 @@ --- -apiVersion: redis.redis.opstreelabs.in/v1beta1 +apiVersion: redis.redis.opstreelabs.in/v1beta2 kind: RedisCluster metadata: name: redis-cluster diff --git a/example/v1beta2/additional_config/configmap.yaml b/example/v1beta2/additional_config/configmap.yaml new file mode 100644 index 000000000..f68ea80ac --- /dev/null +++ b/example/v1beta2/additional_config/configmap.yaml @@ -0,0 +1,10 @@ +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: redis-external-config +data: + redis-additional.conf: | + tcp-keepalive 400 + slowlog-max-len 158 + stream-node-max-bytes 2048 diff --git a/example/v1beta2/additional_config/replication.yaml b/example/v1beta2/additional_config/replication.yaml new file mode 100644 index 000000000..1f1aad416 --- /dev/null +++ b/example/v1beta2/additional_config/replication.yaml @@ -0,0 +1,26 @@ +--- +apiVersion: redis.redis.opstreelabs.in/v1beta2 +kind: RedisReplication +metadata: + name: redis-replication +spec: + clusterSize: 3 + redisConfig: + additionalRedisConfig: redis-external-config + kubernetesConfig: + image: quay.io/opstree/redis:v7.0.5 + imagePullPolicy: IfNotPresent + podSecurityContext: + runAsUser: 1000 + fsGroup: 1000 + storage: + volumeClaimTemplate: + spec: + # storageClassName: standard + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi + redisExporter: + enabled: false + image: quay.io/opstree/redis-exporter:v1.44.0 diff --git a/example/v1beta2/additional_config/standalone.yaml b/example/v1beta2/additional_config/standalone.yaml new file mode 100644 index 000000000..2a1cacb70 --- /dev/null +++ b/example/v1beta2/additional_config/standalone.yaml @@ -0,0 +1,25 @@ +--- +apiVersion: redis.redis.opstreelabs.in/v1beta2 +kind: Redis +metadata: + name: redis-standalone +spec: + redisConfig: + additionalRedisConfig: redis-external-config + kubernetesConfig: + image: quay.io/opstree/redis:v7.0.5 + imagePullPolicy: IfNotPresent + podSecurityContext: + runAsUser: 1000 + fsGroup: 1000 + storage: + volumeClaimTemplate: + spec: + # storageClassName: standard + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi + redisExporter: + enabled: false + image: quay.io/opstree/redis-exporter:v1.44.0 diff --git a/example/advance_config/clusterd.yaml b/example/v1beta2/advance_config/clusterd.yaml similarity index 95% rename from example/advance_config/clusterd.yaml rename to example/v1beta2/advance_config/clusterd.yaml index 0bd59383a..8390e5589 100644 --- a/example/advance_config/clusterd.yaml +++ b/example/v1beta2/advance_config/clusterd.yaml @@ -1,5 +1,5 @@ --- -apiVersion: redis.redis.opstreelabs.in/v1beta1 +apiVersion: redis.redis.opstreelabs.in/v1beta2 kind: RedisCluster metadata: name: redis-cluster diff --git a/example/advance_config/standalone.yaml b/example/v1beta2/advance_config/standalone.yaml similarity index 93% rename from example/advance_config/standalone.yaml rename to example/v1beta2/advance_config/standalone.yaml index 3d4fb7b93..88fb2ec4a 100644 --- a/example/advance_config/standalone.yaml +++ b/example/v1beta2/advance_config/standalone.yaml @@ -1,5 +1,5 @@ --- -apiVersion: redis.redis.opstreelabs.in/v1beta1 +apiVersion: redis.redis.opstreelabs.in/v1beta2 kind: Redis metadata: name: redis-standalone diff --git a/example/affinity/clusterd.yaml b/example/v1beta2/affinity/clusterd.yaml similarity index 96% rename from example/affinity/clusterd.yaml rename to example/v1beta2/affinity/clusterd.yaml index 6b9bdd541..d1c555efe 100644 --- a/example/affinity/clusterd.yaml +++ b/example/v1beta2/affinity/clusterd.yaml @@ -1,5 +1,5 @@ --- -apiVersion: redis.redis.opstreelabs.in/v1beta1 +apiVersion: redis.redis.opstreelabs.in/v1beta2 kind: RedisCluster metadata: name: redis-cluster diff --git a/example/v1beta2/affinity/replication.yaml b/example/v1beta2/affinity/replication.yaml new file mode 100644 index 000000000..82da8e355 --- /dev/null +++ b/example/v1beta2/affinity/replication.yaml @@ -0,0 +1,34 @@ +--- +apiVersion: redis.redis.opstreelabs.in/v1beta2 +kind: RedisReplication +metadata: + name: redis-replication +spec: + clusterSize: 3 + kubernetesConfig: + image: quay.io/opstree/redis:v7.0.5 + imagePullPolicy: IfNotPresent + podSecurityContext: + runAsUser: 1000 + fsGroup: 1000 + storage: + volumeClaimTemplate: + spec: + # storageClassName: standard + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi + redisExporter: + enabled: false + image: quay.io/opstree/redis-exporter:v1.44.0 + affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: app + operator: In + values: + - redis-replication + topologyKey: "kubernetes.io/hostname" diff --git a/example/v1beta2/affinity/standalone.yaml b/example/v1beta2/affinity/standalone.yaml new file mode 100644 index 000000000..22b6c39a5 --- /dev/null +++ b/example/v1beta2/affinity/standalone.yaml @@ -0,0 +1,33 @@ +--- +apiVersion: redis.redis.opstreelabs.in/v1beta2 +kind: Redis +metadata: + name: redis-standalone +spec: + kubernetesConfig: + image: quay.io/opstree/redis:v7.0.5 + imagePullPolicy: IfNotPresent + podSecurityContext: + runAsUser: 1000 + fsGroup: 1000 + storage: + volumeClaimTemplate: + spec: + # storageClassName: standard + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi + redisExporter: + enabled: false + image: quay.io/opstree/redis-exporter:v1.44.0 + affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: app + operator: In + values: + - redis-standalone + topologyKey: "kubernetes.io/hostname" diff --git a/example/backup_restore/configmap.yaml b/example/v1beta2/backup_restore/configmap.yaml similarity index 100% rename from example/backup_restore/configmap.yaml rename to example/v1beta2/backup_restore/configmap.yaml diff --git a/example/backup_restore/env-secret.yaml b/example/v1beta2/backup_restore/env-secret.yaml similarity index 100% rename from example/backup_restore/env-secret.yaml rename to example/v1beta2/backup_restore/env-secret.yaml diff --git a/example/backup_restore/redis-cluster.yaml b/example/v1beta2/backup_restore/redis-cluster.yaml similarity index 98% rename from example/backup_restore/redis-cluster.yaml rename to example/v1beta2/backup_restore/redis-cluster.yaml index 150b041d2..8744c451f 100644 --- a/example/backup_restore/redis-cluster.yaml +++ b/example/v1beta2/backup_restore/redis-cluster.yaml @@ -1,5 +1,5 @@ --- -apiVersion: redis.redis.opstreelabs.in/v1beta1 +apiVersion: redis.redis.opstreelabs.in/v1beta2 kind: RedisCluster metadata: name: redis-cluster diff --git a/example/disruption_budget/clusterd.yaml b/example/v1beta2/disruption_budget/clusterd.yaml similarity index 97% rename from example/disruption_budget/clusterd.yaml rename to example/v1beta2/disruption_budget/clusterd.yaml index f1de2aeab..d58ba0db2 100644 --- a/example/disruption_budget/clusterd.yaml +++ b/example/v1beta2/disruption_budget/clusterd.yaml @@ -1,5 +1,5 @@ --- -apiVersion: redis.redis.opstreelabs.in/v1beta1 +apiVersion: redis.redis.opstreelabs.in/v1beta2 kind: RedisCluster metadata: name: redis-cluster diff --git a/example/v1beta2/eks-cluster.yaml b/example/v1beta2/eks-cluster.yaml new file mode 100644 index 000000000..4474537e3 --- /dev/null +++ b/example/v1beta2/eks-cluster.yaml @@ -0,0 +1,26 @@ +apiVersion: eksctl.io/v1alpha5 +kind: ClusterConfig +metadata: + name: operator-testing + region: us-west-2 + version: "1.22" +managedNodeGroups: + - name: ng-1 + instanceType: t3a.medium + desiredCapacity: 3 + volumeSize: 30 + ssh: + allow: true + volumeType: gp3 +kubernetesNetworkConfig: + ipFamily: IPv4 +# ipFamily: IPv6 +addons: + - name: vpc-cni + - name: coredns + - name: kube-proxy + - name: aws-ebs-csi-driver + attachPolicyARNs: + - arn:aws:iam::aws:policy/service-role/AmazonEBSCSIDriverPolicy +iam: + withOIDC: true diff --git a/example/v1beta2/external_service/cluster-svc.yaml b/example/v1beta2/external_service/cluster-svc.yaml new file mode 100644 index 000000000..8e68ca75f --- /dev/null +++ b/example/v1beta2/external_service/cluster-svc.yaml @@ -0,0 +1,44 @@ +--- +apiVersion: v1 +kind: Service +metadata: + labels: + app: redis-cluster-leader + redis_setup_type: cluster + role: leader + name: redis-cluster-leaders +spec: + clusterIP: 10.102.152.77 + ports: + - name: redis-client + port: 6379 + protocol: TCP + targetPort: 6379 + selector: + app: redis-cluster-leader + redis_setup_type: cluster + role: leader +# type: LoadBalancer + type: NodePort +--- +apiVersion: v1 +kind: Service +metadata: + labels: + app: redis-cluster-follower + redis_setup_type: cluster + role: follower + name: redis-cluster-followers +spec: + clusterIP: 10.108.109.134 + ports: + - name: redis-client + port: 6379 + protocol: TCP + targetPort: 6379 + selector: + app: redis-cluster-follower + redis_setup_type: cluster + role: follower +# type: LoadBalancer + type: NodePort diff --git a/example/external_service/clusterd.yaml b/example/v1beta2/external_service/clusterd.yaml similarity index 93% rename from example/external_service/clusterd.yaml rename to example/v1beta2/external_service/clusterd.yaml index 4bc986da5..fb7da8bf8 100644 --- a/example/external_service/clusterd.yaml +++ b/example/v1beta2/external_service/clusterd.yaml @@ -1,5 +1,5 @@ --- -apiVersion: redis.redis.opstreelabs.in/v1beta1 +apiVersion: redis.redis.opstreelabs.in/v1beta2 kind: RedisCluster metadata: name: redis-cluster diff --git a/example/v1beta2/external_service/replication-svc.yaml b/example/v1beta2/external_service/replication-svc.yaml new file mode 100644 index 000000000..5e412de80 --- /dev/null +++ b/example/v1beta2/external_service/replication-svc.yaml @@ -0,0 +1,21 @@ +--- +apiVersion: v1 +kind: Service +metadata: + labels: + app: redis-replication + redis_setup_type: replication + role: replication + name: redis-replication +spec: + ports: + - name: redis-client + port: 6379 + protocol: TCP + targetPort: 6379 + selector: + app: redis-replication + redis_setup_type: replication + role: replication +# type: LoadBalancer + type: NodePort diff --git a/example/v1beta2/external_service/replication.yaml b/example/v1beta2/external_service/replication.yaml new file mode 100644 index 000000000..d8fa554e7 --- /dev/null +++ b/example/v1beta2/external_service/replication.yaml @@ -0,0 +1,24 @@ +--- +apiVersion: redis.redis.opstreelabs.in/v1beta2 +kind: RedisReplication +metadata: + name: redis-replication +spec: + clusterSize: 3 + kubernetesConfig: + image: quay.io/opstree/redis:v7.0.5 + imagePullPolicy: IfNotPresent + podSecurityContext: + runAsUser: 1000 + fsGroup: 1000 + storage: + volumeClaimTemplate: + spec: + # storageClassName: standard + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi + redisExporter: + enabled: false + image: quay.io/opstree/redis-exporter:v1.44.0 diff --git a/example/v1beta2/external_service/standalone-svc.yaml b/example/v1beta2/external_service/standalone-svc.yaml new file mode 100644 index 000000000..df4efe038 --- /dev/null +++ b/example/v1beta2/external_service/standalone-svc.yaml @@ -0,0 +1,21 @@ +--- +apiVersion: v1 +kind: Service +metadata: + labels: + app: redis-standalone + redis_setup_type: standalone + role: standalone + name: redis-standalone +spec: + ports: + - name: redis-client + port: 6379 + protocol: TCP + targetPort: 6379 + selector: + app: redis-standalone + redis_setup_type: standalone + role: standalone +# type: LoadBalancer + type: NodePort diff --git a/example/v1beta2/external_service/standalone.yaml b/example/v1beta2/external_service/standalone.yaml new file mode 100644 index 000000000..2eb1d3ab6 --- /dev/null +++ b/example/v1beta2/external_service/standalone.yaml @@ -0,0 +1,23 @@ +--- +apiVersion: redis.redis.opstreelabs.in/v1beta2 +kind: Redis +metadata: + name: redis-standalone +spec: + kubernetesConfig: + image: quay.io/opstree/redis:v7.0.5 + imagePullPolicy: IfNotPresent + podSecurityContext: + runAsUser: 1000 + fsGroup: 1000 + storage: + volumeClaimTemplate: + spec: + # storageClassName: standard + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi + redisExporter: + enabled: false + image: quay.io/opstree/redis-exporter:v1.44.0 diff --git a/example/node-selector/clusterd.yaml b/example/v1beta2/node-selector/clusterd.yaml similarity index 94% rename from example/node-selector/clusterd.yaml rename to example/v1beta2/node-selector/clusterd.yaml index 82b4ccf7b..ff4cd4b5c 100644 --- a/example/node-selector/clusterd.yaml +++ b/example/v1beta2/node-selector/clusterd.yaml @@ -1,5 +1,5 @@ --- -apiVersion: redis.redis.opstreelabs.in/v1beta1 +apiVersion: redis.redis.opstreelabs.in/v1beta2 kind: RedisCluster metadata: name: redis-cluster diff --git a/example/v1beta2/node-selector/replication.yaml b/example/v1beta2/node-selector/replication.yaml new file mode 100644 index 000000000..5d9c08cb6 --- /dev/null +++ b/example/v1beta2/node-selector/replication.yaml @@ -0,0 +1,26 @@ +--- +apiVersion: redis.redis.opstreelabs.in/v1beta2 +kind: RedisReplication +metadata: + name: redis-replication +spec: + clusterSize: 3 + kubernetesConfig: + image: quay.io/opstree/redis:v7.0.5 + imagePullPolicy: IfNotPresent + podSecurityContext: + runAsUser: 1000 + fsGroup: 1000 + storage: + volumeClaimTemplate: + spec: + # storageClassName: standard + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi + redisExporter: + enabled: false + image: quay.io/opstree/redis-exporter:v1.44.0 + nodeSelector: + kubernetes.io/os: linux diff --git a/example/v1beta2/node-selector/standalone.yaml b/example/v1beta2/node-selector/standalone.yaml new file mode 100644 index 000000000..16c5b73cc --- /dev/null +++ b/example/v1beta2/node-selector/standalone.yaml @@ -0,0 +1,25 @@ +--- +apiVersion: redis.redis.opstreelabs.in/v1beta2 +kind: Redis +metadata: + name: redis-standalone +spec: + kubernetesConfig: + image: quay.io/opstree/redis:v7.0.5 + imagePullPolicy: IfNotPresent + podSecurityContext: + runAsUser: 1000 + fsGroup: 1000 + storage: + volumeClaimTemplate: + spec: + # storageClassName: standard + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi + redisExporter: + enabled: false + image: quay.io/opstree/redis-exporter:v1.44.0 + nodeSelector: + kubernetes.io/os: linux diff --git a/example/password_protected/clusterd.yaml b/example/v1beta2/password_protected/clusterd.yaml similarity index 94% rename from example/password_protected/clusterd.yaml rename to example/v1beta2/password_protected/clusterd.yaml index 18cbf4900..9a1c54de3 100644 --- a/example/password_protected/clusterd.yaml +++ b/example/v1beta2/password_protected/clusterd.yaml @@ -1,5 +1,5 @@ --- -apiVersion: redis.redis.opstreelabs.in/v1beta1 +apiVersion: redis.redis.opstreelabs.in/v1beta2 kind: RedisCluster metadata: name: redis-cluster diff --git a/example/v1beta2/password_protected/replication.yaml b/example/v1beta2/password_protected/replication.yaml new file mode 100644 index 000000000..074d8c2ff --- /dev/null +++ b/example/v1beta2/password_protected/replication.yaml @@ -0,0 +1,27 @@ +--- +apiVersion: redis.redis.opstreelabs.in/v1beta2 +kind: RedisReplication +metadata: + name: redis-replication +spec: + clusterSize: 3 + kubernetesConfig: + image: quay.io/opstree/redis:v7.0.5 + imagePullPolicy: IfNotPresent + redisSecret: + name: redis-secret + key: password + storage: + volumeClaimTemplate: + spec: + # storageClassName: standard + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi + redisExporter: + enabled: false + image: quay.io/opstree/redis-exporter:v1.44.0 + podSecurityContext: + runAsUser: 1000 + fsGroup: 1000 diff --git a/example/v1beta2/password_protected/secret.yaml b/example/v1beta2/password_protected/secret.yaml new file mode 100644 index 000000000..2a91c0d81 --- /dev/null +++ b/example/v1beta2/password_protected/secret.yaml @@ -0,0 +1,8 @@ +--- +apiVersion: v1 +kind: Secret +metadata: + name: redis-secret +data: + password: T3BzdHJlZUAxMjM0Cg== +type: Opaque \ No newline at end of file diff --git a/example/v1beta2/password_protected/standalone.yaml b/example/v1beta2/password_protected/standalone.yaml new file mode 100644 index 000000000..5c223cc5f --- /dev/null +++ b/example/v1beta2/password_protected/standalone.yaml @@ -0,0 +1,26 @@ +--- +apiVersion: redis.redis.opstreelabs.in/v1beta2 +kind: Redis +metadata: + name: redis-standalone +spec: + kubernetesConfig: + image: quay.io/opstree/redis:v7.0.5 + imagePullPolicy: IfNotPresent + redisSecret: + name: redis-secret + key: password + storage: + volumeClaimTemplate: + spec: + # storageClassName: standard + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi + redisExporter: + enabled: false + image: quay.io/opstree/redis-exporter:v1.44.0 + podSecurityContext: + runAsUser: 1000 + fsGroup: 1000 diff --git a/example/private_registry/clusterd.yaml b/example/v1beta2/private_registry/clusterd.yaml similarity index 94% rename from example/private_registry/clusterd.yaml rename to example/v1beta2/private_registry/clusterd.yaml index 9202d2dd4..da1430ab4 100644 --- a/example/private_registry/clusterd.yaml +++ b/example/v1beta2/private_registry/clusterd.yaml @@ -1,5 +1,5 @@ --- -apiVersion: redis.redis.opstreelabs.in/v1beta1 +apiVersion: redis.redis.opstreelabs.in/v1beta2 kind: RedisCluster metadata: name: redis-cluster diff --git a/example/v1beta2/private_registry/replication.yaml b/example/v1beta2/private_registry/replication.yaml new file mode 100644 index 000000000..03defed0a --- /dev/null +++ b/example/v1beta2/private_registry/replication.yaml @@ -0,0 +1,26 @@ +--- +apiVersion: redis.redis.opstreelabs.in/v1beta2 +kind: RedisReplication +metadata: + name: redis-replication +spec: + clusterSize: 3 + kubernetesConfig: + image: quay.io/opstree/redis:v7.0.5 + imagePullPolicy: IfNotPresent + imagePullSecrets: + - name: regcred + storage: + volumeClaimTemplate: + spec: + # storageClassName: standard + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi + redisExporter: + enabled: false + image: quay.io/opstree/redis-exporter:v1.44.0 + podSecurityContext: + runAsUser: 1000 + fsGroup: 1000 diff --git a/example/v1beta2/private_registry/standalone.yaml b/example/v1beta2/private_registry/standalone.yaml new file mode 100644 index 000000000..35ae6b94d --- /dev/null +++ b/example/v1beta2/private_registry/standalone.yaml @@ -0,0 +1,25 @@ +--- +apiVersion: redis.redis.opstreelabs.in/v1beta2 +kind: Redis +metadata: + name: redis-standalone +spec: + kubernetesConfig: + image: quay.io/opstree/redis:v7.0.5 + imagePullPolicy: IfNotPresent + imagePullSecrets: + - name: regcred + storage: + volumeClaimTemplate: + spec: + # storageClassName: standard + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi + redisExporter: + enabled: false + image: quay.io/opstree/redis-exporter:v1.44.0 + podSecurityContext: + runAsUser: 1000 + fsGroup: 1000 diff --git a/example/probes/clusterd.yaml b/example/v1beta2/probes/clusterd.yaml similarity index 96% rename from example/probes/clusterd.yaml rename to example/v1beta2/probes/clusterd.yaml index 981483c08..ff4741c98 100644 --- a/example/probes/clusterd.yaml +++ b/example/v1beta2/probes/clusterd.yaml @@ -1,5 +1,5 @@ --- -apiVersion: redis.redis.opstreelabs.in/v1beta1 +apiVersion: redis.redis.opstreelabs.in/v1beta2 kind: RedisCluster metadata: name: redis-cluster diff --git a/example/v1beta2/probes/replication.yaml b/example/v1beta2/probes/replication.yaml new file mode 100644 index 000000000..e0b525882 --- /dev/null +++ b/example/v1beta2/probes/replication.yaml @@ -0,0 +1,36 @@ +--- +apiVersion: redis.redis.opstreelabs.in/v1beta2 +kind: RedisReplication +metadata: + name: redis-replication +spec: + clusterSize: 3 + podSecurityContext: + runAsUser: 1000 + fsGroup: 1000 + kubernetesConfig: + image: quay.io/opstree/redis:v7.0.5 + imagePullPolicy: IfNotPresent + storage: + volumeClaimTemplate: + spec: + # storageClassName: standard + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi + redisExporter: + enabled: false + image: quay.io/opstree/redis-exporter:v1.44.0 + readinessProbe: + failureThreshold: 5 + initialDelaySeconds: 15 + periodSeconds: 15 + successThreshold: 1 + timeoutSeconds: 5 + livenessProbe: + failureThreshold: 5 + initialDelaySeconds: 15 + periodSeconds: 15 + successThreshold: 1 + timeoutSeconds: 5 diff --git a/example/v1beta2/probes/standalone.yaml b/example/v1beta2/probes/standalone.yaml new file mode 100644 index 000000000..632c18d53 --- /dev/null +++ b/example/v1beta2/probes/standalone.yaml @@ -0,0 +1,35 @@ +--- +apiVersion: redis.redis.opstreelabs.in/v1beta2 +kind: Redis +metadata: + name: redis-standalone +spec: + podSecurityContext: + runAsUser: 1000 + fsGroup: 1000 + kubernetesConfig: + image: quay.io/opstree/redis:v7.0.5 + imagePullPolicy: IfNotPresent + storage: + volumeClaimTemplate: + spec: + # storageClassName: standard + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi + redisExporter: + enabled: false + image: quay.io/opstree/redis-exporter:v1.44.0 + readinessProbe: + failureThreshold: 5 + initialDelaySeconds: 15 + periodSeconds: 15 + successThreshold: 1 + timeoutSeconds: 5 + livenessProbe: + failureThreshold: 5 + initialDelaySeconds: 15 + periodSeconds: 15 + successThreshold: 1 + timeoutSeconds: 5 diff --git a/example/recreate-statefulset/clusterd.yaml b/example/v1beta2/recreate-statefulset/clusterd.yaml similarity index 94% rename from example/recreate-statefulset/clusterd.yaml rename to example/v1beta2/recreate-statefulset/clusterd.yaml index cf7098e15..028271cab 100644 --- a/example/recreate-statefulset/clusterd.yaml +++ b/example/v1beta2/recreate-statefulset/clusterd.yaml @@ -1,5 +1,5 @@ --- -apiVersion: redis.redis.opstreelabs.in/v1beta1 +apiVersion: redis.redis.opstreelabs.in/v1beta2 kind: RedisCluster metadata: name: redis-cluster diff --git a/example/v1beta2/recreate-statefulset/replication.yaml b/example/v1beta2/recreate-statefulset/replication.yaml new file mode 100644 index 000000000..127833fc7 --- /dev/null +++ b/example/v1beta2/recreate-statefulset/replication.yaml @@ -0,0 +1,27 @@ +--- +apiVersion: redis.redis.opstreelabs.in/v1beta2 +kind: RedisReplication +metadata: + name: redis-replication + annotations: + redis.opstreelabs.in/recreate-statefulset: "true" +spec: + clusterSize: 3 + kubernetesConfig: + image: quay.io/opstree/redis:v7.0.5 + imagePullPolicy: IfNotPresent + podSecurityContext: + runAsUser: 1000 + fsGroup: 1000 + storage: + volumeClaimTemplate: + spec: + # storageClassName: standard + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi + redisExporter: + enabled: false + image: quay.io/opstree/redis-exporter:v1.44.0 + priorityClassName: system-cluster-critical diff --git a/example/v1beta2/recreate-statefulset/standalone.yaml b/example/v1beta2/recreate-statefulset/standalone.yaml new file mode 100644 index 000000000..8ff47e8ab --- /dev/null +++ b/example/v1beta2/recreate-statefulset/standalone.yaml @@ -0,0 +1,26 @@ +--- +apiVersion: redis.redis.opstreelabs.in/v1beta2 +kind: Redis +metadata: + name: redis-standalone + annotations: + redis.opstreelabs.in/recreate-statefulset: "true" +spec: + kubernetesConfig: + image: quay.io/opstree/redis:v7.0.5 + imagePullPolicy: IfNotPresent + podSecurityContext: + runAsUser: 1000 + fsGroup: 1000 + storage: + volumeClaimTemplate: + spec: + # storageClassName: standard + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi + redisExporter: + enabled: false + image: quay.io/opstree/redis-exporter:v1.44.0 + priorityClassName: system-cluster-critical diff --git a/example/redis-cluster.yaml b/example/v1beta2/redis-cluster.yaml similarity index 97% rename from example/redis-cluster.yaml rename to example/v1beta2/redis-cluster.yaml index cfde99863..f32a8f4a5 100644 --- a/example/redis-cluster.yaml +++ b/example/v1beta2/redis-cluster.yaml @@ -1,5 +1,5 @@ --- -apiVersion: redis.redis.opstreelabs.in/v1beta1 +apiVersion: redis.redis.opstreelabs.in/v1beta2 kind: RedisCluster metadata: name: redis-cluster diff --git a/example/redis-replication.yaml b/example/v1beta2/redis-replication.yaml similarity index 96% rename from example/redis-replication.yaml rename to example/v1beta2/redis-replication.yaml index db96e4c0c..aab7d798c 100644 --- a/example/redis-replication.yaml +++ b/example/v1beta2/redis-replication.yaml @@ -1,5 +1,5 @@ --- -apiVersion: redis.redis.opstreelabs.in/v1beta1 +apiVersion: redis.redis.opstreelabs.in/v1beta2 kind: RedisReplication metadata: name: redis-replication diff --git a/example/redis-sentinel.yaml b/example/v1beta2/redis-sentinel.yaml similarity index 91% rename from example/redis-sentinel.yaml rename to example/v1beta2/redis-sentinel.yaml index 7692e7e09..cd9a3a4ec 100644 --- a/example/redis-sentinel.yaml +++ b/example/v1beta2/redis-sentinel.yaml @@ -1,5 +1,5 @@ --- -apiVersion: redis.redis.opstreelabs.in/v1beta1 +apiVersion: redis.redis.opstreelabs.in/v1beta2 kind: RedisSentinel metadata: name: redis-sentinel diff --git a/example/redis-standalone.yaml b/example/v1beta2/redis-standalone.yaml similarity index 96% rename from example/redis-standalone.yaml rename to example/v1beta2/redis-standalone.yaml index 88632f7e1..f2aa1aa70 100644 --- a/example/redis-standalone.yaml +++ b/example/v1beta2/redis-standalone.yaml @@ -1,5 +1,5 @@ --- -apiVersion: redis.redis.opstreelabs.in/v1beta1 +apiVersion: redis.redis.opstreelabs.in/v1beta2 kind: Redis metadata: name: redis-standalone diff --git a/example/redis_monitoring/clusterd.yaml b/example/v1beta2/redis_monitoring/clusterd.yaml similarity index 94% rename from example/redis_monitoring/clusterd.yaml rename to example/v1beta2/redis_monitoring/clusterd.yaml index 617f9c3a2..7a8a08276 100644 --- a/example/redis_monitoring/clusterd.yaml +++ b/example/v1beta2/redis_monitoring/clusterd.yaml @@ -1,5 +1,5 @@ --- -apiVersion: redis.redis.opstreelabs.in/v1beta1 +apiVersion: redis.redis.opstreelabs.in/v1beta2 kind: RedisCluster metadata: name: redis-cluster diff --git a/example/v1beta2/redis_monitoring/replication.yaml b/example/v1beta2/redis_monitoring/replication.yaml new file mode 100644 index 000000000..02b9bc498 --- /dev/null +++ b/example/v1beta2/redis_monitoring/replication.yaml @@ -0,0 +1,30 @@ +--- +apiVersion: redis.redis.opstreelabs.in/v1beta2 +kind: RedisReplication +metadata: + name: redis-replication +# annotations: +# redis.opstreelabs.in/skip-reconcile: "true" +spec: + clusterSize: 3 + kubernetesConfig: + image: quay.io/opstree/redis:v7.0.5 + imagePullPolicy: IfNotPresent + storage: + volumeClaimTemplate: + spec: + # storageClassName: standard + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi + redisExporter: + enabled: true + image: quay.io/opstree/redis-exporter:v1.44.0 + imagePullPolicy: Always + # env: + # - name: REDIS_EXPORTER_INCL_SYSTEM_METRICS + # value: "true" + podSecurityContext: + runAsUser: 1000 + fsGroup: 1000 diff --git a/example/v1beta2/redis_monitoring/standalone.yaml b/example/v1beta2/redis_monitoring/standalone.yaml new file mode 100644 index 000000000..1753c2558 --- /dev/null +++ b/example/v1beta2/redis_monitoring/standalone.yaml @@ -0,0 +1,29 @@ +--- +apiVersion: redis.redis.opstreelabs.in/v1beta2 +kind: Redis +metadata: + name: redis-standalone +# annotations: +# redis.opstreelabs.in/skip-reconcile: "true" +spec: + kubernetesConfig: + image: quay.io/opstree/redis:v7.0.5 + imagePullPolicy: IfNotPresent + storage: + volumeClaimTemplate: + spec: + # storageClassName: standard + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi + redisExporter: + enabled: true + image: quay.io/opstree/redis-exporter:v1.44.0 + imagePullPolicy: Always + # env: + # - name: REDIS_EXPORTER_INCL_SYSTEM_METRICS + # value: "true" + podSecurityContext: + runAsUser: 1000 + fsGroup: 1000 diff --git a/example/v1beta2/redis_sentinel/sentinel.yaml b/example/v1beta2/redis_sentinel/sentinel.yaml new file mode 100644 index 000000000..c2840cd53 --- /dev/null +++ b/example/v1beta2/redis_sentinel/sentinel.yaml @@ -0,0 +1,22 @@ +--- +apiVersion: redis.redis.opstreelabs.in/v1beta2 +kind: RedisSentinel +metadata: + name: redis-sentinel +spec: + clusterSize: 3 + podSecurityContext: + runAsUser: 1000 + fsGroup: 1000 + redisSentinelConfig: + redisReplicationName : redis-replication + kubernetesConfig: + image: quay.io/opstree/redis-sentinel:v7.0.7 + imagePullPolicy: IfNotPresent + resources: + requests: + cpu: 101m + memory: 128Mi + limits: + cpu: 101m + memory: 128Mi diff --git a/example/sidecar_features/configmap.yaml b/example/v1beta2/sidecar_features/configmap.yaml similarity index 100% rename from example/sidecar_features/configmap.yaml rename to example/v1beta2/sidecar_features/configmap.yaml diff --git a/example/sidecar_features/sidecar.yaml b/example/v1beta2/sidecar_features/sidecar.yaml similarity index 96% rename from example/sidecar_features/sidecar.yaml rename to example/v1beta2/sidecar_features/sidecar.yaml index d40ee0611..eb69bd8fc 100644 --- a/example/sidecar_features/sidecar.yaml +++ b/example/v1beta2/sidecar_features/sidecar.yaml @@ -1,5 +1,5 @@ --- -apiVersion: redis.redis.opstreelabs.in/v1beta1 +apiVersion: redis.redis.opstreelabs.in/v1beta2 kind: Redis metadata: name: redis-standalone2 diff --git a/example/tls_enabled/redis-cluster.yaml b/example/v1beta2/tls_enabled/redis-cluster.yaml similarity index 96% rename from example/tls_enabled/redis-cluster.yaml rename to example/v1beta2/tls_enabled/redis-cluster.yaml index af57922fe..9da46d137 100644 --- a/example/tls_enabled/redis-cluster.yaml +++ b/example/v1beta2/tls_enabled/redis-cluster.yaml @@ -1,5 +1,5 @@ --- -apiVersion: redis.redis.opstreelabs.in/v1beta1 +apiVersion: redis.redis.opstreelabs.in/v1beta2 kind: RedisCluster metadata: name: redis-cluster diff --git a/example/v1beta2/tls_enabled/redis-replication.yaml b/example/v1beta2/tls_enabled/redis-replication.yaml new file mode 100644 index 000000000..2496a896f --- /dev/null +++ b/example/v1beta2/tls_enabled/redis-replication.yaml @@ -0,0 +1,45 @@ +# Examples of creating a valid TLS certificate can be found at ./config/certmanager via Cert-manager +--- +apiVersion: redis.redis.opstreelabs.in/v1beta2 +kind: RedisReplication +metadata: + name: redis-replication +spec: + clusterSize: 3 + TLS: + ca: ca.key + cert: tls.crt + key: tls.key + secret: + secretName: redis-tls-cert + podSecurityContext: + runAsUser: 1000 + fsGroup: 1000 + kubernetesConfig: + image: quay.io/opstree/redis:v7.0.5 + imagePullPolicy: IfNotPresent + resources: + requests: + cpu: 101m + memory: 128Mi + limits: + cpu: 101m + memory: 128Mi + redisExporter: + enabled: false + image: quay.io/opstree/redis-exporter:v1.44.0 + imagePullPolicy: Always + resources: + requests: + cpu: 100m + memory: 128Mi + limits: + cpu: 100m + memory: 128Mi + storage: + volumeClaimTemplate: + spec: + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi diff --git a/example/v1beta2/tls_enabled/redis-standalone.yaml b/example/v1beta2/tls_enabled/redis-standalone.yaml new file mode 100644 index 000000000..800cda7f9 --- /dev/null +++ b/example/v1beta2/tls_enabled/redis-standalone.yaml @@ -0,0 +1,44 @@ +# Examples of creating a valid TLS certificate can be found at ./config/certmanager via Cert-manager +--- +apiVersion: redis.redis.opstreelabs.in/v1beta2 +kind: Redis +metadata: + name: redis-standalone +spec: + TLS: + ca: ca.key + cert: tls.crt + key: tls.key + secret: + secretName: redis-tls-cert + podSecurityContext: + runAsUser: 1000 + fsGroup: 1000 + kubernetesConfig: + image: quay.io/opstree/redis:v7.0.5 + imagePullPolicy: IfNotPresent + resources: + requests: + cpu: 101m + memory: 128Mi + limits: + cpu: 101m + memory: 128Mi + redisExporter: + enabled: false + image: quay.io/opstree/redis-exporter:v1.44.0 + imagePullPolicy: Always + resources: + requests: + cpu: 100m + memory: 128Mi + limits: + cpu: 100m + memory: 128Mi + storage: + volumeClaimTemplate: + spec: + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi diff --git a/example/tolerations/clusterd.yaml b/example/v1beta2/tolerations/clusterd.yaml similarity index 95% rename from example/tolerations/clusterd.yaml rename to example/v1beta2/tolerations/clusterd.yaml index 80fecb237..a4de514a8 100644 --- a/example/tolerations/clusterd.yaml +++ b/example/v1beta2/tolerations/clusterd.yaml @@ -1,5 +1,5 @@ --- -apiVersion: redis.redis.opstreelabs.in/v1beta1 +apiVersion: redis.redis.opstreelabs.in/v1beta2 kind: RedisCluster metadata: name: redis-cluster diff --git a/example/tolerations/replication.yaml b/example/v1beta2/tolerations/replication.yaml similarity index 92% rename from example/tolerations/replication.yaml rename to example/v1beta2/tolerations/replication.yaml index 5644cf61f..62789ae90 100644 --- a/example/tolerations/replication.yaml +++ b/example/v1beta2/tolerations/replication.yaml @@ -1,5 +1,5 @@ --- -apiVersion: redis.redis.opstreelabs.in/v1beta1 +apiVersion: redis.redis.opstreelabs.in/v1beta2 kind: RedisReplication metadata: name: redis-replication diff --git a/example/v1beta2/tolerations/standalone.yaml b/example/v1beta2/tolerations/standalone.yaml new file mode 100644 index 000000000..2fe7eff94 --- /dev/null +++ b/example/v1beta2/tolerations/standalone.yaml @@ -0,0 +1,28 @@ +--- +apiVersion: redis.redis.opstreelabs.in/v1beta2 +kind: Redis +metadata: + name: redis-standalone +spec: + kubernetesConfig: + image: quay.io/opstree/redis:v7.0.5 + imagePullPolicy: IfNotPresent + podSecurityContext: + runAsUser: 1000 + fsGroup: 1000 + storage: + volumeClaimTemplate: + spec: + # storageClassName: standard + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi + redisExporter: + enabled: false + image: quay.io/opstree/redis-exporter:v1.44.0 + tolerations: + - key: "key1" + operator: "Equal" + value: "value1" + effect: "NoSchedule" diff --git a/example/upgrade-strategy/clusterd.yaml b/example/v1beta2/upgrade-strategy/clusterd.yaml similarity index 94% rename from example/upgrade-strategy/clusterd.yaml rename to example/v1beta2/upgrade-strategy/clusterd.yaml index 8fdf0a545..81dd36d73 100644 --- a/example/upgrade-strategy/clusterd.yaml +++ b/example/v1beta2/upgrade-strategy/clusterd.yaml @@ -1,5 +1,5 @@ --- -apiVersion: redis.redis.opstreelabs.in/v1beta1 +apiVersion: redis.redis.opstreelabs.in/v1beta2 kind: RedisCluster metadata: name: redis-cluster diff --git a/example/upgrade-strategy/replication.yaml b/example/v1beta2/upgrade-strategy/replication.yaml similarity index 92% rename from example/upgrade-strategy/replication.yaml rename to example/v1beta2/upgrade-strategy/replication.yaml index d53a25af7..5b8537785 100644 --- a/example/upgrade-strategy/replication.yaml +++ b/example/v1beta2/upgrade-strategy/replication.yaml @@ -1,5 +1,5 @@ --- -apiVersion: redis.redis.opstreelabs.in/v1beta1 +apiVersion: redis.redis.opstreelabs.in/v1beta2 kind: RedisReplication metadata: name: redis-replication diff --git a/example/v1beta2/upgrade-strategy/standalone.yaml b/example/v1beta2/upgrade-strategy/standalone.yaml new file mode 100644 index 000000000..ca413bb57 --- /dev/null +++ b/example/v1beta2/upgrade-strategy/standalone.yaml @@ -0,0 +1,26 @@ +--- +apiVersion: redis.redis.opstreelabs.in/v1beta2 +kind: Redis +metadata: + name: redis-standalone +spec: + kubernetesConfig: + image: quay.io/opstree/redis:v7.0.5 + imagePullPolicy: IfNotPresent + updateStrategy: + type: OnDelete +# type: RollingUpdate + podSecurityContext: + runAsUser: 1000 + fsGroup: 1000 + storage: + volumeClaimTemplate: + spec: + # storageClassName: standard + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi + redisExporter: + enabled: false + image: quay.io/opstree/redis-exporter:v1.44.0 \ No newline at end of file diff --git a/example/v1beta2/volume_mount/configmap.yaml b/example/v1beta2/volume_mount/configmap.yaml new file mode 100644 index 000000000..eb5501a23 --- /dev/null +++ b/example/v1beta2/volume_mount/configmap.yaml @@ -0,0 +1,8 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: example-configmap + labels: + app: myapplication +data: + my-key: my-value \ No newline at end of file diff --git a/example/volume_mount/redis-cluster.yaml b/example/v1beta2/volume_mount/redis-cluster.yaml similarity index 96% rename from example/volume_mount/redis-cluster.yaml rename to example/v1beta2/volume_mount/redis-cluster.yaml index c65ddfa6b..50c8af66e 100644 --- a/example/volume_mount/redis-cluster.yaml +++ b/example/v1beta2/volume_mount/redis-cluster.yaml @@ -1,4 +1,4 @@ -apiVersion: redis.redis.opstreelabs.in/v1beta1 +apiVersion: redis.redis.opstreelabs.in/v1beta2 kind: RedisCluster metadata: name: redis-cluster diff --git a/example/v1beta2/volume_mount/redis-replication.yaml b/example/v1beta2/volume_mount/redis-replication.yaml new file mode 100644 index 000000000..8adf9e300 --- /dev/null +++ b/example/v1beta2/volume_mount/redis-replication.yaml @@ -0,0 +1,50 @@ +apiVersion: redis.redis.opstreelabs.in/v1beta2 +kind: RedisReplication +metadata: + name: redis-replication +spec: + clusterSize: 3 + # redisConfig: + # additionalRedisConfig: redis-external-config + kubernetesConfig: + image: quay.io/opstree/redis:v7.0.5 + imagePullPolicy: IfNotPresent + resources: + requests: + cpu: 101m + memory: 128Mi + limits: + cpu: 101m + memory: 128Mi + # redisSecret: + # name: redis-secret + # key: password + # imagePullSecrets: + # - name: regcred + redisExporter: + enabled: false + image: quay.io/opstree/redis-exporter:v1.44.0 + imagePullPolicy: Always + resources: + requests: + cpu: 100m + memory: 128Mi + limits: + cpu: 100m + memory: 128Mi + storage: + volumeClaimTemplate: + spec: + # storageClassName: standard + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi + volumemount: + volume: + - name: example-config + configMap: + name: example-configmap + mount: + - mountPath: /config + name: example-config diff --git a/example/v1beta2/volume_mount/redis-standalone.yaml b/example/v1beta2/volume_mount/redis-standalone.yaml new file mode 100644 index 000000000..e3257876d --- /dev/null +++ b/example/v1beta2/volume_mount/redis-standalone.yaml @@ -0,0 +1,49 @@ +apiVersion: redis.redis.opstreelabs.in/v1beta2 +kind: Redis +metadata: + name: redis-standalone +spec: + # redisConfig: + # additionalRedisConfig: redis-external-config + kubernetesConfig: + image: quay.io/opstree/redis:v7.0.5 + imagePullPolicy: IfNotPresent + resources: + requests: + cpu: 101m + memory: 128Mi + limits: + cpu: 101m + memory: 128Mi + # redisSecret: + # name: redis-secret + # key: password + # imagePullSecrets: + # - name: regcred + redisExporter: + enabled: false + image: quay.io/opstree/redis-exporter:v1.44.0 + imagePullPolicy: Always + resources: + requests: + cpu: 100m + memory: 128Mi + limits: + cpu: 100m + memory: 128Mi + storage: + volumeClaimTemplate: + spec: + # storageClassName: standard + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi + volumemount: + volume: + - name: example-config + configMap: + name: example-configmap + mount: + - mountPath: /config + name: example-config