parent
81a3f81aa1
commit
8f2390a120
|
@ -27,7 +27,7 @@ manage-offline-container-images.sh register
|
||||||
|
|
||||||
## generate_list.sh
|
## generate_list.sh
|
||||||
|
|
||||||
This script generates the list of downloaded files and the list of container images by `roles/kubespray-defaults/main/download.yml` file.
|
This script generates the list of downloaded files and the list of container images by `roles/kubespray-defaults/defaults/main/download.yml` file.
|
||||||
|
|
||||||
Run this script will execute `generate_list.yml` playbook in kubespray root directory and generate four files,
|
Run this script will execute `generate_list.yml` playbook in kubespray root directory and generate four files,
|
||||||
all downloaded files url in files.list, all container images in images.list, jinja2 templates in *.template.
|
all downloaded files url in files.list, all container images in images.list, jinja2 templates in *.template.
|
||||||
|
|
|
@ -5,7 +5,7 @@ CURRENT_DIR=$(cd $(dirname $0); pwd)
|
||||||
TEMP_DIR="${CURRENT_DIR}/temp"
|
TEMP_DIR="${CURRENT_DIR}/temp"
|
||||||
REPO_ROOT_DIR="${CURRENT_DIR%/contrib/offline}"
|
REPO_ROOT_DIR="${CURRENT_DIR%/contrib/offline}"
|
||||||
|
|
||||||
: ${DOWNLOAD_YML:="roles/kubespray-defaults/main/download.yml"}
|
: ${DOWNLOAD_YML:="roles/kubespray-defaults/defaults/main/download.yml"}
|
||||||
|
|
||||||
mkdir -p ${TEMP_DIR}
|
mkdir -p ${TEMP_DIR}
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ sed -n '/^downloads:/,/download_defaults:/p' ${REPO_ROOT_DIR}/${DOWNLOAD_YML} \
|
||||||
| sed 'N;s#\n# #g' | tr ' ' ':' | sed 's/\"//g' > ${TEMP_DIR}/images.list.template
|
| sed 'N;s#\n# #g' | tr ' ' ':' | sed 's/\"//g' > ${TEMP_DIR}/images.list.template
|
||||||
|
|
||||||
# add kube-* images to images list template
|
# add kube-* images to images list template
|
||||||
# Those container images are downloaded by kubeadm, then roles/kubespray-defaults/main/download.yml
|
# Those container images are downloaded by kubeadm, then roles/kubespray-defaults/defaults/main/download.yml
|
||||||
# doesn't contain those images. That is reason why here needs to put those images into the
|
# doesn't contain those images. That is reason why here needs to put those images into the
|
||||||
# list separately.
|
# list separately.
|
||||||
KUBE_IMAGES="kube-apiserver kube-controller-manager kube-scheduler kube-proxy"
|
KUBE_IMAGES="kube-apiserver kube-controller-manager kube-scheduler kube-proxy"
|
||||||
|
|
|
@ -95,7 +95,7 @@ If you use the settings like the one above, you'll need to define in your invent
|
||||||
|
|
||||||
* `registry_host`: Container image registry. If you _don't_ use the same repository path for the container images that
|
* `registry_host`: Container image registry. If you _don't_ use the same repository path for the container images that
|
||||||
the ones defined
|
the ones defined
|
||||||
in [kubesprays-defaults's role defaults](https://github.com/kubernetes-sigs/kubespray/blob/master/roles/kubespray-defaults/main/download.yml)
|
in [kubesprays-defaults's role defaults](https://github.com/kubernetes-sigs/kubespray/blob/master/roles/kubespray-defaults/defaults/main/download.yml)
|
||||||
, you need to override the `*_image_repo` for these container images. If you want to make your life easier, use the
|
, you need to override the `*_image_repo` for these container images. If you want to make your life easier, use the
|
||||||
same repository path, you won't have to override anything else.
|
same repository path, you won't have to override anything else.
|
||||||
* `registry_addr`: Container image registry, but only have [domain or ip]:[port].
|
* `registry_addr`: Container image registry, but only have [domain or ip]:[port].
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
# After a new version of Kubernetes has been released,
|
# After a new version of Kubernetes has been released,
|
||||||
# run this script to update roles/kubespray-defaults/main/download.yml
|
# run this script to update roles/kubespray-defaults/defaults/main/download.yml
|
||||||
# with new hashes.
|
# with new hashes.
|
||||||
|
|
||||||
import hashlib
|
import hashlib
|
||||||
|
@ -10,7 +10,7 @@ import sys
|
||||||
import requests
|
import requests
|
||||||
from ruamel.yaml import YAML
|
from ruamel.yaml import YAML
|
||||||
|
|
||||||
MAIN_YML = "../roles/kubespray-defaults/main/download.yml"
|
MAIN_YML = "../roles/kubespray-defaults/defaults/main/download.yml"
|
||||||
|
|
||||||
def open_main_yaml():
|
def open_main_yaml():
|
||||||
yaml = YAML()
|
yaml = YAML()
|
||||||
|
|
Loading…
Reference in New Issue