Compare commits
40 Commits
Appliance.
...
76d3b6c742
Author | SHA1 | Date | |
---|---|---|---|
76d3b6c742 | |||
a5248bd54c | |||
cbedc9679f | |||
740b6b3dc9 | |||
0ba87988bc | |||
aa14a8a3a8 | |||
1f55ff7cfa | |||
ba4a0148ff | |||
c177dbd03b | |||
2e8ce6cc00 | |||
7fd1cf73db | |||
cf001cd0ce | |||
438b944011 | |||
679a9457b5 | |||
8b4a1e380c | |||
0468cd6269 | |||
b808397d47 | |||
8fd0136bb7 | |||
479d896599 | |||
263f156eb1 | |||
f1dfc83d7c | |||
5b950a3834 | |||
978f39d45b | |||
9b9ab6b784 | |||
24dca2755a | |||
0d1db2f29f | |||
cce39a5bb7 | |||
823cc467fa | |||
9cb89bf055 | |||
358cbe39ea | |||
0fee2df2a6 | |||
e4e58e4789 | |||
75158a8a5b | |||
c83d541a0d | |||
a46610f828 | |||
fe5147bd2e | |||
6d168f0517 | |||
68445ee13f | |||
48c14afd0f | |||
2addda3f06 |
66
.drone.yml
66
.drone.yml
@ -10,6 +10,11 @@ volumes:
|
||||
claim:
|
||||
name: flexvolsmb-drone-scratch
|
||||
|
||||
trigger:
|
||||
event:
|
||||
exclude:
|
||||
- tag
|
||||
|
||||
steps:
|
||||
- name: Debugging information
|
||||
image: bv11-cr01.bessems.eu/library/packer-extended
|
||||
@ -21,8 +26,6 @@ steps:
|
||||
- yamllint --version
|
||||
|
||||
- name: Linting
|
||||
depends_on:
|
||||
- Debugging information
|
||||
image: bv11-cr01.bessems.eu/library/packer-extended
|
||||
pull: always
|
||||
commands:
|
||||
@ -32,9 +35,48 @@ steps:
|
||||
packer/preseed/UbuntuServer22.04/user-data \
|
||||
scripts
|
||||
|
||||
- name: Semantic Release (Dry-run)
|
||||
image: bv11-cr01.bessems.eu/proxy/library/node:20-slim
|
||||
pull: always
|
||||
commands:
|
||||
- |
|
||||
apt-get update
|
||||
- |
|
||||
apt-get install -y --no-install-recommends \
|
||||
curl \
|
||||
git-core \
|
||||
jq \
|
||||
ca-certificates
|
||||
- |
|
||||
curl -L https://api.github.com/repos/mikefarah/yq/releases/latest | \
|
||||
jq -r '.assets[] | select(.name | endswith("yq_linux_amd64")) | .browser_download_url' | \
|
||||
xargs -I {} curl -L -o /bin/yq {} && \
|
||||
chmod +x /bin/yq
|
||||
- |
|
||||
npm install \
|
||||
semantic-release \
|
||||
@semantic-release/commit-analyzer \
|
||||
@semantic-release/exec \
|
||||
- |
|
||||
export K8S_VERSION=$(yq '.components.clusterapi.workload.version.k8s' < ./ansible/vars/metacluster.yml)
|
||||
export GIT_CREDENTIALS=$${GIT_USERNAME}:$${GIT_APIKEY}
|
||||
- |
|
||||
npx semantic-release \
|
||||
--package @semantic-release/exec \
|
||||
--package semantic-release \
|
||||
--branches ${DRONE_BRANCH} \
|
||||
--tag-format "K8s_$${K8S_VERSION}-v\$${version}" \
|
||||
--dry-run \
|
||||
--plugins @semantic-release/commit-analyzer,@semantic-release/exec \
|
||||
--analyzeCommits @semantic-release/commit-analyzer \
|
||||
--verifyRelease @semantic-release/exec \
|
||||
--verifyReleaseCmd 'echo "$${nextRelease.version}" > .version'
|
||||
environment:
|
||||
GIT_APIKEY:
|
||||
from_secret: git_apikey
|
||||
GIT_USERNAME: djpbessems
|
||||
|
||||
- name: Install Ansible Galaxy collections
|
||||
depends_on:
|
||||
- Linting
|
||||
image: bv11-cr01.bessems.eu/library/packer-extended
|
||||
pull: always
|
||||
commands:
|
||||
@ -42,13 +84,8 @@ steps:
|
||||
ansible-galaxy collection install \
|
||||
-r ansible/requirements.yml \
|
||||
-p ./ansible/collections
|
||||
volumes:
|
||||
- name: scratch
|
||||
path: /scratch
|
||||
|
||||
- name: Kubernetes Bootstrap Appliance
|
||||
depends_on:
|
||||
- Install Ansible Galaxy collections
|
||||
image: bv11-cr01.bessems.eu/library/packer-extended
|
||||
pull: always
|
||||
commands:
|
||||
@ -57,6 +94,7 @@ steps:
|
||||
packer/preseed/UbuntuServer22.04/user-data
|
||||
- |
|
||||
export K8S_VERSION=$(yq '.components.clusterapi.workload.version.k8s' < ./ansible/vars/metacluster.yml)
|
||||
export APPLIANCE_VERSION=$(cat .version)
|
||||
- |
|
||||
packer init -upgrade \
|
||||
./packer
|
||||
@ -71,6 +109,7 @@ steps:
|
||||
-var ssh_password=$${SSH_PASSWORD} \
|
||||
-var vsphere_password=$${VSPHERE_PASSWORD} \
|
||||
-var k8s_version=$K8S_VERSION \
|
||||
-var appliance_version=$APPLIANCE_VERSION \
|
||||
./packer
|
||||
- |
|
||||
packer build \
|
||||
@ -84,6 +123,7 @@ steps:
|
||||
-var ssh_password=$${SSH_PASSWORD} \
|
||||
-var vsphere_password=$${VSPHERE_PASSWORD} \
|
||||
-var k8s_version=$K8S_VERSION \
|
||||
-var appliance_version=$APPLIANCE_VERSION \
|
||||
./packer
|
||||
environment:
|
||||
DOCKER_USERNAME:
|
||||
@ -106,8 +146,6 @@ steps:
|
||||
path: /scratch
|
||||
|
||||
- name: Kubernetes Upgrade Appliance
|
||||
depends_on:
|
||||
- Install Ansible Galaxy collections
|
||||
image: bv11-cr01.bessems.eu/library/packer-extended
|
||||
pull: alwaysquery(
|
||||
commands:
|
||||
@ -116,6 +154,7 @@ steps:
|
||||
packer/preseed/UbuntuServer22.04/user-data
|
||||
- |
|
||||
export K8S_VERSION=$(yq '.components.clusterapi.workload.version.k8s' < ./ansible/vars/metacluster.yml)
|
||||
export APPLIANCE_VERSION=$(cat .version)
|
||||
- |
|
||||
packer init -upgrade \
|
||||
./packer
|
||||
@ -130,6 +169,7 @@ steps:
|
||||
-var ssh_password=$${SSH_PASSWORD} \
|
||||
-var vsphere_password=$${VSPHERE_PASSWORD} \
|
||||
-var k8s_version=$K8S_VERSION \
|
||||
-var appliance_version=$APPLIANCE_VERSION \
|
||||
./packer
|
||||
- |
|
||||
packer build \
|
||||
@ -143,6 +183,7 @@ steps:
|
||||
-var ssh_password=$${SSH_PASSWORD} \
|
||||
-var vsphere_password=$${VSPHERE_PASSWORD} \
|
||||
-var k8s_version=$K8S_VERSION \
|
||||
-var appliance_version=$APPLIANCE_VERSION \
|
||||
./packer
|
||||
environment:
|
||||
DOCKER_USERNAME:
|
||||
@ -165,9 +206,6 @@ steps:
|
||||
path: /scratch
|
||||
|
||||
- name: Remove temporary resources
|
||||
depends_on:
|
||||
- Kubernetes Bootstrap Appliance
|
||||
- Kubernetes Upgrade Appliance
|
||||
image: bv11-cr01.bessems.eu/library/packer-extended
|
||||
commands:
|
||||
- |
|
||||
|
@ -16,14 +16,16 @@
|
||||
{ 'components': (
|
||||
metacluster_chartvalues |
|
||||
combine({ 'clusterapi': components.clusterapi }) |
|
||||
combine({ 'kubevip' : components.kubevip }) )
|
||||
combine({ 'kubevip' : components.kubevip }) ),
|
||||
'appliance': {
|
||||
'version': (applianceversion)
|
||||
}
|
||||
} | to_nice_yaml(indent=2, width=4096)
|
||||
}}
|
||||
|
||||
- name: Aggregate chart_values into dict
|
||||
ansible.builtin.set_fact:
|
||||
workloadcluster_chartvalues: "{{ workloadcluster_chartvalues | default({}) | combine({ item.key: { 'chart_values': (item.value.chart_values | default('') | from_yaml) } }) }}"
|
||||
# when: item.value.chart_values is defined
|
||||
loop: "{{ query('ansible.builtin.dict', downstream.helm_charts) }}"
|
||||
loop_control:
|
||||
label: "{{ item.key }}"
|
||||
|
@ -0,0 +1,27 @@
|
||||
- block:
|
||||
- name: Install json-server chart
|
||||
kubernetes.core.helm:
|
||||
name: json-server
|
||||
chart_ref: /opt/metacluster/helm-charts/json-server
|
||||
release_namespace: json-server
|
||||
create_namespace: true
|
||||
wait: false
|
||||
kubeconfig: "{{ kubeconfig.path }}"
|
||||
values: "{{ components['json-server'].chart_values }}"
|
||||
|
||||
- name: Ensure json-server API availability
|
||||
ansible.builtin.uri:
|
||||
url: https://version.{{ vapp['metacluster.fqdn'] }}/healthz
|
||||
method: GET
|
||||
register: api_readycheck
|
||||
until:
|
||||
- api_readycheck.json.status is defined
|
||||
- api_readycheck.json.status == 'running'
|
||||
retries: "{{ playbook.retries }}"
|
||||
delay: "{{ (storage_benchmark | int) * (playbook.delay.long | int) }}"
|
||||
|
||||
module_defaults:
|
||||
ansible.builtin.uri:
|
||||
validate_certs: no
|
||||
status_code: [200, 201]
|
||||
body_format: json
|
@ -1,5 +1,6 @@
|
||||
- import_tasks: init.yml
|
||||
- import_tasks: k3s.yml
|
||||
- import_tasks: json-server.yml
|
||||
- import_tasks: assets.yml
|
||||
- import_tasks: kube-vip.yml
|
||||
- import_tasks: storage.yml
|
||||
|
@ -1,7 +1,7 @@
|
||||
platform:
|
||||
|
||||
k3s:
|
||||
version: v1.25.9+k3s1
|
||||
version: v1.27.1+k3s1
|
||||
|
||||
packaged_components:
|
||||
- name: traefik
|
||||
@ -51,6 +51,8 @@ platform:
|
||||
url: https://prometheus-community.github.io/helm-charts
|
||||
- name: smallstep
|
||||
url: https://smallstep.github.io/helm-charts/
|
||||
- name: spamasaurus
|
||||
url: https://code.spamasaurus.com/api/packages/djpbessems/helm
|
||||
|
||||
components:
|
||||
|
||||
@ -115,13 +117,13 @@ components:
|
||||
infrastructure_vsphere: v1.6.0
|
||||
ipam_incluster: v0.1.0-alpha.2
|
||||
# Refer to `https://console.cloud.google.com/gcr/images/cloud-provider-vsphere/GLOBAL/cpi/release/manager` for available tags
|
||||
cpi_vsphere: v1.25.2
|
||||
cpi_vsphere: v1.26.2
|
||||
workload:
|
||||
version:
|
||||
calico: v3.25.0
|
||||
k8s: v1.25.10
|
||||
k8s: v1.27.1
|
||||
node_template:
|
||||
url: https://{{ repo_username }}:{{ repo_password }}@sn.itch.fyi/Repository/rel/ubuntu-2204-kube-v1.25.10.ova
|
||||
url: https://{{ repo_username }}:{{ repo_password }}@sn.itch.fyi/Repository/rel/ubuntu-2204-kube-v1.27.1.ova
|
||||
|
||||
# dex:
|
||||
# helm:
|
||||
@ -225,6 +227,34 @@ components:
|
||||
registry:
|
||||
size: 25Gi
|
||||
|
||||
json-server:
|
||||
helm:
|
||||
version: v0.5.1
|
||||
chart: spamasaurus/json-server
|
||||
parse_logic: helm template . | yq --no-doc eval '.. | .image? | select(.)' | sort -u | awk '!/ /'
|
||||
chart_values: !unsafe |
|
||||
ingress:
|
||||
enabled: true
|
||||
hosts:
|
||||
- host: version.{{ vapp['metacluster.fqdn'] }}
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
seedData:
|
||||
configInline: |
|
||||
{
|
||||
"appliance": { "version": "{{ appliance.version }}" },
|
||||
"components": [
|
||||
{ "app": "argo-cd", "version": "{{ components[argo-cd].helm.version }}" },
|
||||
{ "app": "cert-manager", "version": "{{ components[cert-manager].helm.version }}" },
|
||||
{ "app": "cluster-api",
|
||||
"management": { "foo": "bar" },
|
||||
"workload": { "foo": "bar" }
|
||||
}
|
||||
],
|
||||
"healthz": { "status": "running" }
|
||||
}
|
||||
|
||||
# keycloakx:
|
||||
# helm:
|
||||
# version: 2.1.1 # (= Keycloak 20.0.3)
|
||||
|
@ -28,6 +28,7 @@ build {
|
||||
|
||||
extra_arguments = [
|
||||
"--extra-vars", "appliancetype=${source.name}",
|
||||
"--extra-vars", "applianceversion=${var.appliance_version}",
|
||||
"--extra-vars", "ansible_ssh_pass=${var.ssh_password}",
|
||||
"--extra-vars", "docker_username=${var.docker_username}",
|
||||
"--extra-vars", "docker_password=${var.docker_password}",
|
||||
@ -45,7 +46,7 @@ build {
|
||||
" -ManifestFileName '/scratch/bld_${var.vm_name}_${source.name}.mf'",
|
||||
"ovftool --acceptAllEulas --allowExtraConfig --overwrite \\",
|
||||
" '/scratch/bld_${var.vm_name}_${source.name}.ovf' \\",
|
||||
" /output/airgapped-k8s-${var.k8s_version}.${source.name}.ova"
|
||||
" /output/airgapped-k8s-${var.appliance_version}+${var.k8s_version}-${source.name}.ova"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
@ -34,4 +34,5 @@ variable "docker_password" {
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
variable "appliance_version" {}
|
||||
variable "k8s_version" {}
|
||||
|
Reference in New Issue
Block a user