coredns charm-image resource is amd64 only

Bug #1998607 reported by Adam Dyess
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
CoreDNS Charm
Fix Released
Undecided
Adam Dyess

Bug Description

the 1.25/stable and 1.26/edge (about to be stable) version of this charm are released to charmhub with an amd64 specific image. The charm should work with the entire architecture that it supported by the upstream image

Currently these are the arches that the charm itself attests to support
        - amd64
        - arm
        - arm64
        - ppc64le
        - s390x

The intended image coredns/coredns:1.6.7 also supports this architectures

however, charmcraft tools (and perhaps charmhub itself) do not facilitate mutli-arch images to be published as a resource attached to a k8s charm.

Juju however allows you to deploy with any image, not just the image from charmhhub -- so the following workaround applies until then.

$ cat <<EOF > coredns.json
{"ImageName": "rocks.canonical.com:443/cdk/coredns/coredns:1.6.7"}
EOF

$ juju deploy coredns --coredns-image=./coredns.json --constraints="arch=${ARCH}" --trust

--- or if the charm is already deployed ---

$ juju attach-resource coredns --coredns-image=./coredns.json

Adam Dyess (addyess)
Changed in charm-coredns:
milestone: none → 1.26+ck1
Revision history for this message
Adam Dyess (addyess) wrote (last edit ):

Upgrading coredns image to 1.10.0 -- let's target this image to be the one supported by multiarch
https://github.com/charmed-kubernetes/charm-coredns/pull/35

Changed in charm-coredns:
status: New → In Progress
assignee: nobody → Adam Dyess (addyess)
Adam Dyess (addyess)
Changed in charm-coredns:
milestone: 1.26+ck1 → 1.26+ck2
Revision history for this message
Adam Dyess (addyess) wrote (last edit ):

While this above image update in #1 is nice -- it doesn't solve the problem that the oci-image resource is still solely amd64. The only current solution is to build the coredns charm for a specific bases-index and match its release with the appropriate architecture resource

Pseudo code of process would be something like this:
* change the charmcraft.yaml to split the bases apart by supported arch:

bases:
  - build-on: # bases-index 0
    - name: "ubuntu"
      channel: "22.04"
      architectures: ["amd64"]
    run-on:
    - name: "ubuntu"
      channel: "22.04"
      architectures: ["amd64"]
  - build-on: # bases-index 1
    - name: "ubuntu"
      channel: "22.04"
      architectures: ["amd64"]
    run-on:
    - name: "ubuntu"
      channel: "22.04"
      architectures: ["arm"]
  - build-on: # bases-index 2
    - name: "ubuntu"
      channel: "22.04"
      architectures: ["amd64"]
    run-on:
    - name: "ubuntu"
      channel: "22.04"
      architectures: ["arm64"]
  - build-on: # bases-index 3
    - name: "ubuntu"
      channel: "22.04"
      architectures: ["amd64"]
    run-on:
    - name: "ubuntu"
      channel: "22.04"
      architectures: ["ppc64le"]
  - build-on: # bases-index 4
    - name: "ubuntu"
      channel: "22.04"
      architectures: ["amd64"]
    run-on:
    - name: "ubuntu"
      channel: "22.04"
      architectures: ["s390x"]

for arch in charmcraft.yaml:
    charm_file = $(charmcraft pack -v --bases-index $(index_from_arch $arch))
    charm_id = $(charmcraft upload $charm_file)
    docker pull --platform=linux/$arch ${upstream_image}
    resource_id = $(charmcraft upload-resource --image resource-name ${upstream_image})
    charmcraft release coredns --revision=${charm_id} --resource resource-name=${resource_id}
done

Changed in charm-coredns:
milestone: 1.26+ck2 → 1.27
Adam Dyess (addyess)
Changed in charm-coredns:
milestone: 1.27 → 1.27+ck1
Adam Dyess (addyess)
Changed in charm-coredns:
milestone: 1.27+ck1 → 1.28
Revision history for this message
Adam Dyess (addyess) wrote :

This PR was introduced to help with this
https://github.com/charmed-kubernetes/charm-coredns/pull/36

Also, the build process now uses a launchpad builder to build each arch's charm and independently publish the correct resources

https://github.com/charmed-kubernetes/jenkins/pull/1376

Changed in charm-coredns:
status: In Progress → Fix Committed
Adam Dyess (addyess)
Changed in charm-coredns:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.