diff --git a/compose.yaml b/compose.yaml index 8fd3e0d9..e2e5b54a 100644 --- a/compose.yaml +++ b/compose.yaml @@ -35,6 +35,8 @@ services: environment: - ANSIBLE_DISPLAY_SKIPPED_HOSTS=${ANSIBLE_DISPLAY_SKIPPED_HOSTS:-false} - ANSIBLE_INVENTORY=inventories/partition.yaml,clab-mini-lab/ansible-inventory.yml + - KUBECONFIG=/mini-lab/.kubeconfig + - K8S_AUTH_KUBECONFIG=/mini-lab/.kubeconfig - CI=${CI} - DOCKER_HUB_USER=${DOCKER_HUB_USER} - DOCKER_HUB_TOKEN=${DOCKER_HUB_TOKEN} diff --git a/deploy_partition.yaml b/deploy_partition.yaml index 2ad4de4d..12d87b39 100644 --- a/deploy_partition.yaml +++ b/deploy_partition.yaml @@ -91,6 +91,33 @@ pull: true failed_when: false +- name: Install python client and generate deployment token + hosts: localhost + connection: local + gather_facts: false + pre_tasks: + - name: Wait until the metal-apiserver is running + kubernetes.core.k8s_info: + kind: Deployment + name: metal-apiserver + namespace: "{{ metal_control_plane_namespace }}" + wait: true + wait_sleep: 1 + wait_timeout: 600 + - name: Wait until the admin_editor_token secret exists + kubernetes.core.k8s_info: + kind: Secret + name: "{{ metal_deployment_token_secret_name }}" + namespace: "{{ metal_deployment_token_secret_namespace }}" + wait: true + wait_sleep: 1 + wait_timeout: 600 + roles: + - name: ansible-common + tags: always + - name: metal-roles/common/roles/metal-v2-client + - name: metal-roles/common/roles/metal-deployment-token + - name: Deploy pixiecore on leaf01 hosts: leaf01 become: true @@ -99,6 +126,10 @@ tags: always - name: metal-roles/partition/roles/pixiecore tags: pixiecore + - name: metal-roles/common/roles/metal-deployment-token + tags: image-cache + - name: metal-roles/partition/roles/image-cache + tags: image-cache - name: Deploy monitoring on leaf01 hosts: leaf01 diff --git a/inventories/group_vars/all/release_vector.yaml b/inventories/group_vars/all/release_vector.yaml index 0fba64d3..49b02d04 100644 --- a/inventories/group_vars/all/release_vector.yaml +++ b/inventories/group_vars/all/release_vector.yaml @@ -12,7 +12,7 @@ metal_stack_release_vectors: # metal_api_image_name: # metal_api_image_tag: # metal_apiserver_image_name: -# metal_apiserver_image_tag: +metal_apiserver_image_tag: v0.8.1 # metal_tenant_apiserver_image_name: # metal_tenant_apiserver_image_tag: # metal_metalctl_image_name: @@ -30,6 +30,9 @@ metal_stack_release_vectors: # headscale_db_image_name: postgres # sonic_configdb_utils_image_name: # sonic_configdb_utils_image_tag: +image_cache_sync_image_name: ghcr.io/metal-stack/metal-image-cache-sync +image_cache_sync_image_tag: pr-21-migrate-to-metal-apiserver +metal_api_version: v0.3.1 # ... # @@ -38,8 +41,8 @@ metal_stack_release_vectors: ## # ansible_common_version: -# metal_roles_version: pr- -# metal_ansible_modules_version: +metal_roles_version: pr-453-migrate-metal-image-cache-sync-to-metal-apiserver +metal_ansible_modules_version: v2-updates ## ## helm charts diff --git a/inventories/group_vars/control_plane/metal.yml b/inventories/group_vars/control_plane/metal.yml index 40db02a6..6ddabf57 100644 --- a/inventories/group_vars/control_plane/metal.yml +++ b/inventories/group_vars/control_plane/metal.yml @@ -20,6 +20,7 @@ metal_apiserver_url: http://v2.{{ metal_control_plane_ingress_dns }}:8080 metal_apiserver_oidc_discovery_url: https://auth.{{ metal_control_plane_ingress_dns }}:4443/.well-known/openid-configuration metal_apiserver_oidc_end_session_url: "https://auth.{{ metal_control_plane_ingress_dns }}:4443/oidc/v1/end_session" +metal_apiserver_session_secret: long-secret metal_apiserver_secure_cookie: false diff --git a/inventories/group_vars/partition/image_cache.yaml b/inventories/group_vars/partition/image_cache.yaml new file mode 100644 index 00000000..ab66b26c --- /dev/null +++ b/inventories/group_vars/partition/image_cache.yaml @@ -0,0 +1,9 @@ +metal_control_plane_ingress_dns: 172.17.0.1.nip.io +metal_apiserver_url: http://v2.{{ metal_control_plane_ingress_dns }}:8080 +image_cache_sync_metal_apiserver_url: "{{ metal_apiserver_url }}" +image_cache_sync_token_expiration: 20m + +image_cache_sync_excludes: + - "/pull_requests/" + - "/stable/" +image_cache_sync_expiration_grace_period: 100 diff --git a/inventories/partition.yaml b/inventories/partition.yaml index fb3aa8a3..c94ed694 100644 --- a/inventories/partition.yaml +++ b/inventories/partition.yaml @@ -6,6 +6,7 @@ partition: hosts: localhost: ansible_python_interpreter: "{{ ansible_playbook_python }}" + ansible_connection: local children: dell_sonic: leaves: