Skip to content

Commit

Permalink
Merge pull request #326 from peng9808/main
Browse files Browse the repository at this point in the history
update drbd v0.4.3
  • Loading branch information
peng9808 authored Nov 26, 2024
2 parents d4bf3e9 + 2be079d commit e798991
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 78 deletions.
1 change: 0 additions & 1 deletion api/v1alpha1/cluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ type LocalStorageSpec struct {
type MemberSpec struct {
DRBDStartPort int `json:"drbdStartPort,omitempty"`
MaxHAVolumeCount int `json:"maxHAVolumeCount,omitempty"`
RcloneImage *ImageSpec `json:"rcloneImage,omitempty"`
JuicesyncImage *ImageSpec `json:"juicesyncImage,omitempty"`
HostPathSSHDir string `json:"hostPathSSHDir,omitempty"`
HostPathDRBDDir string `json:"hostPathDRBDDir,omitempty"`
Expand Down
5 changes: 0 additions & 5 deletions api/v1alpha1/zz_generated.deepcopy.go

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

9 changes: 0 additions & 9 deletions config/crd/bases/hwameistor.io_clusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9040,15 +9040,6 @@ spec:
type: object
maxHAVolumeCount:
type: integer
rcloneImage:
properties:
registry:
type: string
repository:
type: string
tag:
type: string
type: object
resources:
description: ResourceRequirements describes the compute resource
requirements.
Expand Down
3 changes: 0 additions & 3 deletions config/samples/hwameistor.io_hmcluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ spec:
registry: "ghcr.m.daocloud.io"
repository: "hwameistor/local-storage"
tag: "v0.9.2"
rcloneImage:
repository: "rclone/rclone"
tag: "1.53.2"
tolerationOnMaster: true
localDiskManager:
kubeletRootDir: "/var/lib/kubelet"
Expand Down
15 changes: 7 additions & 8 deletions helm/operator/.relok8s-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
- "{{ .global.k8sImageRegistry }}/{{ .localDiskManager.csi.attacher.imageRepository }}:{{ .localDiskManager.csi.attacher.tag }}"
- "{{ .global.k8sImageRegistry }}/{{ .localStorage.csi.registrar.imageRepository }}:{{ .localStorage.csi.registrar.tag }}"
- "{{ .global.hwameistorImageRegistry }}/{{ .localStorage.member.imageRepository }}:{{ .localStorage.member.tag }}"
- "{{ .localStorage.migrate.rclone.imageRepository }}:{{ .localStorage.migrate.rclone.tag }}"
- "{{ .global.hwameistorImageRegistry }}/{{ .localStorage.migrate.juicesync.imageRepository }}:{{ .localStorage.migrate.juicesync.tag }}"
- "{{ .global.k8sImageRegistry }}/{{ .localStorage.csi.provisioner.imageRepository }}:{{ .localStorage.csi.provisioner.tag }}"
- "{{ .global.k8sImageRegistry }}/{{ .localStorage.csi.attacher.imageRepository }}:{{ .localStorage.csi.attacher.tag }}"
Expand All @@ -24,13 +23,13 @@
- "{{ .global.hwameistorImageRegistry }}/{{ .ui.imageRepository }}:{{ .ui.tag }}"
- "{{ .global.hwameistorImageRegistry }}/{{ .operator.imageRepository }}:{{ .operator.tag }}"
- "{{ .global.hwameistorImageRegistry }}/{{ .preHookJob.imageRepository }}:{{ .preHookJob.tag }}"
- "{{ .global.hwameistorImageRegistry }}/{{ .ha.imageRepository }}:{{ .ha.drbdVersion }}_v0.4.2"
- "{{ .global.hwameistorImageRegistry }}/{{ .drbdRhel7.imageRepository }}:{{ .ha.drbdVersion }}_v0.4.2"
- "{{ .global.hwameistorImageRegistry }}/{{ .drbdRhel8.imageRepository }}:{{ .ha.drbdVersion }}_v0.4.2"
- "{{ .global.hwameistorImageRegistry }}/{{ .drbdRhel9.imageRepository }}:{{ .ha.drbdVersion }}_v0.4.2"
- "{{ .global.hwameistorImageRegistry }}/{{ .drbdKylin10.imageRepository }}:{{ .ha.drbdVersion }}_v0.4.2"
- "{{ .global.hwameistorImageRegistry }}/{{ .drbdBionic.imageRepository }}:{{ .ha.drbdVersion }}_v0.4.2"
- "{{ .global.hwameistorImageRegistry }}/{{ .drbdFocal.imageRepository }}:{{ .ha.drbdVersion }}_v0.4.2"
- "{{ .global.hwameistorImageRegistry }}/{{ .ha.imageRepository }}:{{ .ha.drbdVersion }}_v0.4.3"
- "{{ .global.hwameistorImageRegistry }}/{{ .drbdRhel7.imageRepository }}:{{ .ha.drbdVersion }}_v0.4.3"
- "{{ .global.hwameistorImageRegistry }}/{{ .drbdRhel8.imageRepository }}:{{ .ha.drbdVersion }}_v0.4.3"
- "{{ .global.hwameistorImageRegistry }}/{{ .drbdRhel9.imageRepository }}:{{ .ha.drbdVersion }}_v0.4.3"
- "{{ .global.hwameistorImageRegistry }}/{{ .drbdKylin10.imageRepository }}:{{ .ha.drbdVersion }}_v0.4.3"
- "{{ .global.hwameistorImageRegistry }}/{{ .drbdBionic.imageRepository }}:{{ .ha.drbdVersion }}_v0.4.3"
- "{{ .global.hwameistorImageRegistry }}/{{ .drbdFocal.imageRepository }}:{{ .ha.drbdVersion }}_v0.4.3"
- "{{ .global.hwameistorImageRegistry }}/{{ .dataLoadManager.imageRepository }}:{{ .dataLoadManager.tag }}"
- "{{ .global.hwameistorImageRegistry }}/{{ .dataSetManager.imageRepository }}:{{ .dataSetManager.tag }}"
- "{{ .global.hwameistorImageRegistry }}/{{ .dataLoadInit.imageRepository }}:{{ .dataLoadInit.tag }}"
Expand Down
5 changes: 1 addition & 4 deletions helm/operator/templates/hwameistorcluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,6 @@ spec:
tag: {{ template "hwameistor.localStorageImageTag" . }}
resources:
{{- toYaml .Values.localStorage.member.resources | nindent 8 }}
rcloneImage:
repository: {{ $.Values.localStorage.migrate.rclone.imageRepository }}
tag: {{ $.Values.localStorage.migrate.rclone.tag }}
juicesyncImage:
registry: {{ $.Values.global.hwameistorImageRegistry }}
repository: {{ $.Values.localStorage.migrate.juicesync.imageRepository }}
Expand Down Expand Up @@ -252,7 +249,7 @@ spec:
operator: DoesNotExist
- key: node-role.kubernetes.io/control-plane
operator: DoesNotExist
chartVersion: "v0.4.2"
chartVersion: "v0.4.3"
storageClass:
allowVolumeExpansion: {{ $.Values.storageClass.allowVolumeExpansion }}
reclaimPolicy: {{ $.Values.storageClass.reclaimPolicy }}
Expand Down
7 changes: 2 additions & 5 deletions helm/operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ localStorage:
imageRepository: sig-storage/csi-snapshotter
tag: v6.0.0
migrate:
rclone:
imageRepository: rclone/rclone
tag: 1.53.2
juicesync:
imageRepository: hwameistor/hwameistor-juicesync
tag: v1.0.4-01
Expand Down Expand Up @@ -147,7 +144,7 @@ ha:
deployOnMaster: "yes"
imageRepository: hwameistor/drbd9-shipper
drbdVersion: v9.0.32-1
shipperChar: v0.4.2
shipperChar: v0.4.3

drbdRhel7:
imageRepository: hwameistor/drbd9-rhel7
Expand Down Expand Up @@ -211,4 +208,4 @@ storageClass:

preHookJob:
imageRepository: dtzar/helm-kubectl
tag: 3.9
tag: 3.16
10 changes: 5 additions & 5 deletions pkg/install/drbd/drbd_adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var defaultImageRegistry = "ghcr.io"
var defaultShipperRepository = "hwameistor/drbd9-shipper"
var defaultImagePullPolicy = "IfNotPresent"
var defaultDRBDVersion = "v9.0.32-1"
var defaultShipperChar = "v0.4.2"
var defaultShipperChar = "v0.4.3"
var defaultDRBDUpgrade = "no"
var defaultCheckHostName = "no"
var defaultUseAffinity = "no"
Expand All @@ -40,7 +40,7 @@ var defaultNodeSelectTerms = []corev1.NodeSelectorTerm{
},
},
}
var defaultChartVersion = "v0.4.2"
var defaultChartVersion = "v0.4.3"

var distroRegexMap = map[string]string{
"(red hat enterprise|centos|almalinux|rocky linux) .*?7(\\.|\\s|$)": "rhel7",
Expand Down Expand Up @@ -424,9 +424,9 @@ func GetDistro(node *corev1.Node) (string, bool) {
if matched {
distro = v
}
if distro == "jammy" {
tag = "v9.1.11"
}
//if distro == "jammy" {
// tag = "v9.1.11"
//}
}
if distro == "unsupported" {
return distro, false
Expand Down
37 changes: 2 additions & 35 deletions pkg/install/localstorage/localstorage.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,9 @@ var defaultLSDaemonsetImageTag = install.DefaultHwameistorVersion
var defaultLSDaemonsetCSIRegistrarImageRegistry = "k8s-gcr.m.daocloud.io"
var defaultLSDaemonsetCSIRegistrarImageRepository = "sig-storage/csi-node-driver-registrar"
var defaultLSDaemonsetCSIRegistrarImageTag = "v2.5.0"
var defaultRCloneImageRepository = "rclone/rclone"
var defaultRCloneImageTag = "1.53.2"
var memberContainerName = "member"
var registrarContainerName = "registrar"
var rcloneEnvName = "MIGRAGE_RCLONE_IMAGE"

var juicesyncEnvName = "MIGRAGE_JUICESYNC_IMAGE"

var lsDaemonSetTemplate = appsv1.DaemonSet{
Expand Down Expand Up @@ -395,13 +393,7 @@ func setLSDaemonSetContainers(clusterInstance *hwameistoriov1alpha1.Cluster, lsD
Name: "CSI_ENDPOINT",
Value: "unix:/" + clusterInstance.Spec.LocalStorage.KubeletRootDir + "/plugins/lvm.hwameistor.io/csi.sock",
})
// rcloneImageSpec := clusterInstance.Spec.LocalStorage.Member.RcloneImage
container.Env = append(container.Env, corev1.EnvVar{
Name: rcloneEnvName,
// Value: rcloneImageSpec.Registry + "/" + rcloneImageSpec.Repository + ":" + rcloneImageSpec.Tag,
// Value: rcloneImageSpec.Repository + ":" + rcloneImageSpec.Tag,
Value: getRcloneEnvFromClusterInstance(clusterInstance),
})

container.Env = append(container.Env, corev1.EnvVar{
Name: juicesyncEnvName,
Value: getJuicesyncEnvFromClusterInstance(clusterInstance),
Expand Down Expand Up @@ -442,11 +434,6 @@ func getLSContainerRegistrarImageStringFromClusterInstance(clusterInstance *hwam
return imageSpec.Registry + "/" + imageSpec.Repository + ":" + imageSpec.Tag
}

func getRcloneEnvFromClusterInstance(clusterInstance *hwameistoriov1alpha1.Cluster) string {
rcloneImage := clusterInstance.Spec.LocalStorage.Member.RcloneImage
return rcloneImage.Repository + ":" + rcloneImage.Tag
}

func getJuicesyncEnvFromClusterInstance(clusterInstance *hwameistoriov1alpha1.Cluster) string {
juicesyncImage := clusterInstance.Spec.LocalStorage.Member.JuicesyncImage
return juicesyncImage.Registry + "/" + juicesyncImage.Repository + ":" + juicesyncImage.Tag
Expand All @@ -460,17 +447,6 @@ func needOrNotToUpdateLSDaemonset(cluster *hwameistoriov1alpha1.Cluster, gotten
if container.Name == memberContainerName {
var containerModified bool

wantedRcloneEnv := getRcloneEnvFromClusterInstance(cluster)
for i, env := range container.Env {
if env.Name == rcloneEnvName {
if env.Value != wantedRcloneEnv {
env.Value = wantedRcloneEnv
container.Env[i] = env
containerModified = true
}
}
}

wantedJuicesyncEnv := getJuicesyncEnvFromClusterInstance(cluster)
juicesyncEnvNotFound := true
for i, env := range container.Env {
Expand Down Expand Up @@ -647,15 +623,6 @@ func FulfillLSDaemonsetSpec(clusterInstance *hwameistoriov1alpha1.Cluster) *hwam
if clusterInstance.Spec.LocalStorage.Member.Image.Tag == "" {
clusterInstance.Spec.LocalStorage.Member.Image.Tag = defaultLSDaemonsetImageTag
}
if clusterInstance.Spec.LocalStorage.Member.RcloneImage == nil {
clusterInstance.Spec.LocalStorage.Member.RcloneImage = &hwameistoriov1alpha1.ImageSpec{}
}
if clusterInstance.Spec.LocalStorage.Member.RcloneImage.Repository == "" {
clusterInstance.Spec.LocalStorage.Member.RcloneImage.Repository = defaultRCloneImageRepository
}
if clusterInstance.Spec.LocalStorage.Member.RcloneImage.Tag == "" {
clusterInstance.Spec.LocalStorage.Member.RcloneImage.Tag = defaultRCloneImageTag
}
if clusterInstance.Spec.LocalStorage.CSI == nil {
clusterInstance.Spec.LocalStorage.CSI = &hwameistoriov1alpha1.CSISpec{}
}
Expand Down
3 changes: 0 additions & 3 deletions test/e2e/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ spec:
registry: "ghcr.m.daocloud.io"
repository: "hwameistor/local-storage"
tag: "v0.9.2"
rcloneImage:
repository: "rclone/rclone"
tag: "1.53.2"
tolerationOnMaster: true
localDiskManager:
kubeletRootDir: "/var/lib/kubelet"
Expand Down

0 comments on commit e798991

Please sign in to comment.