Git Product home page Git Product logo

Comments (10)

chrxmvtik avatar chrxmvtik commented on May 30, 2024

@sbmrvv
After verifying your inventory file, I don't seem to find proper variables required for offline installation.

Did you follow the instructions?

Step 1 Download offline files, copy them to offline environment and run nginx as repo
Step 2 Uncomment files repo and specify your own IP/URL (step 1)

I recently deployed offline cluster and everything worked flawlessly.

from kubespray.

sbmrvv avatar sbmrvv commented on May 30, 2024

@chrxmvtik

I'm new in kubespray and I think I'm a little confused. Needs help !

Local test env:
Harbor registry https://192.168.33.80:444 (with a self-signed certificate) and Nexus http://192.168.33.80 (for testing purposes and in case harbor fails with images, can be used for files and images) and an Nginx Repo http://192.168.33.81/rpm (can be used for files)

Offline deployment

Please guide me, If I did wrong. To get list of images I ran generate_list.sh, it gave me list of usage images(images.list) and files(files.list)

./generate_list.sh
[WARNING]: Found both group and host with same name: geo-api
[WARNING]: Skipping callback plugin 'ara_default', unable to load

PLAY [Collect container images for offline deployment] ************************************************************************************************************************************************************
Wednesday 13 March 2024  11:00:55 +0500 (0:00:00.025)       0:00:00.025 ******* 
Wednesday 13 March 2024  11:00:55 +0500 (0:00:00.022)       0:00:00.047 ******* 
Wednesday 13 March 2024  11:00:55 +0500 (0:00:00.016)       0:00:00.063 ******* 
Wednesday 13 March 2024  11:00:55 +0500 (0:00:00.011)       0:00:00.075 ******* 
Wednesday 13 March 2024  11:00:55 +0500 (0:00:00.016)       0:00:00.091 ******* 
Wednesday 13 March 2024  11:00:55 +0500 (0:00:00.011)       0:00:00.103 ******* 
Wednesday 13 March 2024  11:00:55 +0500 (0:00:00.016)       0:00:00.119 ******* 
Wednesday 13 March 2024  11:00:55 +0500 (0:00:00.011)       0:00:00.131 ******* 
Wednesday 13 March 2024  11:00:55 +0500 (0:00:00.018)       0:00:00.150 ******* 
Wednesday 13 March 2024  11:00:55 +0500 (0:00:00.019)       0:00:00.169 ******* 
Wednesday 13 March 2024  11:00:55 +0500 (0:00:00.011)       0:00:00.181 ******* 
Wednesday 13 March 2024  11:00:55 +0500 (0:00:00.011)       0:00:00.192 ******* 
Wednesday 13 March 2024  11:00:55 +0500 (0:00:00.019)       0:00:00.212 ******* 
Wednesday 13 March 2024  11:00:55 +0500 (0:00:00.011)       0:00:00.223 ******* 
Wednesday 13 March 2024  11:00:55 +0500 (0:00:00.019)       0:00:00.242 ******* 
Wednesday 13 March 2024  11:00:55 +0500 (0:00:00.016)       0:00:00.258 ******* 
Wednesday 13 March 2024  11:00:55 +0500 (0:00:00.243)       0:00:00.502 ******* 

TASK [Collect container images for offline deployment] ************************************************************************************************************************************************************
changed: [localhost] => (item=files)
changed: [localhost] => (item=images)

PLAY RECAP ********************************************************************************************************************************************************************************************************
localhost                  : ok=1    changed=1    unreachable=0    failed=0    skipped=16   rescued=0    ignored=0   

Wednesday 13 March 2024  11:00:56 +0500 (0:00:00.617)       0:00:01.119 ******* 
=============================================================================== 
Collect container images for offline deployment ------------------------------------------------------------------------------------------------------------------------------------------------------------ 0.62s
download : Download | Download files / images -------------------------------------------------------------------------------------------------------------------------------------------------------------- 0.24s
kubespray-defaults : Gather ansible_default_ipv4 from all hosts -------------------------------------------------------------------------------------------------------------------------------------------- 0.02s
download : Prep_download | On localhost, check if user has access to the container runtime without using sudo ---------------------------------------------------------------------------------------------- 0.02s
download : Prep_download | Register docker images info ----------------------------------------------------------------------------------------------------------------------------------------------------- 0.02s
download : Prep_download | Create local cache for files and images on control node ------------------------------------------------------------------------------------------------------------------------- 0.02s
download : Prep_download | On localhost, check if passwordless root is possible ---------------------------------------------------------------------------------------------------------------------------- 0.02s
kubespray-defaults : Create fallback_ips_base -------------------------------------------------------------------------------------------------------------------------------------------------------------- 0.02s
kubespray-defaults : Set no_proxy to all assigned cluster IPs and hostnames -------------------------------------------------------------------------------------------------------------------------------- 0.02s
kubespray-defaults : Set `etcd_deployment_type` to "kubeadm" if `etcd_kubeadm_enabled` is true ------------------------------------------------------------------------------------------------------------- 0.02s
download : Download | Get kubeadm binary and list of required images --------------------------------------------------------------------------------------------------------------------------------------- 0.02s
download : Prep_download | Check that local user is in group or can become root ---------------------------------------------------------------------------------------------------------------------------- 0.01s
kubespray-defaults : Populates no_proxy to all hosts ------------------------------------------------------------------------------------------------------------------------------------------------------- 0.01s
kubespray-defaults : Set fallback_ips ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- 0.01s
download : Prep_download | Set a few facts ----------------------------------------------------------------------------------------------------------------------------------------------------------------- 0.01s
download : Prep_download | Parse the outputs of the previous commands -------------------------------------------------------------------------------------------------------------------------------------- 0.01s
download : Prep_download | Create staging directory on remote node ----------------------------------------------------------------------------------------------------------------------------------------- 0.01s

ll temp
-rw-r--r-- 1 myuser myuser 1.9K Mar 13 11:00 files.list
-rw-rw-r-- 1 myuser myuser 2.7K Mar 13 11:00 files.list.template
-rw-r--r-- 1 myuser myuser 2.4K Mar 13 11:00 images.list
-rw-rw-r-- 1 myuser myuser 3.3K Mar 13 11:00 images.list.template
❯ echo $DESTINATION_REGISTRY
192.168.33.80
❯ echo $REGISTRY_PORT
444
❯ ./manage-offline-container-images.sh create
error: current-context is not set
Getting images from current ""
E0313 10:58:39.873534   18467 memcache.go:238] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused
E0313 10:58:39.873715   18467 memcache.go:238] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused
E0313 10:58:39.874942   18467 memcache.go:238] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused
E0313 10:58:39.876190   18467 memcache.go:238] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused
E0313 10:58:39.877353   18467 memcache.go:238] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused
E0313 10:58:39.878569   18467 memcache.go:238] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused
E0313 10:58:39.879738   18467 memcache.go:238] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused
The connection to the server localhost:8080 was refused - did you specify the right host or port?
The connection to the server localhost:8080 was refused - did you specify the right host or port?
latest: Pulling from library/registry
Digest: sha256:f4e1b878d4bc40a1f65532d68c94dcfbab56aa8cba1f00e355a206e7f6cc9111
Status: Image is up to date for registry:latest
docker.io/library/registry:latest
./container-images/
./container-images/registry-latest.tar

./container-images.tar.gz is created to contain your container images.
Please keep this file and bring it to your offline environment.

❯ ./manage-offline-container-images.sh register
Images will be pushed to 192.168.33.80
./container-images/
./container-images/registry-latest.tar
Loaded image: registry:latest
ed0e8e942a34f9867b4ba9a31cfdced36064936375d0e62ccfc3964a78940361
cat: ./container-images/container-images.txt: No such file or directory
error during connect: Post "http://%2Fvar%2Frun%2Fdocker.sock/v1.44/images/load?quiet=1": read ./container-images/: is a directory
"docker image inspect" requires at least 1 argument.
See 'docker image inspect --help'.

Usage:  docker image inspect [OPTIONS] IMAGE [IMAGE...]

Display detailed information on one or more images
Failed to get file_name for line 

Could you help me to solve the issue please !

./manage-offline-files.sh successfully downloaded the required files and nginx is running!

from kubespray.

sbmrvv avatar sbmrvv commented on May 30, 2024

So, I manually installed all required images from images.list then pushed to my local repo. After running playbook it gives:

The conditional check 'download.enabled' failed. The error was: error while evaluating conditional (download.enabled): {{ download_defaults | combine(item.value) }}: 'item' is undefined. 'item' is undefined. {{ download_defaults | combine(item.value) }}: 'item' is undefined. 'item' is undefined

The error appears to be in './kubespray/roles/download/tasks/main.yml': line 19, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


- name: Download | Download files / images
  ^ here

TASK [download : Download | Download files / images] ***************************************************************************************************************************************
./kubespray/roles/download/tasks/main.yml:19
fatal: [node1]: FAILED! => {
    "msg": "{{ skip_kubeadm_images | ternary({}, _kubeadm_images) }}: {{ dict(names | map('regex_replace', '^(.*)', 'kubeadm_\\1') | zip( repos | zip(_tags, _groups) | map('zip', keys) | map('map', 'reverse') | map('community.general.dict') | map('combine', defaults))) | dict2items | rejectattr('key', 'in', excluded) | items2dict }}: {{ names | map('extract', images_groups) }}: 'dict object' has no attribute '192.168.33.80'. 'dict object' has no attribute '192.168.33.80'. {{ names | map('extract', images_groups) }}: 'dict object' has no attribute '192.168.33.80'. 'dict object' has no attribute '192.168.33.80'. {{ dict(names | map('regex_replace', '^(.*)', 'kubeadm_\\1') | zip( repos | zip(_tags, _groups) | map('zip', keys) | map('map', 'reverse') | map('community.general.dict') | map('combine', defaults))) | dict2items | rejectattr('key', 'in', excluded) | items2dict }}: {{ names | map('extract', images_groups) }}: 'dict object' has no attribute '192.168.33.80'. 'dict object' has no attribute '192.168.33.80'. {{ names | map('extract', images_groups) }}: 'dict object' has no attribute '192.168.33.80'. 'dict object' has no attribute '192.168.33.80'. {{ skip_kubeadm_images | ternary({}, _kubeadm_images) }}: {{ dict(names | map('regex_replace', '^(.*)', 'kubeadm_\\1') | zip( repos | zip(_tags, _groups) | map('zip', keys) | map('map', 'reverse') | map('community.general.dict') | map('combine', defaults))) | dict2items | rejectattr('key', 'in', excluded) | items2dict }}: {{ names | map('extract', images_groups) }}: 'dict object' has no attribute '192.168.33.80'. 'dict object' has no attribute '192.168.33.80'. {{ names | map('extract', images_groups) }}: 'dict object' has no attribute '192.168.33.80'. 'dict object' has no attribute '192.168.33.80'. {{ dict(names | map('regex_replace', '^(.*)', 'kubeadm_\\1') | zip( repos | zip(_tags, _groups) | map('zip', keys) | map('map', 'reverse') | map('community.general.dict') | map('combine', defaults))) | dict2items | rejectattr('key', 'in', excluded) | items2dict }}: {{ names | map('extract', images_groups) }}: 'dict object' has no attribute '192.168.33.80'. 'dict object' has no attribute '192.168.33.80'. {{ names | map('extract', images_groups) }}: 'dict object' has no attribute '192.168.33.80'. 'dict object' has no attribute '192.168.33.80'"
}

from kubespray.

sbmrvv avatar sbmrvv commented on May 30, 2024

I read offline installation carefully. It seems I had to give a value to IMAGES_FROM_FILE for manage-offline-container-images.sh create

from kubespray.

sbmrvv avatar sbmrvv commented on May 30, 2024

./manage-offline-container-images.sh register worked perfectly too.

But it still gives the error on TASK [download: Download | Download files/images] that I mentioned above

from kubespray.

sbmrvv avatar sbmrvv commented on May 30, 2024

Can anyone help me please?

from kubespray.

John060200 avatar John060200 commented on May 30, 2024

Same

TASK [download: Download | Download files/images]

/bug

from kubespray.

John060200 avatar John060200 commented on May 30, 2024

@sbmrvv

Have you found a solution?

from kubespray.

sbmrvv avatar sbmrvv commented on May 30, 2024

@John060200 not yet(

I recently deployed offline cluster and everything worked flawlessly.

@chrxmvtik could you share version of kubespray (commit) or release tag?

from kubespray.

sbmrvv avatar sbmrvv commented on May 30, 2024

Version of Kubespray 1.24.1 (commit - 2cb8c85) fix the issue

from kubespray.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.