Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ansible/roles/add-kubelet-logging/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
path: "{{ prometheus_dir }}"
register: promdir

- name: Check if the file exists
- name: check if the file exists
ansible.builtin.stat:
path: "{{ sa_token_file }}"
register: token_file
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/create-service-account/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
ansible.builtin.command: oc create -f metrics-sa.yaml

- name: create token for service account
ansible.builtin.command: oc create token metrics-server -n kube-system --duration 72h
ansible.builtin.command: oc create token metrics-server -n kube-system --duration 720h
register: token

- name: remove metrics service account yaml
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/create-vm/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

vm_name: microshift-dev
vm_disk_dir: /var/lib/libvirt/images
iso_file: /var/lib/libvirt/images/rhel-9.2-x86_64-dvd.iso
iso_file: /var/lib/libvirt/images/rhel-9.4-x86_64-dvd.iso
num_cpu: 4
ram_size: 8
disk_size: 60
Expand Down
4 changes: 2 additions & 2 deletions ansible/roles/install-logging-exporters/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cadvisor_external: false
cadvisor_url: https://github.com/google/cadvisor/releases/download/v0.39.2/cadvisor
cadvisor_checksum: sha256:65109ea14132bce91bb2a92dc70248c705ba26fb2a7d55e295bf4192940a396c
cadvisor_url: https://github.com/google/cadvisor/releases/download/v0.47.2/cadvisor-v0.47.2-linux-amd64
cadvisor_checksum: sha256:30602f675e9bcd39b0d4cd4bd9e83c0849dd4bb3a60a0544b9f2a6451a3facfe

process_exporter_url: https://github.com/ncabatoff/process-exporter/releases/download/v0.7.10/process-exporter_0.7.10_linux_amd64.rpm

Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/install-microshift/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ etcd_repo: https://github.com/openshift/etcd.git
microshift_dir: "{{ ansible_env.HOME }}/microshift"
microshift_repo: https://github.com/openshift/microshift.git
microshift_rpms: []
microshift_version: 4.14.0-ec.4-202308011235.p0
microshift_version: 4.17.1

du_dirs:
- /
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[crio.metrics]
enable_metrics = true
metrics_host = "0.0.0.0"
metrics_port = 9537
8 changes: 5 additions & 3 deletions ansible/roles/manage-repos/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
---
# manage-repos default vars

microshift_version: 4.14.0-rc.4
ocp_repo_name: microshift-{{ ocp_version }}-for-rhel-{{ ansible_distribution_major_version }}-mirrorbeta-{{ ansible_architecture }}-rpms
microshift_version: 4.18.0-rc.3
ocp_version: "{{ microshift_version.split('.')[0] }}.{{ microshift_version.split('.')[1] }}"
ocpbeta_base_url: "https://mirror.openshift.com/pub/openshift-v4/{{ ansible_architecture }}/microshift/ocp/{{ microshift_version }}/el9/os/"
repo_list:
- { repo_name: 'microshift-{{ ocp_version }}-for-rhel-{{ ansible_distribution_major_version }}-mirrorbeta-{{ ansible_architecture }}-rpms', repo_url: "https://mirror.openshift.com/pub/openshift-v4/{{ ansible_architecture }}/microshift/ocp/{{ microshift_version }}/el9/os/"}
- { repo_name: 'microshift-{{ ocp_version }}-deps-for-rhel-{{ ansible_distribution_major_version }}-mirrorbeta-{{ ansible_architecture }}-rpms', repo_url: "https://mirror.openshift.com/pub/openshift-v4/{{ ansible_architecture }}/dependencies/rpms/{{ ocp_version }}-el9-beta/" }

rhel_beta: ''
rhel_repos:
- rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-baseos-{{ rhel_beta }}rpms
Expand Down
13 changes: 13 additions & 0 deletions ansible/roles/manage-repos/tasks/create-mirrors.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
- name: create mirrors block
block:
- name: check if microshift_version is valid for pre-release
ansible.builtin.uri:
url: "{{ item.repo_url }}"
method: GET
status_code: 200
timeout: 5

- name: install microshift mirror repo for pre-releases
ansible.builtin.template:
src: ocpbeta.repo.j2
dest: "/etc/yum.repos.d/{{ item.repo_name }}.repo"
22 changes: 5 additions & 17 deletions ansible/roles/manage-repos/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,30 +40,18 @@
ansible.builtin.set_fact:
microshift_prerelease: "{{ 'rc' in microshift_version or 'ec' in microshift_version }}"

- block:
- name: check if microshift_version is valid for pre-release
ansible.builtin.uri:
url: "{{ ocpbeta_base_url }}"
method: GET
status_code: 200
timeout: 5

- name: install microshift mirror repo for pre-releases
ansible.builtin.template:
src: ocpbeta.repo.j2
dest: /etc/yum.repos.d/{{ ocp_repo_name }}.repo
- name: create microshift prerelease mirrors
include_tasks: roles/manage-repos/tasks/create-mirrors.yaml
loop: "{{ repo_list }}"
when:
- microshift_prerelease
- not build_microshift

- name: overwrite ocp_version if microshift_prerelease
ansible.builtin.set_fact:
ocp_version: "{{ ocp_version.split('.')[0] }}.{{ (ocp_version.split('.')[1] | int) - 1 }}"
when: microshift_prerelease

- name: enable required repos for microshift
community.general.rhsm_repository:
name: "{{ rhel_repos }}"
when:
- not microshift_prerelease

- name: install EPEL repo
ansible.builtin.dnf:
Expand Down
6 changes: 3 additions & 3 deletions ansible/roles/manage-repos/templates/ocpbeta.repo.j2
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[{{ ocp_repo_name }}]
name=MicroShift {{ ocp_version }} RPMs for RHEL {{ ansible_distribution_major_version }}
baseurl={{ ocpbeta_base_url }}
[{{ item.repo_name }}]
name=MicroShift {{ ocp_version }} RPMs for RHEL {{ ansible_distribution_major_version }}
baseurl={{ item.repo_url }}
enabled=1
gpgcheck=0
skip_if_unavailable=0
27 changes: 25 additions & 2 deletions ansible/roles/microshift-start/files/ready.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
COMMAND="oc get pods -A -o 'jsonpath={..status.conditions[?(@.type==\"Ready\")].status}'"
# Define the specific output we are waiting for
EXPECTED_PODS=6
ALL_PODS=8
ALL_PODS=10
# Define the location of the microshift kubeconfig
KUBECONFIG="/var/lib/microshift/resources/kubeadmin/kubeconfig"
USER_KUBECONFIG="${HOME}/.kube"
Expand Down Expand Up @@ -35,6 +35,29 @@ echo "Kubeconfig: ${DURATION} seconds"
sudo cp ${KUBECONFIG} "${USER_KUBECONFIG}"/config
sudo chown "${USER}":"${USER}" "${USER_KUBECONFIG}"/config

# podcheck_nostorage fn waits for an expected number of non-storage pods to be in Ready state
podcheck_nostorage() {
expected=$1
while true; do
OUTPUT=$(eval "oc get po -A --no-headers")
PODS_READY=$(echo "${OUTPUT}" | grep -vE "csi|lvm" | grep -c Running)

# Wait until all pods report ready
if [[ ${PODS_READY} -ge ${expected} ]]; then
break
fi
sleep 1
done

oc get po -A

# Calculate the time it took for all pods to be running
END_TIME=$(date +%s)
DURATION=$((END_TIME - START_TIME))

echo "Boot: ${DURATION} seconds (${expected} pods)"
}

# podcheck fn waits for an expected number of pods to be in Ready state
podcheck() {
expected=$1
Expand All @@ -58,5 +81,5 @@ podcheck() {
echo "Boot: ${DURATION} seconds (${expected} pods)"
}

podcheck ${EXPECTED_PODS}
podcheck_nostorage ${EXPECTED_PODS}
podcheck ${ALL_PODS}
2 changes: 1 addition & 1 deletion ansible/roles/microshift-start/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
- name: vnstat collection tasks
block:
- name: wait for vnstat db to populate
ansible.builtin.shell: vnstat | grep rx
ansible.builtin.shell: vnstat | grep today
retries: 60
delay: 10
register: vnstat_db
Expand Down