Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ bin

telepresence.log
manager
Redis-Operator
2 changes: 1 addition & 1 deletion PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ domain: payu.com
repo: github.com/PayU/Redis-Operator
resources:
- group: db
kind: RedisOperator
kind: RedisCluster
version: v1
version: "2"
26 changes: 13 additions & 13 deletions api/v1/redisoperator_types.go → api/v1/rediscluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ type TopologyKeys struct {
ZoneTopologyKey string `json:"zoneTopologyKey,omitempty"`
}

// RedisOperatorSpec defines the desired state of RedisOperator
type RedisOperatorSpec struct {
// RedisClusterSpec defines the desired state of RedisCluster
type RedisClusterSpec struct {

// +kubebuilder:validation:Minimum=3
// The number of leader instances to run.
Expand Down Expand Up @@ -64,8 +64,8 @@ type RedisOperatorSpec struct {
RedisContainerEnvVariables []corev1.EnvVar `json:"redisContainerEnvVariables,omitempty"`
}

// RedisOperatorStatus defines the observed state of RedisOperator
type RedisOperatorStatus struct {
// RedisClusterStatus defines the observed state of RedisCluster
type RedisClusterStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file

Expand All @@ -80,26 +80,26 @@ type RedisOperatorStatus struct {

// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:resource:shortName=ro
// +kubebuilder:resource:shortName=rdc

// RedisOperator is the Schema for the redisoperators API
type RedisOperator struct {
// RedisCluster is the Schema for the redisclusters API
type RedisCluster struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec RedisOperatorSpec `json:"spec,omitempty"`
Status RedisOperatorStatus `json:"status,omitempty"`
Spec RedisClusterSpec `json:"spec,omitempty"`
Status RedisClusterStatus `json:"status,omitempty"`
}

// +kubebuilder:object:root=true

// RedisOperatorList contains a list of RedisOperator
type RedisOperatorList struct {
// RedisClusterList contains a list of RedisCluster
type RedisClusterList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []RedisOperator `json:"items"`
Items []RedisCluster `json:"items"`
}

func init() {
SchemeBuilder.Register(&RedisOperator{}, &RedisOperatorList{})
SchemeBuilder.Register(&RedisCluster{}, &RedisClusterList{})
}
38 changes: 19 additions & 19 deletions api/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.5
creationTimestamp: null
name: redisoperators.db.payu.com
name: redisclusters.db.payu.com
spec:
group: db.payu.com
names:
kind: RedisOperator
listKind: RedisOperatorList
plural: redisoperators
kind: RedisCluster
listKind: RedisClusterList
plural: redisclusters
shortNames:
- ro
singular: redisoperator
- rdc
singular: rediscluster
scope: Namespaced
subresources:
status: {}
validation:
openAPIV3Schema:
description: RedisOperator is the Schema for the redisoperators API
description: RedisCluster is the Schema for the redisclusters API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
Expand All @@ -36,7 +36,7 @@ spec:
metadata:
type: object
spec:
description: RedisOperatorSpec defines the desired state of RedisOperator
description: RedisClusterSpec defines the desired state of RedisCluster
properties:
Podresources:
description: ResourceRequirements describes the compute resource requirements.
Expand Down Expand Up @@ -213,7 +213,7 @@ spec:
- podLabelSelector
type: object
status:
description: RedisOperatorStatus defines the observed state of RedisOperator
description: RedisClusterStatus defines the observed state of RedisCluster
properties:
active:
description: A list of pointers to currently running pods.
Expand Down
6 changes: 3 additions & 3 deletions config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
# since it depends on service name and namespace that are out of this kustomize package.
# It should be run by config/default
resources:
- bases/db.payu.com_redisoperators.yaml
- bases/db.payu.com_redisclusters.yaml
# +kubebuilder:scaffold:crdkustomizeresource

patchesStrategicMerge:
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.
# patches here are for enabling the conversion webhook for each CRD
#- patches/webhook_in_redisoperators.yaml
#- patches/webhook_in_redisclusters.yaml
# +kubebuilder:scaffold:crdkustomizewebhookpatch

# [CERTMANAGER] To enable webhook, uncomment all the sections with [CERTMANAGER] prefix.
# patches here are for enabling the CA injection for each CRD
#- patches/cainjection_in_redisoperators.yaml
#- patches/cainjection_in_redisclusters.yaml
# +kubebuilder:scaffold:crdkustomizecainjectionpatch

# the following config is for teaching kustomize how to do kustomization for CRDs.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ kind: CustomResourceDefinition
metadata:
annotations:
cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME)
name: redisoperators.db.payu.com
name: redisclusters.db.payu.com
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: redisoperators.db.payu.com
name: redisclusters.db.payu.com
spec:
conversion:
strategy: Webhook
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# permissions for end users to edit redisoperators.
# permissions for end users to edit redisclusters.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: redisoperator-editor-role
name: rediscluster-editor-role
rules:
- apiGroups:
- db.payu.com
resources:
- redisoperators
- redisclusters
verbs:
- create
- delete
Expand All @@ -19,6 +19,6 @@ rules:
- apiGroups:
- db.payu.com
resources:
- redisoperators/status
- redisclusters/status
verbs:
- get
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# permissions for end users to view redisoperators.
# permissions for end users to view redisclusters.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: redisoperator-viewer-role
name: rediscluster-viewer-role
rules:
- apiGroups:
- db.payu.com
resources:
- redisoperators
- redisclusters
verbs:
- get
- list
- watch
- apiGroups:
- db.payu.com
resources:
- redisoperators/status
- redisclusters/status
verbs:
- get
4 changes: 2 additions & 2 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ rules:
- apiGroups:
- db.payu.com
resources:
- redisoperators
- redisclusters
verbs:
- create
- delete
Expand All @@ -35,7 +35,7 @@ rules:
- apiGroups:
- db.payu.com
resources:
- redisoperators/status
- redisclusters/status
verbs:
- get
- patch
Expand Down
4 changes: 2 additions & 2 deletions config/samples/local_cluster.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: db.payu.com/v1
kind: RedisOperator
kind: RedisCluster
metadata:
name: ro-test
name: rdc-test
namespace: logs
spec:
leaderReplicas: 3
Expand Down
4 changes: 2 additions & 2 deletions config/samples/remote_cluster.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: db.payu.com/v1
kind: RedisOperator
kind: RedisCluster
metadata:
name: ro-test
name: rdc-test
namespace: logs
spec:
leaderReplicas: 3
Expand Down
Loading