Skip to content

Commit 8f911d6

Browse files
author
CasLubbers
authored
feat: make compatible with k8s 1.29 (#1619)
1 parent dbca465 commit 8f911d6

12 files changed

+46
-15
lines changed

.github/workflows/integration-on-schedule-upgrade.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ jobs:
1212
with:
1313
install_profile: upgrade
1414
generate_password: 'yes'
15-
kubernetes_versions: "['1.26']"
15+
kubernetes_versions: "['1.29']"

.github/workflows/integration.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,10 @@ on:
5656
description: 'Kubernetes version'
5757
type: choice
5858
options:
59-
- "['1.24']"
60-
- "['1.25']"
61-
- "['1.26']"
6259
- "['1.27']"
6360
- "['1.28']"
64-
default: "['1.28']"
61+
- "['1.29']"
62+
default: "['1.29']"
6563
install_profile:
6664
description: Otomi installation profile
6765
default: minimal-with-team

Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM otomi/tools:v2.2.0 as ci
1+
FROM otomi/tools:v2.3.0 as ci
22

33
ENV APP_HOME=/home/app/stack
44

@@ -27,7 +27,7 @@ FROM ci as clean
2727
RUN npm prune --production
2828

2929
#-----------------------------
30-
FROM otomi/tools:v2.2.0 as prod
30+
FROM otomi/tools:v2.3.0 as prod
3131

3232
ENV APP_HOME=/home/app/stack
3333
ENV ENV_DIR=/home/app/stack/env

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Otomi turns any Kubernetes cluster into an Application Platform to provide paved
3131

3232
To install Otomi, make sure to have a K8s cluster running with at least:
3333

34-
- Version `1.25`, `1.26` or `1.27`
34+
- Version `1.27`, `1.28` or `1.29`
3535
- A node pool with at least **8 vCPU** and **16GB+ RAM** (more resources might be required based on the activated capabilities)
3636
- Calico CNI installed (or any other CNI that supports K8s network policies)
3737
- A default storage class configured

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@
153153
"test:ts": "ENV_DIR=$PWD/tests/fixtures NODE_ENV=test jest",
154154
"test:ts-cov": "jest --coverage",
155155
"validate-templates": "ENV_DIR=$PWD/tests/fixtures NODE_ENV=test binzx/otomi validate-templates",
156-
"validate-templates:all": "set -e; i=25; while [ $i -le 28 ]; do NODE_ENV=test binzx/otomi validate-templates -k 1.$i; i=$(($i+1)); done",
156+
"validate-templates:all": "set -e; i=25; while [ $i -le 29 ]; do NODE_ENV=test binzx/otomi validate-templates -k 1.$i; i=$(($i+1)); done",
157157
"validate-values": "ENV_DIR=$PWD/tests/fixtures NODE_ENV=test binzx/otomi validate-values",
158158
"bootstrap-dev": "rm -rf /tmp/otomi-bootstrap-dev; CI=1 VALUES_INPUT=$PWD/tests/bootstrap/input.yaml ENV_DIR=/tmp/otomi-bootstrap-dev binzx/otomi bootstrap",
159159
"bootstrap-dev-with-repo": "CI=1 ENV_DIR=/tmp/otomi-bootstrap-dev binzx/otomi bootstrap"

schemas/Readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Running k8s cluster (e.g.: minikube)
88
1. Collect api versions
99

1010
```
11-
kubectl api-versions > api-versions/<my-version>
11+
kubectl api-versions > schemas/api-versions/<my-version>
1212
```
1313

1414
# schemas/v1.XX-standalone.tar.gz

schemas/api-versions/1.29.txt

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
admissionregistration.k8s.io/v1
2+
apiextensions.k8s.io/v1
3+
apiregistration.k8s.io/v1
4+
apps/v1
5+
authentication.k8s.io/v1
6+
authorization.k8s.io/v1
7+
autoscaling/v1
8+
autoscaling/v2
9+
batch/v1
10+
certificates.k8s.io/v1
11+
coordination.k8s.io/v1
12+
crd.projectcalico.org/v1
13+
discovery.k8s.io/v1
14+
events.k8s.io/v1
15+
flowcontrol.apiserver.k8s.io/v1
16+
flowcontrol.apiserver.k8s.io/v1beta3
17+
networking.k8s.io/v1
18+
node.k8s.io/v1
19+
policy/v1
20+
rbac.authorization.k8s.io/v1
21+
scheduling.k8s.io/v1
22+
storage.k8s.io/v1
23+
v1

schemas/gen-k8s-schemas.sh

+11-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ set -ex
1010
# X.Y.Z-local - relative references, useful to avoid the network dependency
1111

1212
declare -a K8S_VERSIONS=(
13+
v1.29.4
1314
v1.28.3
1415
v1.27.4
1516
v1.26.7
@@ -22,8 +23,8 @@ declare -a K8S_VERSIONS=(
2223

2324
pushd schemas
2425

25-
# OPENAPI2JSONSCHEMABIN="docker run -i -v ${PWD}:/out/schemas ghcr.io/yannh/openapi2jsonschema:latest"
26-
OPENAPI2JSONSCHEMABIN="openapi2jsonschema"
26+
OPENAPI2JSONSCHEMABIN="docker run -i -v ${PWD}:/out/schemas ghcr.io/yannh/openapi2jsonschema:latest"
27+
# OPENAPI2JSONSCHEMABIN="openapi2jsonschema"
2728

2829
if [ -n "${K8S_VERSION_PREFIX}" ]; then
2930
export K8S_VERSIONS=$(git ls-remote --refs --tags https://github.com/kubernetes/kubernetes.git | cut -d/ -f3 | grep -e '^'"${K8S_VERSION_PREFIX}" | grep -e '^v1\.[0-9]\{2\}\.[0-9]\{1,2\}$')
@@ -43,8 +44,16 @@ for K8S_VERSION in "${K8S_VERSIONS[@]}"; do
4344

4445
if [ ! -f "${OUT_VERSION}-standalone.tar.gz" ]; then
4546
$OPENAPI2JSONSCHEMABIN -o "${OUT_VERSION}-standalone" --expanded --kubernetes --stand-alone "${SCHEMA}"
47+
container_id=$(docker ps -a -l -q)
48+
docker cp $container_id:/out/${OUT_VERSION}-standalone ${PWD}/${OUT_VERSION}-standalone-expanded
49+
4650
$OPENAPI2JSONSCHEMABIN -o "${OUT_VERSION}-standalone" --kubernetes --stand-alone "${SCHEMA}"
51+
container_id=$(docker ps -a -l -q)
52+
docker cp $container_id:/out/${OUT_VERSION}-standalone ${PWD}/${OUT_VERSION}-standalone
53+
54+
cp -r ${OUT_VERSION}-standalone-expanded/* ${OUT_VERSION}-standalone
4755
tar -zcvf "${OUT_VERSION}"-standalone.tar.gz "${OUT_VERSION}"-standalone
56+
rm -rf "${OUT_VERSION}"-standalone-expanded
4857
rm -rf "${OUT_VERSION}"-standalone
4958
fi
5059

schemas/v1.29-standalone.tar.gz

5.11 MB
Binary file not shown.

src/cmd/validate-templates.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export const validateTemplates = async (): Promise<void> => {
163163
d.info(`K8S Resource Path: ${k8sResourcesPath}`)
164164
d.info(`Schema location: file://${schemaOutputPath}`)
165165
const kubevalOutput = await nothrow(
166-
$`kubeconform ${verbose} -skip ${skipKinds.join(',')} -ignore-filename-pattern ${skipFilenames.join(
166+
$`kubeconform -skip ${skipKinds.join(',')} -ignore-filename-pattern ${skipFilenames.join(
167167
'|',
168168
)} -schema-location ${schemaOutputPath}/${vk8sVersion}-standalone/{{.ResourceKind}}{{.KindSuffix}}.json ${k8sResourcesPath}`,
169169
)
@@ -200,6 +200,7 @@ export const validateTemplates = async (): Promise<void> => {
200200
d.info(`${chalk.redBright('TOTAL ERR')}: %s`, `${errCount} files`)
201201

202202
if (kubevalOutput.exitCode !== 0) {
203+
d.info('Kubeval output: %s', kubevalOutput.stdout)
203204
throw new Error(`Template validation FAILED: ${kubevalOutput.exitCode}`)
204205
} else d.log('Template validation SUCCESS')
205206
}

src/supportedK8sVersions.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "supportedK8sVersions": ["1.25", "1.26", "1.27", "1.28"] }
1+
{ "supportedK8sVersions": ["1.27", "1.28", "1.29"] }

tools/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ FROM ubuntu:20.04 as builder
44
ARG DEBIAN_FRONTEND=noninteractive
55
ARG TARGETARCH
66
# https://github.com/kubernetes/kubernetes/releases
7-
ARG KUBECTL_VERSION=1.28.10
7+
ARG KUBECTL_VERSION=1.29.5
88
# https://github.com/helm/helm/tags
99
ARG HELM_VERSION=3.15.1
1010
# https://github.com/databus23/helm-diff/releases

0 commit comments

Comments
 (0)