Skip to content

Commit

Permalink
#192: Upgraded Kubegres to Kubebuilder 4.3.1 to be compatible with Ku…
Browse files Browse the repository at this point in the history
…bernetes up to 1.31 . Tested with PostgreSql 17 (#186)
  • Loading branch information
alex-arica committed Jan 4, 2025
1 parent c601764 commit 4d08d61
Show file tree
Hide file tree
Showing 14 changed files with 54 additions and 54 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
docker-buildx: ## Build and push docker image for the manager for cross-platform support
# copy existing Dockerfile and insert --platform=${BUILDPLATFORM} into Dockerfile.cross, and preserve the original Dockerfile
sed -e '1 s/\(^FROM\)/FROM --platform=\$$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$$\{BUILDPLATFORM\}/' Dockerfile > Dockerfile.cross
- $(CONTAINER_TOOL) buildx create --name kubegres-new-builder
- $(CONTAINER_TOOL) buildx use kubegres-new-builder
- $(CONTAINER_TOOL) buildx create --name kubegres-builder
- $(CONTAINER_TOOL) buildx use kubegres-builder
- $(CONTAINER_TOOL) buildx build --push --platform=$(PLATFORMS) --tag ${IMG} -f Dockerfile.cross .
- $(CONTAINER_TOOL) buildx rm kubegres-new-builder
- $(CONTAINER_TOOL) buildx rm kubegres-builder
rm Dockerfile.cross

.PHONY: build-installer
Expand Down
4 changes: 2 additions & 2 deletions config/default/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Adds namespace to all resources.
namespace: kubegres-new-system
namespace: kubegres-system

# Value of this field is prepended to the
# names of all resources, e.g. a deployment named
# "wordpress" becomes "alices-wordpress".
# Note that it should also match with the prefix (text before '-') of the namespace
# field above.
namePrefix: kubegres-new-
namePrefix: kubegres-

# Labels to add to all resources and selectors.
#labels:
Expand Down
2 changes: 1 addition & 1 deletion config/default/metrics_service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Service
metadata:
labels:
control-plane: controller-manager
app.kubernetes.io/name: kubegres-new
app.kubernetes.io/name: kubegres
app.kubernetes.io/managed-by: kustomize
name: controller-manager-metrics-service
namespace: system
Expand Down
4 changes: 2 additions & 2 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Namespace
metadata:
labels:
control-plane: controller-manager
app.kubernetes.io/name: kubegres-new
app.kubernetes.io/name: kubegres
app.kubernetes.io/managed-by: kustomize
name: system
---
Expand All @@ -14,7 +14,7 @@ metadata:
namespace: system
labels:
control-plane: controller-manager
app.kubernetes.io/name: kubegres-new
app.kubernetes.io/name: kubegres
app.kubernetes.io/managed-by: kustomize
spec:
selector:
Expand Down
2 changes: 1 addition & 1 deletion config/network-policy/allow-metrics-traffic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
labels:
app.kubernetes.io/name: kubegres-new
app.kubernetes.io/name: kubegres
app.kubernetes.io/managed-by: kustomize
name: allow-metrics-traffic
namespace: system
Expand Down
2 changes: 1 addition & 1 deletion config/prometheus/monitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kind: ServiceMonitor
metadata:
labels:
control-plane: controller-manager
app.kubernetes.io/name: kubegres-new
app.kubernetes.io/name: kubegres
app.kubernetes.io/managed-by: kustomize
name: controller-manager-metrics-monitor
namespace: system
Expand Down
2 changes: 1 addition & 1 deletion config/rbac/kubegres_editor_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
app.kubernetes.io/name: kubegres-new
app.kubernetes.io/name: kubegres
app.kubernetes.io/managed-by: kustomize
name: kubegres-editor-role
rules:
Expand Down
2 changes: 1 addition & 1 deletion config/rbac/kubegres_viewer_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
app.kubernetes.io/name: kubegres-new
app.kubernetes.io/name: kubegres
app.kubernetes.io/managed-by: kustomize
name: kubegres-viewer-role
rules:
Expand Down
2 changes: 1 addition & 1 deletion config/rbac/leader_election_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
labels:
app.kubernetes.io/name: kubegres-new
app.kubernetes.io/name: kubegres
app.kubernetes.io/managed-by: kustomize
name: leader-election-role
rules:
Expand Down
2 changes: 1 addition & 1 deletion config/rbac/leader_election_role_binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
labels:
app.kubernetes.io/name: kubegres-new
app.kubernetes.io/name: kubegres
app.kubernetes.io/managed-by: kustomize
name: leader-election-rolebinding
roleRef:
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 @@ -2,7 +2,7 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
app.kubernetes.io/name: kubegres-new
app.kubernetes.io/name: kubegres
app.kubernetes.io/managed-by: kustomize
name: manager-rolebinding
roleRef:
Expand Down
2 changes: 1 addition & 1 deletion config/rbac/service_account.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app.kubernetes.io/name: kubegres-new
app.kubernetes.io/name: kubegres
app.kubernetes.io/managed-by: kustomize
name: controller-manager
namespace: system
2 changes: 1 addition & 1 deletion config/samples/kubegres_v1_kubegres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: kubegres.reactive-tech.io/v1
kind: Kubegres
metadata:
labels:
app.kubernetes.io/name: kubegres-new
app.kubernetes.io/name: kubegres
app.kubernetes.io/managed-by: kustomize
name: kubegres-sample
spec:
Expand Down
74 changes: 37 additions & 37 deletions kubegres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ kind: Namespace
metadata:
labels:
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: kubegres-new
app.kubernetes.io/name: kubegres
control-plane: controller-manager
name: kubegres-new-system
name: kubegres-system
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -4075,18 +4075,18 @@ kind: ServiceAccount
metadata:
labels:
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: kubegres-new
name: kubegres-new-controller-manager
namespace: kubegres-new-system
app.kubernetes.io/name: kubegres
name: kubegres-controller-manager
namespace: kubegres-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
labels:
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: kubegres-new
name: kubegres-new-leader-election-role
namespace: kubegres-new-system
app.kubernetes.io/name: kubegres
name: kubegres-leader-election-role
namespace: kubegres-system
rules:
- apiGroups:
- ""
Expand Down Expand Up @@ -4125,8 +4125,8 @@ kind: ClusterRole
metadata:
labels:
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: kubegres-new
name: kubegres-new-kubegres-editor-role
app.kubernetes.io/name: kubegres
name: kubegres-kubegres-editor-role
rules:
- apiGroups:
- kubegres.reactive-tech.io
Expand All @@ -4152,8 +4152,8 @@ kind: ClusterRole
metadata:
labels:
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: kubegres-new
name: kubegres-new-kubegres-viewer-role
app.kubernetes.io/name: kubegres
name: kubegres-kubegres-viewer-role
rules:
- apiGroups:
- kubegres.reactive-tech.io
Expand All @@ -4173,7 +4173,7 @@ rules:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: kubegres-new-manager-role
name: kubegres-manager-role
rules:
- apiGroups:
- ""
Expand Down Expand Up @@ -4253,7 +4253,7 @@ rules:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: kubegres-new-metrics-auth-role
name: kubegres-metrics-auth-role
rules:
- apiGroups:
- authentication.k8s.io
Expand All @@ -4271,7 +4271,7 @@ rules:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: kubegres-new-metrics-reader
name: kubegres-metrics-reader
rules:
- nonResourceURLs:
- /metrics
Expand All @@ -4283,56 +4283,56 @@ kind: RoleBinding
metadata:
labels:
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: kubegres-new
name: kubegres-new-leader-election-rolebinding
namespace: kubegres-new-system
app.kubernetes.io/name: kubegres
name: kubegres-leader-election-rolebinding
namespace: kubegres-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: kubegres-new-leader-election-role
name: kubegres-leader-election-role
subjects:
- kind: ServiceAccount
name: kubegres-new-controller-manager
namespace: kubegres-new-system
name: kubegres-controller-manager
namespace: kubegres-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: kubegres-new
name: kubegres-new-manager-rolebinding
app.kubernetes.io/name: kubegres
name: kubegres-manager-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: kubegres-new-manager-role
name: kubegres-manager-role
subjects:
- kind: ServiceAccount
name: kubegres-new-controller-manager
namespace: kubegres-new-system
name: kubegres-controller-manager
namespace: kubegres-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: kubegres-new-metrics-auth-rolebinding
name: kubegres-metrics-auth-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: kubegres-new-metrics-auth-role
name: kubegres-metrics-auth-role
subjects:
- kind: ServiceAccount
name: kubegres-new-controller-manager
namespace: kubegres-new-system
name: kubegres-controller-manager
namespace: kubegres-system
---
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: kubegres-new
app.kubernetes.io/name: kubegres
control-plane: controller-manager
name: kubegres-new-controller-manager-metrics-service
namespace: kubegres-new-system
name: kubegres-controller-manager-metrics-service
namespace: kubegres-system
spec:
ports:
- name: https
Expand All @@ -4347,10 +4347,10 @@ kind: Deployment
metadata:
labels:
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: kubegres-new
app.kubernetes.io/name: kubegres
control-plane: controller-manager
name: kubegres-new-controller-manager
namespace: kubegres-new-system
name: kubegres-controller-manager
namespace: kubegres-system
spec:
replicas: 1
selector:
Expand Down Expand Up @@ -4398,5 +4398,5 @@ spec:
- ALL
securityContext:
runAsNonRoot: true
serviceAccountName: kubegres-new-controller-manager
serviceAccountName: kubegres-controller-manager
terminationGracePeriodSeconds: 10

0 comments on commit 4d08d61

Please sign in to comment.