56 Commits

Author SHA1 Message Date
05f085aee7 feat: Preconfigure root profile for cli tools
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-15 19:09:44 +02:00
072fc56050 fix: Refactor to make step-ca initialization idempotent 2023-07-15 19:08:33 +02:00
5363eba1a3 fix: Upgrade version endpoint component
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-14 15:38:49 +02:00
a245cc3d48 feat: Dynamically fill version endpoint database
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-14 13:49:02 +02:00
51c477fb07 feat: Upgrade version endpoint component
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-14 10:48:18 +02:00
1446cba537 fix: Change API call encoding
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-13 12:18:33 +02:00
0501a035f2 fix: Upgrade component version
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-12 11:49:48 +02:00
6e942af974 fix: Revert skopeo transport when storing container images
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-11 14:54:57 +02:00
89874d57ce fix: Explicitly convert child dictionary to json
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-11 11:53:37 +02:00
2b497d4653 fix: Fix playbook tasklist order 2023-07-11 11:42:12 +02:00
cfa4a5379a feat: Switch to OCI-archive for container storage 2023-07-11 11:41:33 +02:00
a2c2766ff7 fix: Remove non-functional variable references
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-08 18:09:48 +02:00
76d3b6c742 build: Include semantic release dry-run logic
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-07 17:31:32 +02:00
a5248bd54c build: Add missing variables
Some checks failed
continuous-integration/drone/push Build is failing
2023-07-07 17:12:20 +02:00
cbedc9679f feat: Add version/metadata API endpoint
Some checks failed
continuous-integration/drone/push Build is failing
2023-07-07 16:48:32 +02:00
740b6b3dc9 build: Disable parallel builds entirely
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-07 14:33:47 +02:00
0ba87988bc fix: Incorrect indentation causing malformed PEM file
Some checks failed
continuous-integration/drone/push Build is failing
2023-07-07 10:30:20 +02:00
aa14a8a3a8 fix: Refactor kustomize templates
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-06 13:01:35 +02:00
1f55ff7cfa build: Revert to semi-working syntax
Some checks failed
continuous-integration/drone/push Build is failing
2023-06-20 16:30:49 +02:00
ba4a0148ff build: Try different syntax (remove quotes)
Some checks failed
continuous-integration/drone/push Build is failing
2023-06-20 15:44:45 +02:00
c177dbd03b build: Test different syntax for character escape
Some checks failed
continuous-integration/drone/push Build is failing
2023-06-20 15:40:39 +02:00
2e8ce6cc00 build: Escape escape sequence characters
Some checks failed
continuous-integration/drone/push Build is failing
2023-06-20 15:37:36 +02:00
7fd1cf73db build: Fix linebreak
Some checks failed
continuous-integration/drone/push Build is failing
2023-06-20 15:35:09 +02:00
cf001cd0ce build:Test explicit tag format
Some checks failed
continuous-integration/drone/push Build is failing
2023-06-20 15:32:53 +02:00
438b944011 build: Add missing variable export
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-22 13:43:53 +02:00
679a9457b5 build:Fix variable name
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-22 12:44:13 +02:00
8b4a1e380c build:Test semantic-release + build flow
Some checks failed
continuous-integration/drone/push Build is failing
2023-05-22 12:19:10 +02:00
0468cd6269 build:Debug echo to file
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-22 12:11:14 +02:00
b808397d47 build:Fix var substitution
Some checks failed
continuous-integration/drone/push Build is failing
2023-05-22 12:08:01 +02:00
8fd0136bb7 build:debug brace mismatch #2
Some checks failed
continuous-integration/drone/push Build is failing
2023-05-22 12:06:14 +02:00
479d896599 build:Debug brace mismatch
Some checks reported errors
continuous-integration/drone/push Build encountered an error
2023-05-22 12:05:32 +02:00
263f156eb1 build:Try different syntax
Some checks reported errors
continuous-integration/drone/push Build encountered an error
2023-05-22 11:55:28 +02:00
f1dfc83d7c build:Revert back to cli arguments while specifying custom command
Some checks reported errors
continuous-integration/drone/push Build encountered an error
2023-05-22 09:23:44 +02:00
5b950a3834 build:Test with configuration in .releaserc.json
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-22 09:09:50 +02:00
978f39d45b build: Test different semantic-release plugins
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-21 18:27:34 +02:00
9b9ab6b784 build:Skip build on tag
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-21 18:09:22 +02:00
24dca2755a fix: Run semantic-release with different drone variable as input
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-21 18:02:00 +02:00
0d1db2f29f feat: Test semantic-release dry-run #2
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-21 17:51:04 +02:00
cce39a5bb7 fix:Test semantic release dry-run
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is failing
2023-05-20 15:18:23 +02:00
823cc467fa Explicitly install semantic-release plugins #2
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-20 14:32:47 +02:00
9cb89bf055 Try different syntax
Some checks failed
continuous-integration/drone/push Build is failing
2023-05-20 14:30:38 +02:00
358cbe39ea Fix quote
Some checks failed
continuous-integration/drone/push Build is failing
2023-05-20 14:28:31 +02:00
0fee2df2a6 Explicitly install semantic-release plugins
Some checks reported errors
continuous-integration/drone/push Build encountered an error
2023-05-20 13:44:54 +02:00
e4e58e4789 Disable npm plugin
Some checks failed
continuous-integration/drone/push Build is failing
2023-05-20 13:31:48 +02:00
75158a8a5b Fix variable substitution
Some checks failed
continuous-integration/drone/push Build is failing
2023-05-20 13:26:49 +02:00
c83d541a0d Remove redundant parameter
Some checks failed
continuous-integration/drone/push Build is failing
2023-05-20 13:24:20 +02:00
a46610f828 Add git credentials
Some checks failed
continuous-integration/drone/push Build is failing
2023-05-20 13:22:20 +02:00
fe5147bd2e Override branch during semantic-release dry-run
Some checks failed
continuous-integration/drone/push Build is failing
2023-05-20 12:58:44 +02:00
6d168f0517 Add semantic-release prerequisites
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-20 12:48:40 +02:00
68445ee13f Testing semantic-release
Some checks failed
continuous-integration/drone/push Build is failing
2023-05-20 12:44:32 +02:00
48c14afd0f New major version branch
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-19 13:43:23 +02:00
31b21c9b7a Upgrade node template OS version
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-19 12:19:42 +02:00
e03cd20d65 Replay upstream changes;Upgrade to latest minor K8s version
Some checks failed
continuous-integration/drone/push Build is failing
2023-05-19 11:38:53 +02:00
1c19708855 Increase default retries;Add healthcheck
All checks were successful
continuous-integration/drone/push Build is passing
2023-03-23 16:51:17 +01:00
942c13dde7 Improve console healthchecks
All checks were successful
continuous-integration/drone/push Build is passing
2023-03-23 11:42:34 +01:00
439223c56e Build n-1 version
All checks were successful
continuous-integration/drone/push Build is passing
2023-03-22 08:54:45 +01:00
14 changed files with 331 additions and 315 deletions

View File

@ -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:
- |

View File

@ -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 }}"

View File

@ -1,14 +0,0 @@
import netaddr
def netaddr_iter_iprange(ip_start, ip_end):
return [str(ip) for ip in netaddr.iter_iprange(ip_start, ip_end)]
class FilterModule(object):
''' Ansible filter. Interface to netaddr methods.
https://pypi.org/project/netaddr/
'''
def filters(self):
return {
'netaddr_iter_iprange': netaddr_iter_iprange
}

View File

@ -1,14 +1,9 @@
- block:
- name: Initialize tempfile
ansible.builtin.tempfile:
state: file
register: values_file
- name: Write chart values w/ password to tempfile
- name: Inject password into values file
ansible.builtin.copy:
dest: "{{ values_file.path }}"
content: "{{ stepca_values.stdout | regex_replace('(ca_password|provisioner_password): ', '\\1: ' ~ (vapp['metacluster.password'] | b64encode)) }}"
dest: "{{ stepconfig.path }}"
content: "{{ lookup('ansible.builtin.file', stepconfig.path) | regex_replace('(ca_password|provisioner_password): ', '\\1: ' ~ (vapp['metacluster.password'] | b64encode)) }}"
no_log: true
- name: Install step-ca chart
@ -21,13 +16,7 @@
wait: true
kubeconfig: "{{ kubeconfig.path }}"
values_files:
- "{{ values_file.path }}"
- name: Cleanup tempfile
ansible.builtin.file:
path: "{{ values_file.path }}"
state: absent
when: values_file.path is defined
- "{{ stepconfig.path }}"
- name: Retrieve configmap w/ root certificate
kubernetes.core.k8s_info:

View File

@ -12,6 +12,15 @@
- registry
- storage
- name: Create step-ca config dictionary
ansible.builtin.set_fact:
stepconfig: "{{ { 'path': ansible_env.HOME ~ '/.step/config/values.yaml' } }}"
- name: Create step-ca target folder
ansible.builtin.file:
path: "{{ stepconfig.path | dirname }}"
state: directory
- name: Initialize tempfile
ansible.builtin.tempfile:
state: file
@ -36,8 +45,8 @@
--address=:9000 \
--provisioner=admin \
--acme \
--password-file={{ stepca_password.path }}
register: stepca_values
--password-file={{ stepca_password.path }} | tee {{ stepconfig.path }}
creates: "{{ stepconfig.path }}"
- name: Cleanup tempfile
ansible.builtin.file:
@ -48,7 +57,7 @@
- name: Store root CA certificate
ansible.builtin.copy:
dest: /usr/local/share/ca-certificates/root_ca.crt
content: "{{ (stepca_values.stdout | from_yaml).inject.certificates.root_ca }}"
content: "{{ (lookup('ansible.builtin.file', stepconfig.path) | from_yaml).inject.certificates.root_ca }}"
- name: Update certificate truststore
ansible.builtin.command:

View File

@ -0,0 +1,38 @@
- 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 |
combine( {
'jsonServer': {
'seedData': {
'configInline': ( components['json-server'].chart_values.jsonServer.seedData.configInline | to_json )
}
}
} )
}}
- name: Ensure json-server API availability
ansible.builtin.uri:
url: https://version.{{ vapp['metacluster.fqdn'] }}/healthz
method: GET
# This mock REST API -ironically- does not support json encoded body argument
body_format: raw
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]

View File

@ -42,19 +42,30 @@
retries: "{{ playbook.retries }}"
delay: "{{ (storage_benchmark | int) * (playbook.delay.medium | int) }}"
- name: Install kubectl tab-completion
- name: Install tab-completion
ansible.builtin.shell:
cmd: kubectl completion bash | tee /etc/bash_completion.d/kubectl
cmd: |-
{{ item }} completion bash > /etc/bash_completion.d/{{ item }}
creates: /etc/bash_completion.d/{{ item }}
loop:
- kubectl
- helm
- step
- name: Initialize tempfile
ansible.builtin.tempfile:
state: file
register: kubeconfig
- name: Create kubeconfig dictionary
ansible.builtin.set_fact:
kubeconfig: "{{ { 'path': ansible_env.HOME ~ '/.kube/config' } }}"
- name: Create kubeconfig target folder
ansible.builtin.file:
path: "{{ kubeconfig.path | dirname }}"
state: directory
- name: Retrieve kubeconfig
ansible.builtin.command:
cmd: kubectl config view --raw
register: kubectl_config
no_log: true
- name: Store kubeconfig in tempfile
ansible.builtin.copy:

View File

@ -2,6 +2,7 @@
- import_tasks: k3s.yml
- import_tasks: assets.yml
- import_tasks: kube-vip.yml
- import_tasks: json-server.yml
- import_tasks: storage.yml
- import_tasks: ingress.yml
- import_tasks: certauthority.yml

View File

@ -3,8 +3,8 @@ kind: Kustomization
resources:
- cluster-template.yaml
patchesStrategicMerge:
- |-
patches:
- patch: |-
apiVersion: v1
kind: Secret
metadata:
@ -32,7 +32,7 @@ patchesStrategicMerge:
[Network]
public-network = "${VSPHERE_NETWORK}"
type: Opaque
- |-
- patch: |-
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
kind: KubeadmControlPlane
metadata:
@ -42,7 +42,7 @@ patchesStrategicMerge:
kubeadmConfigSpec:
clusterConfiguration:
imageRepository: registry.{{ _template.network.fqdn }}/kubeadm
- |-
- patch: |-
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: KubeadmConfigTemplate
metadata:
@ -53,7 +53,7 @@ patchesStrategicMerge:
spec:
clusterConfiguration:
imageRepository: registry.{{ _template.network.fqdn }}/kubeadm
- |-
- patch: |-
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: KubeadmConfigTemplate
metadata:
@ -86,7 +86,7 @@ patchesStrategicMerge:
{{ _template.rootca | indent(width=14, first=False) | trim }}
owner: root:root
path: /usr/local/share/ca-certificates/root_ca.crt
- |-
- patch: |-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: VSphereMachineTemplate
metadata:
@ -105,7 +105,7 @@ patchesStrategicMerge:
nameservers:
- {{ _template.network.dnsserver }}
networkName: '${VSPHERE_NETWORK}'
- |-
- patch: |-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: VSphereMachineTemplate
metadata:
@ -125,132 +125,131 @@ patchesStrategicMerge:
- {{ _template.network.dnsserver }}
networkName: '${VSPHERE_NETWORK}'
patchesJson6902:
- target:
group: controlplane.cluster.x-k8s.io
version: v1beta1
kind: KubeadmControlPlane
name: .*
patch: |-
- op: add
path: /spec/kubeadmConfigSpec/files/-
value:
content: |
[plugins."io.containerd.grpc.v1.cri".registry]
config_path = "/etc/containerd/certs.d"
append: true
path: /etc/containerd/config.toml
- target:
group: controlplane.cluster.x-k8s.io
version: v1beta1
kind: KubeadmControlPlane
name: .*
patch: |-
- op: add
path: /spec/kubeadmConfigSpec/files/-
value:
content: |
[plugins."io.containerd.grpc.v1.cri".registry]
config_path = "/etc/containerd/certs.d"
append: true
path: /etc/containerd/config.toml
{% for registry in _template.registries %}
- op: add
path: /spec/kubeadmConfigSpec/files/-
value:
content: |
server = "https://{{ registry }}"
- op: add
path: /spec/kubeadmConfigSpec/files/-
value:
content: |
server = "https://{{ registry }}"
[host."https://registry.{{ _template.network.fqdn }}/v2/library/{{ registry }}"]
capabilities = ["pull", "resolve"]
override_path = true
owner: root:root
path: /etc/containerd/certs.d/{{ registry }}/hosts.toml
[host."https://registry.{{ _template.network.fqdn }}/v2/library/{{ registry }}"]
capabilities = ["pull", "resolve"]
override_path = true
owner: root:root
path: /etc/containerd/certs.d/{{ registry }}/hosts.toml
{% endfor %}
- op: add
path: /spec/kubeadmConfigSpec/files/-
value:
content: |
network: {config: disabled}
owner: root:root
path: /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
- op: add
path: /spec/kubeadmConfigSpec/files/-
value:
content: |
{{ _template.rootca | indent(width=12, first=False) | trim }}
owner: root:root
path: /usr/local/share/ca-certificates/root_ca.crt
- target:
group: bootstrap.cluster.x-k8s.io
version: v1beta1
kind: KubeadmConfigTemplate
name: .*
patch: |-
- op: add
path: /spec/kubeadmConfigSpec/files/-
value:
content: |
network: {config: disabled}
owner: root:root
path: /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
- op: add
path: /spec/kubeadmConfigSpec/files/-
value:
content: |
{{ _template.rootca | indent(width=10, first=False) | trim }}
owner: root:root
path: /usr/local/share/ca-certificates/root_ca.crt
- target:
group: bootstrap.cluster.x-k8s.io
version: v1beta1
kind: KubeadmConfigTemplate
name: .*
patch: |-
{% for cmd in _template.runcmds %}
- op: add
path: /spec/template/spec/preKubeadmCommands/-
value: {{ cmd }}
- op: add
path: /spec/template/spec/preKubeadmCommands/-
value: {{ cmd }}
{% endfor %}
- target:
group: controlplane.cluster.x-k8s.io
version: v1beta1
kind: KubeadmControlPlane
name: .*
patch: |-
- target:
group: controlplane.cluster.x-k8s.io
version: v1beta1
kind: KubeadmControlPlane
name: .*
patch: |-
{% for cmd in _template.runcmds %}
- op: add
path: /spec/kubeadmConfigSpec/preKubeadmCommands/-
value: {{ cmd }}
- op: add
path: /spec/kubeadmConfigSpec/preKubeadmCommands/-
value: {{ cmd }}
{% endfor %}
- target:
group: infrastructure.cluster.x-k8s.io
version: v1beta1
kind: VSphereMachineTemplate
name: \${CLUSTER_NAME}
patch: |-
- op: replace
path: /metadata/name
value: ${CLUSTER_NAME}-master
- target:
group: controlplane.cluster.x-k8s.io
version: v1beta1
kind: KubeadmControlPlane
name: \${CLUSTER_NAME}
patch: |-
- op: replace
path: /metadata/name
value: ${CLUSTER_NAME}-master
- op: replace
path: /spec/machineTemplate/infrastructureRef/name
value: ${CLUSTER_NAME}-master
- target:
group: cluster.x-k8s.io
version: v1beta1
kind: Cluster
name: \${CLUSTER_NAME}
patch: |-
- op: replace
path: /spec/controlPlaneRef/name
value: ${CLUSTER_NAME}-master
- target:
group: infrastructure.cluster.x-k8s.io
version: v1beta1
kind: VSphereMachineTemplate
name: \${CLUSTER_NAME}
patch: |-
- op: replace
path: /metadata/name
value: ${CLUSTER_NAME}-master
- target:
group: controlplane.cluster.x-k8s.io
version: v1beta1
kind: KubeadmControlPlane
name: \${CLUSTER_NAME}
patch: |-
- op: replace
path: /metadata/name
value: ${CLUSTER_NAME}-master
- op: replace
path: /spec/machineTemplate/infrastructureRef/name
value: ${CLUSTER_NAME}-master
- target:
group: cluster.x-k8s.io
version: v1beta1
kind: Cluster
name: \${CLUSTER_NAME}
patch: |-
- op: replace
path: /spec/controlPlaneRef/name
value: ${CLUSTER_NAME}-master
- target:
group: infrastructure.cluster.x-k8s.io
version: v1beta1
kind: VSphereMachineTemplate
name: \${CLUSTER_NAME}-worker
patch: |-
- op: replace
path: /spec/template/spec/numCPUs
value: {{ _template.nodesize.cpu }}
- op: replace
path: /spec/template/spec/memoryMiB
value: {{ _template.nodesize.memory }}
- target:
group: cluster.x-k8s.io
version: v1beta1
kind: MachineDeployment
name: \${CLUSTER_NAME}-md-0
patch: |-
- op: replace
path: /metadata/name
value: ${CLUSTER_NAME}-worker
- op: replace
path: /spec/template/spec/bootstrap/configRef/name
value: ${CLUSTER_NAME}-worker
- target:
group: bootstrap.cluster.x-k8s.io
version: v1beta1
kind: KubeadmConfigTemplate
name: \${CLUSTER_NAME}-md-0
patch: |-
- op: replace
path: /metadata/name
value: ${CLUSTER_NAME}-worker
- target:
group: infrastructure.cluster.x-k8s.io
version: v1beta1
kind: VSphereMachineTemplate
name: \${CLUSTER_NAME}-worker
patch: |-
- op: replace
path: /spec/template/spec/numCPUs
value: {{ _template.nodesize.cpu }}
- op: replace
path: /spec/template/spec/memoryMiB
value: {{ _template.nodesize.memory }}
- target:
group: cluster.x-k8s.io
version: v1beta1
kind: MachineDeployment
name: \${CLUSTER_NAME}-md-0
patch: |-
- op: replace
path: /metadata/name
value: ${CLUSTER_NAME}-worker
- op: replace
path: /spec/template/spec/bootstrap/configRef/name
value: ${CLUSTER_NAME}-worker
- target:
group: bootstrap.cluster.x-k8s.io
version: v1beta1
kind: KubeadmConfigTemplate
name: \${CLUSTER_NAME}-md-0
patch: |-
- op: replace
path: /metadata/name
value: ${CLUSTER_NAME}-worker

View File

@ -5,8 +5,8 @@ resources:
- manifests/machinedeployment-{{ _template.cluster.name }}-worker.yaml
- manifests/vspheremachinetemplate-{{ _template.cluster.name }}-worker.yaml
patchesStrategicMerge:
- |-
patches:
- patch: |-
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: KubeadmConfigTemplate
metadata:
@ -31,7 +31,7 @@ patchesStrategicMerge:
mounts:
- - LABEL=blockstorage
- /mnt/blockstorage
- |-
- patch: |-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: VSphereMachineTemplate
metadata:
@ -43,42 +43,41 @@ patchesStrategicMerge:
additionalDisksGiB:
- {{ _template.nodepool.additionaldisk }}
patchesJson6902:
- target:
group: bootstrap.cluster.x-k8s.io
version: v1beta1
kind: KubeadmConfigTemplate
name: {{ _template.cluster.name }}-worker
patch: |-
- op: replace
path: /metadata/name
value: {{ _template.cluster.name }}-worker-storage
- target:
group: bootstrap.cluster.x-k8s.io
version: v1beta1
kind: KubeadmConfigTemplate
name: {{ _template.cluster.name }}-worker
patch: |-
- op: replace
path: /metadata/name
value: {{ _template.cluster.name }}-worker-storage
- target:
group: cluster.x-k8s.io
version: v1beta1
kind: MachineDeployment
name: {{ _template.cluster.name }}-worker
patch: |-
- op: replace
path: /metadata/name
value: {{ _template.cluster.name }}-worker-storage
- op: replace
path: /spec/template/spec/bootstrap/configRef/name
value: {{ _template.cluster.name }}-worker-storage
- op: replace
path: /spec/template/spec/infrastructureRef/name
value: {{ _template.cluster.name }}-worker-storage
- op: replace
path: /spec/replicas
value: {{ _template.nodepool.size }}
- target:
group: cluster.x-k8s.io
version: v1beta1
kind: MachineDeployment
name: {{ _template.cluster.name }}-worker
patch: |-
- op: replace
path: /metadata/name
value: {{ _template.cluster.name }}-worker-storage
- op: replace
path: /spec/template/spec/bootstrap/configRef/name
value: {{ _template.cluster.name }}-worker-storage
- op: replace
path: /spec/template/spec/infrastructureRef/name
value: {{ _template.cluster.name }}-worker-storage
- op: replace
path: /spec/replicas
value: {{ _template.nodepool.size }}
- target:
group: infrastructure.cluster.x-k8s.io
version: v1beta1
kind: VSphereMachineTemplate
name: {{ _template.cluster.name }}-worker
patch: |-
- op: replace
path: /metadata/name
value: {{ _template.cluster.name }}-worker-storage
- target:
group: infrastructure.cluster.x-k8s.io
version: v1beta1
kind: VSphereMachineTemplate
name: {{ _template.cluster.name }}-worker
patch: |-
- op: replace
path: /metadata/name
value: {{ _template.cluster.name }}-worker-storage

View File

@ -1,12 +1,6 @@
- import_tasks: service.yml
- import_tasks: cron.yml
- name: Cleanup tempfile
ansible.builtin.file:
path: "{{ kubeconfig.path }}"
state: absent
when: kubeconfig.path is defined
# - name: Reboot host
# ansible.builtin.shell:
# cmd: systemctl reboot

View File

@ -1,7 +1,7 @@
platform:
k3s:
version: v1.26.4+k3s1
version: v1.27.1+k3s1
packaged_components:
- name: traefik
@ -35,10 +35,6 @@ platform:
url: https://argoproj.github.io/argo-helm
- name: authentik
url: https://charts.goauthentik.io
# - name: codecentric
# url: https://codecentric.github.io/helm-charts
# - name: dex
# url: https://charts.dexidp.io
- name: gitea-charts
url: https://dl.gitea.io/charts/
- name: harbor
@ -51,6 +47,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,61 +113,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.26.0
cpi_vsphere: v1.26.2
workload:
version:
calico: v3.25.0
k8s: v1.26.4
k8s: v1.27.1
node_template:
url: https://{{ repo_username }}:{{ repo_password }}@sn.itch.fyi/Repository/rel/ubuntu-2204-kube-v1.26.4.ova
# dex:
# helm:
# version: 0.13.0 # (= Dex 2.35.3)
# chart: dex/dex
# parse_logic: helm template . | yq --no-doc eval '.. | .image? | select(.)' | sort -u | awk '!/ /'
# chart_values: !unsafe |
# config:
# connectors:
# - type: ldap
# id: ldap
# name: "LDAP"
# config:
# host: "{{ vapp['ldap.fqdn'] }}:636"
# insecureNoSSL: false
# insecureSkipVerify: true
# bindDN: "{{ vapp['ldap.dn'] }}"
# bindPW: "{{ vapp['ldap.password'] }}"
# usernamePrompt: "Username"
# userSearch:
# baseDN: OU=Administrators,OU=Useraccounts,DC=bessems,DC=eu
# filter: "(objectClass=person)"
# username: userPrincipalName
# idAttr: DN
# emailAttr: userPrincipalName
# nameAttr: cn
# groupSearch:
# baseDN: OU=Roles,OU=Groups,DC=bessems,DC=eu
# filter: "(objectClass=group)"
# userMatchers:
# - userAttr: DN
# groupAttr: member
# nameAttr: cn
# enablePasswordDB: true
# issuer: https://oidc.{{ vapp['metacluster.fqdn'] }}
# storage:
# type: kubernetes
# config:
# inCluster: true
# ingress:
# enabled: true
# hosts:
# - host: oidc.{{ vapp['metacluster.fqdn'] }}
# paths:
# - path: /
# pathType: Prefix
url: https://{{ repo_username }}:{{ repo_password }}@sn.itch.fyi/Repository/rel/ubuntu-2204-kube-v1.27.1.ova
gitea:
helm:
@ -225,37 +175,35 @@ components:
registry:
size: 25Gi
# keycloakx:
# helm:
# version: 2.1.1 # (= Keycloak 20.0.3)
# chart: codecentric/keycloakx
# parse_logic: helm template . | yq --no-doc eval '.. | .image? | select(.)' | sort -u | awk '!/ /'
# chart_values: !unsafe |
# command:
# - "/opt/keycloak/bin/kc.sh"
# - "start"
# - "--http-enabled=true"
# - "--http-port=8080"
# - "--hostname-strict=false"
# - "--hostname-strict-https=false"
# extraEnv: |
# - name: KEYCLOAK_ADMIN
# value: admin
# - name: KEYCLOAK_ADMIN_PASSWORD
# value: {{ vapp['metacluster.password'] }}
# - name: KC_PROXY
# value: "passthrough"
# - name: JAVA_OPTS_APPEND
# value: >-
# -Djgroups.dns.query={% raw %}{{ include "keycloak.fullname" . }}{% endraw %}-headless
# ingress:
# enabled: true
# rules:
# - host: keycloak.{{ vapp['metacluster.fqdn'] }}
# paths:
# - path: /
# pathType: Prefix
# tls: []
json-server:
helm:
version: v0.8.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
jsonServer:
seedData:
configInline: |
{
"appliance": { "version": "{{ appliance.version }}" },
"components": [
{ "id": 0,
"name": "cluster-api",
"management": { "foo": "bar" },
"workload": { "foo": "bar" }
}
],
"healthz": { "status": "running" }
}
sidecar:
targetUrl: version.{{ vapp['metacluster.fqdn'] }}
kube-prometheus-stack:
helm:

View File

@ -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"
]
}
}

View File

@ -34,4 +34,5 @@ variable "docker_password" {
sensitive = true
}
variable "appliance_version" {}
variable "k8s_version" {}