Skip to content

Commit

Permalink
[MCAPI-1] feat: upgrade capi and capo (#138)
Browse files Browse the repository at this point in the history
* feat: upgrade capi and capo

* Switch jobs to Zuul

* Run the CAPI jobs

* Fix IP

* Add upgrade job

* Add helm job

* Add jmespath

* Add last non-platform job

* Move linters to Zuul

* Address linter issues

---------

Co-authored-by: Mohammed Naser <[email protected]>
  • Loading branch information
okozachenko1203 and mnaser authored Oct 14, 2024
1 parent 9ecce5d commit f14e637
Show file tree
Hide file tree
Showing 27 changed files with 47,257 additions and 358 deletions.
38 changes: 0 additions & 38 deletions .github/workflows/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,44 +21,6 @@ on:
- main

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
scenario:
- cluster-api
- cluster-api-upgrade
- helm
- upload-helm-chart
distro:
- rockylinux9
- ubuntu2004
- ubuntu2204
steps:
- name: Checkout project
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
cache: pip

- name: Install Molecule
run: pip install -r requirements.txt

- name: Turn off swap
run: sudo swapoff -a

- name: Bump number of inotify watchers
run: sudo sysctl fs.inotify.max_user_watches=524288

- name: Run Molecule
run: molecule test -s ${{ matrix.scenario }}
env:
MOLECULE_DISTRO: ${{ matrix.distro }}

kubernetes:
runs-on: ubuntu-latest
timeout-minutes: 15
Expand Down
26 changes: 17 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
exclude: '^(charts)'
exclude: '^(roles/cluster_api/files/providers|roles/(cilium|cert_manager)/files/chart)'

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand All @@ -7,15 +7,23 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/compilerla/conventional-pre-commit
rev: v2.0.0
- repo: https://github.com/psf/black
rev: 24.4.0
hooks:
- id: conventional-pre-commit
stages:
- commit-msg
- id: black

- repo: https://github.com/ansible/ansible-lint
rev: v6.13.1
- repo: https://github.com/pycqa/flake8
rev: 7.0.0
hooks:
- id: flake8

- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
args: ["--profile", "black", "--filter-files"]

- repo: https://github.com/ansible/ansible-lint.git
rev: v24.7.0
hooks:
- id: ansible-lint
files: \.(yaml|yml)$
2 changes: 1 addition & 1 deletion meta/runtime.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
requires_ansible: ">=2.13.4"
requires_ansible: ">=2.15.0"
10 changes: 5 additions & 5 deletions molecule/cluster-api-upgrade/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
- role: vexxhost.kubernetes.cert_manager
- role: vexxhost.kubernetes.cluster_api
vars:
clusterctl_version: 1.5.1
cluster_api_core_version: 1.5.1
cluster_api_bootstrap_version: 1.5.1
cluster_api_control_plane_version: 1.5.1
cluster_api_infrastructure_version: 0.8.0
clusterctl_version: 1.6.0
cluster_api_core_version: 1.6.0
cluster_api_bootstrap_version: 1.6.0
cluster_api_control_plane_version: 1.6.0
cluster_api_infrastructure_version: 0.9.0
43 changes: 12 additions & 31 deletions molecule/cluster-api/molecule.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,26 @@
# Copyright (c) 2023 VEXXHOST, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
# Copyright (c) 2024 VEXXHOST, Inc.
# SPDX-License-Identifier: Apache-2.0

dependency:
name: galaxy
driver:
name: docker
name: default
options:
managed: False
ansible_connection_options:
ansible_become: "true"
ansible_connection: local
platforms:
- name: kubernetes-${MOLECULE_SCENARIO_NAME}
image: geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2204}-ansible:latest
command: ${MOLECULE_DOCKER_COMMAND:-""}
privileged: true
cgroupns_mode: host
pre_build_image: true
etc_hosts:
k8s: 172.17.0.100
environment:
container: docker
security_opts:
- apparmor=unconfined
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
- /lib/modules:/lib/modules:ro
- /usr/src:/usr/src:ro
- name: instance
groups:
- controllers
provisioner:
name: ansible
config_options:
connection:
pipelining: true
defaults:
callbacks_enabled: ansible.posix.profile_tasks
inventory:
group_vars:
all:
Expand All @@ -53,6 +34,6 @@ provisioner:
keepalived_interface: "{{ ansible_facts['default_ipv4'].interface }}"
keepalived_vip: 172.17.0.100
keepalived_vrid: 42
kubernetes_hostname: k8s
kubernetes_hostname: "{{ ansible_facts['default_ipv4'].address }}"
verifier:
name: ansible
36 changes: 10 additions & 26 deletions molecule/helm/molecule.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,23 @@
# Copyright (c) 2023 VEXXHOST, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
# Copyright (c) 2024 VEXXHOST, Inc.
# SPDX-License-Identifier: Apache-2.0

dependency:
name: galaxy
driver:
name: docker
name: default
options:
managed: False
ansible_connection_options:
ansible_become: "true"
ansible_connection: local
platforms:
- name: instance
image: geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2204}-ansible:latest
command: ${MOLECULE_DOCKER_COMMAND:-""}
privileged: true
cgroupns_mode: host
pre_build_image: true
environment:
container: docker
security_opts:
- apparmor=unconfined
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
- /lib/modules:/lib/modules:ro
provisioner:
name: ansible
config_options:
connection:
pipelining: true
defaults:
callbacks_enabled: ansible.posix.profile_tasks
verifier:
name: ansible
33 changes: 0 additions & 33 deletions molecule/helm/prepare.yml

This file was deleted.

38 changes: 12 additions & 26 deletions molecule/upload-helm-chart/molecule.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,25 @@
# Copyright (c) 2023 VEXXHOST, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
# Copyright (c) 2024 VEXXHOST, Inc.
# SPDX-License-Identifier: Apache-2.0

dependency:
name: galaxy
driver:
name: docker
name: default
options:
managed: False
ansible_connection_options:
ansible_become: "true"
ansible_connection: local
platforms:
- name: instance
image: geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2204}-ansible:latest
command: ${MOLECULE_DOCKER_COMMAND:-""}
privileged: true
cgroupns_mode: host
pre_build_image: true
environment:
container: docker
security_opts:
- apparmor=unconfined
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
- /lib/modules:/lib/modules:ro
groups:
- controllers
provisioner:
name: ansible
config_options:
connection:
pipelining: true
defaults:
callbacks_enabled: ansible.posix.profile_tasks
verifier:
name: ansible
33 changes: 0 additions & 33 deletions molecule/upload-helm-chart/prepare.yml

This file was deleted.

Loading

0 comments on commit f14e637

Please sign in to comment.