Browse Source

use multiarch image for nginx

pull/1506/head
galal-hussein 5 years ago
parent
commit
717b5a765e
  1. 2
      manifests/nginx.yaml
  2. 2
      pkg/deploy/zz_generated_bindata.go
  3. 11
      pkg/server/server.go
  4. 1
      scripts/airgap/image-list.txt
  5. 8
      scripts/package-airgap

2
manifests/nginx.yaml

@ -10,5 +10,5 @@ spec:
controller.service.enableHttps: "true"
controller.metrics.enabled: "true"
controller.publishService.enabled: "true"
controller.image.repository: "%{NGINX_IMAGE}"
controller.image.repository: "k3sio/nginx-ingress-controller"

2
pkg/deploy/zz_generated_bindata.go

@ -288,7 +288,7 @@ func metricsServerResourceReaderYaml() (*asset, error) {
return a, nil
}
var _nginxYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x74\xcd\xc1\x6a\x02\x31\x10\xc6\xf1\x7b\x9e\x62\x58\xf0\x68\xb6\xe2\x2d\x37\x5b\x16\x95\x52\x29\xb5\x2d\xbd\xc9\x6c\x1c\x76\x83\x49\x36\xcc\x8c\x52\x2b\xbe\x7b\x51\xbc\x78\xf0\xfa\xf1\x9b\xff\x60\x09\xdf\xc4\x12\x86\xec\xa0\xa7\x98\xac\x47\xd5\x48\x36\x0c\xf5\x61\x62\x76\x21\x6f\x1d\x2c\x28\xa6\x97\x1e\x59\x4d\x22\xc5\x2d\x2a\x3a\x03\x90\x31\x91\x83\xdc\x85\xfc\x3b\x0e\xb9\x63\x12\xb9\xad\x52\xd0\x93\x83\xdd\xbe\xa5\xb1\x1c\x45\x29\x19\x29\xe4\x2f\x47\xfe\x92\x71\xd0\xab\x16\x71\x75\x3d\x3a\xbd\x7e\x3d\x37\x1f\xab\xe6\xb3\x59\x6f\x66\xef\xcb\xf3\xa8\x16\x45\x0d\xbe\xbe\x42\xa9\xef\xf2\xe3\x89\x9d\x4e\xed\x93\xd5\xee\xcf\x00\x08\xe9\xa5\x08\xc0\x2d\x7a\xeb\x99\x50\xc9\x41\xa5\xbc\xa7\xea\xba\xfb\x21\x2b\x0f\x31\x12\x5b\x21\x3e\x04\x4f\x96\x32\xb6\x91\x16\xd7\xef\x0f\x68\x22\xe5\xe0\xe5\x46\xb7\x8f\x58\xd9\xb7\x31\x48\xbf\xbe\x0b\x3f\xd4\x21\x61\x47\x96\xa9\x0c\x12\x74\xe0\xa3\x83\x6a\x74\x5a\xcd\x97\xab\x9f\xcd\xf2\x6d\x36\x6f\xce\x95\x31\xff\x01\x00\x00\xff\xff\x71\x90\x7d\xf9\x8a\x01\x00\x00")
var _nginxYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x74\x8f\x4f\x4b\x03\x41\x0c\x47\xef\xf3\x29\xc2\x42\x8f\x9d\xb5\xf4\x36\x37\x95\x42\x45\x10\xb1\xea\x55\xb2\xd3\xb0\x1b\x3a\x7f\x96\x24\x2d\x56\xf1\xbb\x4b\x4b\x41\x2a\xec\xf5\xc7\x7b\x2f\x04\x47\x7e\x27\x51\xae\x25\xc0\x40\x29\xfb\x88\x66\x89\x3c\xd7\xf6\xb0\x70\x3b\x2e\xdb\x00\x6b\x4a\xf9\x7e\x40\x31\x97\xc9\x70\x8b\x86\xc1\x01\x14\xcc\x14\xa0\xf4\x5c\x3e\xe7\x5c\x7a\x21\xd5\xcb\xaa\x23\x46\x0a\xb0\xdb\x77\x34\xd7\xa3\x1a\x65\xa7\x23\xc5\x93\x14\x4f\x99\x00\x83\xd9\xa8\xa1\x6d\x67\xdf\x8f\x6f\x77\xab\x97\xa7\xd5\xeb\x6a\xf3\x71\xfb\xfc\xf0\x33\x6b\xd5\xd0\x38\xb6\x67\x50\xdb\xab\xfc\x7c\xe1\x97\x4b\x7f\xe3\xad\xff\x72\x00\x4a\x76\x2a\x02\x48\x87\xd1\x47\x21\x34\x0a\xd0\x98\xec\xa9\x39\xef\xb1\x16\x93\x9a\x12\x89\x57\x92\x03\x47\xf2\x54\xb0\x4b\xb4\x3e\x5f\x9f\x40\x33\x99\x70\xd4\x0b\xba\x9d\xc2\xc6\x7d\x97\x58\x87\xcd\x55\x78\x92\xe6\x8c\x3d\x79\xa1\xb1\x2a\x5b\x95\x63\x80\x66\xb7\x54\xae\xff\xfe\xfb\x33\x1a\xe7\x7e\x03\x00\x00\xff\xff\xa9\xbf\x32\x74\x9a\x01\x00\x00")
func nginxYamlBytes() ([]byte, error) {
return bindataRead(

11
pkg/server/server.go

@ -9,7 +9,6 @@ import (
net2 "net"
"os"
"path/filepath"
"runtime"
"strconv"
"strings"
"time"
@ -36,7 +35,6 @@ import (
const (
MasterRoleLabelKey = "node-role.kubernetes.io/master"
NginxIngressImage = "quay.io/kubernetes-ingress-controller/nginx-ingress-controller"
)
func resolveDataDir(dataDir string) (string, error) {
@ -174,7 +172,6 @@ func stageFiles(ctx context.Context, sc *Context, controlConfig *config.Control)
"%{CLUSTER_DNS}%": controlConfig.ClusterDNS.String(),
"%{CLUSTER_DOMAIN}%": controlConfig.ClusterDomain,
"%{DEFAULT_LOCAL_STORAGE_PATH}%": controlConfig.DefaultLocalStoragePath,
"%{NGINX_IMAGE}": nginxImage(),
}
if err := deploy.Stage(dataDir, templateVars, controlConfig.Skips); err != nil {
@ -415,11 +412,3 @@ func setMasterRoleLabel(ctx context.Context, nodes v1.NodeClient) error {
}
return nil
}
func nginxImage() string {
nginxImage := NginxIngressImage
if runtime.GOARCH == "arm" || runtime.GOARCH == "arm64" {
nginxImage = fmt.Sprintf("%s-%s", nginxImage, runtime.GOARCH)
}
return nginxImage
}

1
scripts/airgap/image-list.txt

@ -4,3 +4,4 @@ docker.io/rancher/klipper-lb:v0.1.2
docker.io/rancher/local-path-provisioner:v0.0.11
docker.io/rancher/metrics-server:v0.3.6
docker.io/rancher/pause:3.1
docker.io/k3sio/nginx-ingress-controller:0.30.0

8
scripts/package-airgap

@ -7,12 +7,4 @@ cd $(dirname $0)/..
images=$(cat scripts/airgap/image-list.txt)
xargs -n1 docker pull <<< "${images}"
# Add exception for nginx
NGINX_IMAGE_VERSION="0.30.0"
NGINX_IMAGE="quay.io/kubernetes-ingress-controller/nginx-ingress-controller"
ADD_ARCH=""
if [ "$ARCH" == "arm" ] || [ "$ARCH" == "arm64" ]; then
ADD_ARCH="-$ARCH"
fi
docker pull "$NGINX_IMAGE$ADD_ARCH:$NGINX_IMAGE_VERSION"
docker save ${images} -o dist/artifacts/k3s-airgap-images-${ARCH}.tar

Loading…
Cancel
Save