apecloud / kubeblocks

KubeBlocks is an open-source control plane software that runs and manages databases, message queues and other stateful applications on K8s.
https://kubeblocks.io
GNU Affero General Public License v3.0
2.2k stars 184 forks source link

[BUG]1.0 change registry for neon failed due to hardcode #8458

Closed tianyue86 closed 1 week ago

tianyue86 commented 1 week ago

Describe the env

Kubernetes: v1.28.3-vke.17
KubeBlocks: 1.0.0-beta.1
kbcli: 1.0.0-alpha.1

To Reproduce Steps to reproduce the behavior:

  1. Create neon cluster by applying this yaml
    apiVersion: apps.kubeblocks.io/v1
    kind: Cluster
    metadata:
    name: neonclu02
    labels:   
    app.kubernetes.io/version: "pg14-1.0.0"
    app.kubernetes.io/managed-by: Helm
    helm.sh/chart: neon-cluster-1.0.0-alpha.0
    spec:
    clusterDef: neon
    topology: default
    terminationPolicy: Delete
    componentSpecs:
    - name: neon-compute
      replicas: 1
      resources:
        limits:
          cpu: "1"
          memory: "2Gi"
        requests:
          cpu: "500m"
          memory: "500Mi"
      volumeClaimTemplates:
        - name: data
          spec:
            storageClassName:
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: 20Gi
    - name: neon-broker
      replicas: 1
      resources:
        limits:
          cpu: "1"
          memory: "2Gi"
        requests:
          cpu: "500m"
          memory: "500Mi"
    - name: neon-safekeeper
      replicas: 3
      resources:
        limits:
          cpu: "1"
          memory: "2Gi"
        requests:
          cpu: "500m"
          memory: "500Mi"
      volumeClaimTemplates:
        - name: data
          spec:
            storageClassName:
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: 20Gi
    - name: neon-pageserver
      replicas: 1
      resources:
        limits:
          cpu: "1"
          memory: "2Gi"
        requests:
          cpu: "500m"
          memory: "500Mi"
      volumeClaimTemplates:
        - name: data
          spec:
            storageClassName:
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: 20Gi
  2. Check the cluster status is Abnormal
  3. Check the pod status: ErrImagePull neonclu02-neon-broker-0 0/1 ErrImagePull 0 70s
  4. describe pod
    Events:
    Type     Reason     Age                    From               Message
    ----     ------     ----                   ----               -------
    Normal   Scheduled  4m36s                  default-scheduler  Successfully assigned default/neonclu02-neon-broker-0 to 172.16.0.7
    Warning  Failed     3m51s (x2 over 4m20s)  kubelet            Failed to pull image "perconalab/neon:pg14-1.0.0": failed to pull and unpack image "docker.io/perconalab/neon:pg14-1.0.0": failed to resolve reference "docker.io/perconalab/neon:pg14-1.0.0": failed to do request: Head "https://registry-1.docker.io/v2/perconalab/neon/manifests/pg14-1.0.0": dial tcp 202.160.128.205:443: connect: connection timed out
    Warning  Failed     3m11s                  kubelet            Failed to pull image "perconalab/neon:pg14-1.0.0": failed to pull and unpack image "docker.io/perconalab/neon:pg14-1.0.0": failed to resolve reference "docker.io/perconalab/neon:pg14-1.0.0": failed to do request: Head "https://registry-1.docker.io/v2/perconalab/neon/manifests/pg14-1.0.0": dial tcp 199.96.62.17:443: connect: connection timed out
    Normal   Pulling    2m18s (x4 over 4m36s)  kubelet            Pulling image "perconalab/neon:pg14-1.0.0"
    Warning  Failed     2m2s (x4 over 4m20s)   kubelet            Error: ErrImagePull
    Warning  Failed     2m2s                   kubelet            Failed to pull image "perconalab/neon:pg14-1.0.0": failed to pull and unpack image "docker.io/perconalab/neon:pg14-1.0.0": failed to resolve reference "docker.io/perconalab/neon:pg14-1.0.0": failed to do request: Head "https://registry-1.docker.io/v2/perconalab/neon/manifests/pg14-1.0.0": dial tcp 128.121.146.101:443: connect: connection timed out
    Warning  Failed     111s (x6 over 4m20s)   kubelet            Error: ImagePullBackOff
    Normal   BackOff    96s (x7 over 4m20s)    kubelet            Back-off pulling image "perconalab/neon:pg14-1.0.0"
  5. Change registry try to fix the Image pull error
    
    helm -n kb-system upgrade -i kubeblocks kb-jh/kubeblocks --version="1.0.0-beta.1" \
    --set image.registry=apecloud-registry.cn-zhangjiakou.cr.aliyuncs.com \
    --set dataProtection.image.registry=apecloud-registry.cn-zhangjiakou.cr.aliyuncs.com \
    --set addonChartsImage.registry=apecloud-registry.cn-zhangjiakou.cr.aliyuncs.com \

kbcli addon enable neon \ --set image.registry=apecloud-registry.cn-zhangjiakou.cr.aliyuncs.com \ --set image.repository=perconalab/neon



===> nothing changed

![img_v3_02gk_fecfedb7-edf4-4183-8d3f-5b44bdb3cbbg](https://github.com/user-attachments/assets/5df4e89a-4952-488a-a884-f5d519921b8b)

tianyue@apeclouds-MacBook-Pro kubeblocks-addons % k get cmpv|grep neon
neon-broker               1.0.0                                                                                            Available   61m
neon-compute              1.0.0                                                                                            Available   61m
neon-pageserver           1.0.0                                                                                            Available   61m
neon-safekeeper           1.0.0                                                                                            Available   61m
tianyue@apeclouds-MacBook-Pro kubeblocks-addons % kubectl get cmpv neon-broker -ojson | jq '.spec.releases[].images'
{
  "neon-storagebroker": "perconalab/neon:pg14-1.0.0"
}
tianyue@apeclouds-MacBook-Pro kubeblocks-addons % kubectl get cmpv neon-compute -ojson | jq '.spec.releases[].images'
{
  "neon-compute": "perconalab/neon:pg14-1.0.0"
}
tianyue@apeclouds-MacBook-Pro kubeblocks-addons % kubectl get cmpv neon-pageserver -ojson | jq '.spec.releases[].images'
{
  "neon-pageserver": "perconalab/neon:pg14-1.0.0"
}
tianyue@apeclouds-MacBook-Pro kubeblocks-addons % kubectl get cmpv neon-safekeeper -ojson | jq '.spec.releases[].images'
{
  "neon-safekeeper": "perconalab/neon:pg14-1.0.0"
}