Skip to content

Commit

Permalink
Update deps to 1.30 (#546)
Browse files Browse the repository at this point in the history
Signed-off-by: Jian Qiu <jqiu@redhat.com>
  • Loading branch information
qiujian16 authored and zhiweiyin318 committed Jul 3, 2024
1 parent 2af3a30 commit 4f2cf2b
Show file tree
Hide file tree
Showing 33 changed files with 2,040 additions and 31 deletions.
37 changes: 36 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ OPERATOR_SDK?=$(PERMANENT_TMP_GOPATH)/bin/operator-sdk
OPERATOR_SDK_VERSION?=v1.32.0
operatorsdk_gen_dir:=$(dir $(OPERATOR_SDK))

HELM?=$(PERMANENT_TMP_GOPATH)/bin/helm
HELM_VERSION?=v3.14.0
helm_gen_dir:=$(dir $(HELM))

# RELEASED_CSV_VERSION is used to generate a released CSV manifests
RELEASED_CSV_VERSION?=0.14.0
export RELEASED_CSV_VERSION
Expand All @@ -30,12 +34,15 @@ CSV_VERSION?=9.9.9
export CSV_VERSION

OPERATOR_SDK_ARCHOS:=linux_amd64
HELM_ARCHOS:=linux-amd64
ifeq ($(GOHOSTOS),darwin)
ifeq ($(GOHOSTARCH),amd64)
OPERATOR_SDK_ARCHOS:=darwin_amd64
HELM_ARCHOS:=darwin-amd64
endif
ifeq ($(GOHOSTARCH),arm64)
OPERATOR_SDK_ARCHOS:=darwin_arm64
HELM_ARCHOS:=darwin-arm64
endif
endif

Expand Down Expand Up @@ -69,7 +76,17 @@ update: copy-crd update-csv

test-unit: ensure-kubebuilder-tools

update-csv: ensure-operator-sdk
update-csv: ensure-operator-sdk ensure-operator-helm
$(HELM) template deploy/cluster-manager/helm-charts/latest --namespace=open-cluster-management -s templates/operator.yaml > deploy/cluster-manager/config/operator/operator.yaml
$(HELM) template deploy/cluster-manager/helm-charts/latest --namespace=open-cluster-management -s templates/service_account.yaml > deploy/cluster-manager/config/operator/service_account.yaml
$(HELM) template deploy/cluster-manager/helm-charts/latest --namespace=open-cluster-management -s templates/cluster_role.yaml > deploy/cluster-manager/config/rbac/cluster_role.yaml
$(HELM) template deploy/cluster-manager/helm-charts/latest --namespace=open-cluster-management -s templates/cluster_role_binding.yaml > deploy/cluster-manager/config/rbac/cluster_role_binding.yaml

$(HELM) template deploy/klusterlet/helm-charts/latest --namespace=open-cluster-management -s templates/operator.yaml > deploy/klusterlet/config/operator/operator.yaml
$(HELM) template deploy/klusterlet/helm-charts/latest --namespace=open-cluster-management -s templates/service_account.yaml > deploy/klusterlet/config/operator/service_account.yaml
$(HELM) template deploy/klusterlet/helm-charts/latest --namespace=open-cluster-management -s templates/cluster_role.yaml > deploy/klusterlet/config/rbac/cluster_role.yaml
$(HELM) template deploy/klusterlet/helm-charts/latest --namespace=open-cluster-management -s templates/cluster_role_binding.yaml > deploy/klusterlet/config/rbac/cluster_role_binding.yaml

# update the replaces to released version in csv
$(SED_CMD) -i 's/cluster-manager\.v[0-9]\+\.[0-9]\+\.[0-9]\+/cluster-manager\.v$(RELEASED_CSV_VERSION)/g' deploy/cluster-manager/config/manifests/bases/cluster-manager.clusterserviceversion.yaml
$(SED_CMD) -i 's/klusterlet\.v[0-9]\+\.[0-9]\+\.[0-9]\+/klusterlet\.v$(RELEASED_CSV_VERSION)/g' deploy/klusterlet/config/manifests/bases/klusterlet.clusterserviceversion.yaml
Expand Down Expand Up @@ -116,3 +133,21 @@ ifeq "" "$(wildcard $(OPERATOR_SDK))"
else
$(info Using existing operator-sdk from "$(OPERATOR_SDK)")
endif

ensure-operator-helm:
ifeq "" "$(wildcard $(HELM))"
$(info Installing helm into '$(HELM)')
mkdir -p '$(helm_gen_dir)'
curl -s -f -L https://get.helm.sh/helm-$(HELM_VERSION)-$(HELM_ARCHOS).tar.gz -o '$(helm_gen_dir)$(HELM_VERSION)-$(HELM_ARCHOS).tar.gz'
tar -zvxf '$(helm_gen_dir)/$(HELM_VERSION)-$(HELM_ARCHOS).tar.gz' -C $(helm_gen_dir)
mv $(helm_gen_dir)/$(HELM_ARCHOS)/helm $(HELM)
rm -rf $(helm_gen_dir)/$(HELM_ARCHOS)
chmod +x '$(HELM)';
else
$(info Using existing helm from "$(HELM)")
endif

# Include the integration/e2e setup makefile.
include ./test/integration-test.mk
include ./test/e2e-test.mk
include ./test/olm-test.mk
23 changes: 15 additions & 8 deletions deploy/cluster-manager/config/operator/operator.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
---
# Source: cluster-manager/templates/operator.yaml
kind: Deployment
apiVersion: apps/v1
metadata:
Expand All @@ -18,28 +20,31 @@ spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 70
podAffinityTerm:
topologyKey: failure-domain.beta.kubernetes.io/zone
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- cluster-manager
- weight: 30
podAffinityTerm:
topologyKey: kubernetes.io/hostname
topologyKey: failure-domain.beta.kubernetes.io/zone
weight: 70
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- cluster-manager
topologyKey: kubernetes.io/hostname
weight: 30
securityContext:
runAsNonRoot: true
serviceAccountName: cluster-manager
containers:
- name: registration-operator
image: quay.io/open-cluster-management/registration-operator:latest
imagePullPolicy: IfNotPresent
args:
- "/registration-operator"
- "hub"
Expand All @@ -52,10 +57,10 @@ spec:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
- ALL
privileged: false
runAsNonRoot: true
readOnlyRootFilesystem: true
runAsNonRoot: true
livenessProbe:
httpGet:
path: /healthz
Expand All @@ -70,6 +75,8 @@ spec:
port: 8443
initialDelaySeconds: 2
resources:
limits:
memory: 2Gi
requests:
cpu: 2m
memory: 16Mi
Expand Down
2 changes: 2 additions & 0 deletions deploy/cluster-manager/config/operator/service_account.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
---
# Source: cluster-manager/templates/service_account.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
Expand Down
2 changes: 2 additions & 0 deletions deploy/cluster-manager/config/rbac/cluster_role.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
---
# Source: cluster-manager/templates/cluster_role.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand Down
2 changes: 2 additions & 0 deletions deploy/cluster-manager/config/rbac/cluster_role_binding.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
---
# Source: cluster-manager/templates/cluster_role_binding.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
Expand Down
11 changes: 11 additions & 0 deletions deploy/cluster-manager/helm-charts/latest/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v2
name: cluster-manager
version: 9.9.9
description: The Cluster Manager provides the multi-cluster hub, which can manage Kubernetes-based clusters across data centers, public clouds, and private clouds. This Helm Chart supports the installation and upgrade of ClusterManager.
type: application
keywords:
- open-cluster-management
- ClusterManager
home: https://open-cluster-management.io/
sources:
- https://github.com/open-cluster-management-io/ocm
Loading

0 comments on commit 4f2cf2b

Please sign in to comment.