Skip to content

Commit

Permalink
[Fix] - make deploy target not works well (OT-CONTAINER-KIT#662)
Browse files Browse the repository at this point in the history
* execute make manifests

Signed-off-by: drivebyer <[email protected]>

* fix indent

Signed-off-by: drivebyer <[email protected]>

* match operator's name && namespace

Signed-off-by: drivebyer <[email protected]>

* disable webhook related resources

Signed-off-by: drivebyer <[email protected]>

* fix no-group name for core api resources

Signed-off-by: drivebyer <[email protected]>

* disable manager auth by default

Signed-off-by: drivebyer <[email protected]>

* fix ClusterRoleBinding

Signed-off-by: drivebyer <[email protected]>

---------

Signed-off-by: drivebyer <[email protected]>
Signed-off-by: Matt Robinson <[email protected]>
  • Loading branch information
drivebyer authored and mattrobinsonsre committed Jul 11, 2024
1 parent 21582e1 commit 809ce33
Show file tree
Hide file tree
Showing 19 changed files with 5,832 additions and 3,954 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ uninstall: manifests kustomize
# Deploy controller in the configured Kubernetes cluster in ~/.kube/config
deploy: manifests kustomize
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
$(KUSTOMIZE) build config/default | kubectl apply -f -
$(KUSTOMIZE) build config/default | kubectl apply --server-side=true -f -

# UnDeploy controller from the configured Kubernetes cluster in ~/.kube/config
undeploy:
Expand Down
2 changes: 1 addition & 1 deletion api/rbac.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package api
// +kubebuilder:rbac:groups=apiextensions.k8s.io,resources=customresourcedefinitions,verbs=get;list;watch
// +kubebuilder:rbac:groups=redis.redis.opstreelabs.in,resources=redis/finalizers;rediscluster/finalizers;redisclusters/finalizers;redissentinel/finalizers;redissentinels/finalizers;redisreplication/finalizers;redisreplications/finalizers,verbs=update
// +kubebuilder:rbac:groups=redis.redis.opstreelabs.in,resources=redis/status;rediscluster/status;redisclusters/status;redissentinel/status;redissentinels/status;redisreplication/status;redisreplications/status,verbs=get;patch;update
// +kubebuilder:rbac:groups=,resources=secrets;pods/exec;pods;services;configmaps;events;persistentvolumeclaims;namespaces,verbs=create;delete;get;list;patch;update;watch
// +kubebuilder:rbac:groups="",resources=secrets;pods/exec;pods;services;configmaps;events;persistentvolumeclaims;namespaces,verbs=create;delete;get;list;patch;update;watch
// +kubebuilder:rbac:groups=apps,resources=statefulsets,verbs=create;delete;get;list;patch;update;watch
// +kubebuilder:rbac:groups=coordination.k8s.io,resources=leases,verbs=create;delete;get;list;patch;update;watch
// +kubebuilder:rbac:groups=policy,resources=poddisruptionbudgets,verbs=create;delete;get;list;patch;update;watch
4 changes: 2 additions & 2 deletions config/certmanager/certificate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: selfsigned-issuer
namespace: system
namespace: ot-operators
spec:
selfSigned: {}
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: serving-cert # this name should match the one appeared in kustomizeconfig.yaml
namespace: system
namespace: ot-operators
spec:
# $(SERVICE_NAME) and $(SERVICE_NAMESPACE) will be substituted by kustomize
dnsNames:
Expand Down
2,962 changes: 1,746 additions & 1,216 deletions config/crd/bases/redis.redis.opstreelabs.in_redis.yaml

Large diffs are not rendered by default.

3,320 changes: 1,986 additions & 1,334 deletions config/crd/bases/redis.redis.opstreelabs.in_redisclusters.yaml

Large diffs are not rendered by default.

2,962 changes: 1,746 additions & 1,216 deletions config/crd/bases/redis.redis.opstreelabs.in_redisreplications.yaml

Large diffs are not rendered by default.

430 changes: 297 additions & 133 deletions config/crd/bases/redis.redis.opstreelabs.in_redissentinels.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion config/crd/patches/webhook_in_redis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
webhook:
clientConfig:
service:
namespace: system
namespace: ot-operators
name: webhook-service
path: /convert
conversionReviewVersions: ["v1beta2", "v1beta1"]
2 changes: 1 addition & 1 deletion config/crd/patches/webhook_in_redisclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
webhook:
clientConfig:
service:
namespace: system
namespace: ot-operators
name: webhook-service
path: /convert
conversionReviewVersions: ["v1beta2", "v1beta1"]
2 changes: 1 addition & 1 deletion config/crd/patches/webhook_in_redisreplications.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
webhook:
clientConfig:
service:
namespace: system
namespace: ot-operators
name: webhook-service
path: /convert
conversionReviewVersions: ["v1beta2", "v1beta1"]
2 changes: 1 addition & 1 deletion config/crd/patches/webhook_in_redissentinels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
webhook:
clientConfig:
service:
namespace: system
namespace: ot-operators
name: webhook-service
path: /convert
conversionReviewVersions: ["v1beta2", "v1beta1"]
66 changes: 33 additions & 33 deletions config/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,51 +24,51 @@ bases:
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
#- ../prometheus

patchesStrategicMerge:
#patchesStrategicMerge:
# Protect the /metrics endpoint by putting it behind auth.
# If you want your controller-manager to expose the /metrics
# If you want your redis-operator to expose the /metrics
# endpoint w/o any authn/z, please comment the following line.
- manager_auth_proxy_patch.yaml
#- manager_auth_proxy_patch.yaml

# Mount the controller config file for loading manager configurations
# through a ComponentConfig type
#- manager_config_patch.yaml

# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
- manager_webhook_patch.yaml
#- manager_webhook_patch.yaml

# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'.
# Uncomment 'CERTMANAGER' sections in crd/kustomization.yaml to enable the CA injection in the admission webhooks.
# 'CERTMANAGER' needs to be enabled to use ca injection
- webhookcainjection_patch.yaml
#- webhookcainjection_patch.yaml

# the following config is for teaching kustomize how to do var substitution
vars:
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix.
- name: CERTIFICATE_NAMESPACE # namespace of the certificate CR
objref:
kind: Certificate
group: cert-manager.io
version: v1
name: serving-cert # this name should match the one in certificate.yaml
fieldref:
fieldpath: metadata.namespace
- name: CERTIFICATE_NAME
objref:
kind: Certificate
group: cert-manager.io
version: v1
name: serving-cert # this name should match the one in certificate.yaml
- name: SERVICE_NAMESPACE # namespace of the service
objref:
kind: Service
version: v1
name: webhook-service
fieldref:
fieldpath: metadata.namespace
- name: SERVICE_NAME
objref:
kind: Service
version: v1
name: webhook-service
#vars:
## [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix.
#- name: CERTIFICATE_NAMESPACE # namespace of the certificate CR
# objref:
# kind: Certificate
# group: cert-manager.io
# version: v1
# name: serving-cert # this name should match the one in certificate.yaml
# fieldref:
# fieldpath: metadata.namespace
#- name: CERTIFICATE_NAME
# objref:
# kind: Certificate
# group: cert-manager.io
# version: v1
# name: serving-cert # this name should match the one in certificate.yaml
#- name: SERVICE_NAMESPACE # namespace of the service
# objref:
# kind: Service
# version: v1
# name: webhook-service
# fieldref:
# fieldpath: metadata.namespace
#- name: SERVICE_NAME
# objref:
# kind: Service
# version: v1
# name: webhook-service
4 changes: 2 additions & 2 deletions config/default/manager_auth_proxy_patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: controller-manager
namespace: system
name: redis-operator
namespace: ot-operators
spec:
template:
spec:
Expand Down
4 changes: 2 additions & 2 deletions config/default/manager_config_patch.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: controller-manager
namespace: system
name: redis-operator
namespace: ot-operators
spec:
template:
spec:
Expand Down
4 changes: 2 additions & 2 deletions config/default/manager_webhook_patch.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: controller-manager
namespace: system
name: redis-operator
namespace: ot-operators
spec:
template:
spec:
Expand Down
8 changes: 4 additions & 4 deletions config/prometheus/monitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
labels:
control-plane: controller-manager
name: controller-manager-metrics-monitor
namespace: system
control-plane: redis-operator
name: redis-operator-metrics-monitor
namespace: ot-operators
spec:
endpoints:
- path: /metrics
port: https
selector:
matchLabels:
control-plane: controller-manager
control-plane: redis-operator
4 changes: 3 additions & 1 deletion config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ rules:
- '*'
verbs:
- get
- resources:
- apiGroups:
- ""
resources:
- configmaps
- events
- namespaces
Expand Down
2 changes: 1 addition & 1 deletion config/rbac/role_binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: redis-operator
name: redis-operator-manager-role
subjects:
- kind: ServiceAccount
name: redis-operator
Expand Down
4 changes: 2 additions & 2 deletions config/webhook/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ metadata:
app.kubernetes.io/part-of: redis-operator
app.kubernetes.io/managed-by: kustomize
name: webhook-service
namespace: system
namespace: ot-operators
spec:
ports:
- port: 443
protocol: TCP
targetPort: 9443
selector:
control-plane: controller-manager
control-plane: redis-operator

0 comments on commit 809ce33

Please sign in to comment.