diff --git a/.github/workflows/integration-on-schedule-upgrade.yml b/.github/workflows/integration-on-schedule-upgrade.yml index 6f7633d0d8..c551255600 100644 --- a/.github/workflows/integration-on-schedule-upgrade.yml +++ b/.github/workflows/integration-on-schedule-upgrade.yml @@ -12,4 +12,4 @@ jobs: with: install_profile: upgrade generate_password: 'yes' - kubernetes_versions: "['1.26']" + kubernetes_versions: "['1.29']" diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 2adf4c63cb..634ef49db8 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -56,12 +56,10 @@ on: description: 'Kubernetes version' type: choice options: - - "['1.24']" - - "['1.25']" - - "['1.26']" - "['1.27']" - "['1.28']" - default: "['1.28']" + - "['1.29']" + default: "['1.29']" install_profile: description: Otomi installation profile default: minimal-with-team diff --git a/Dockerfile b/Dockerfile index ce9d42755d..21f75087d3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM otomi/tools:v2.2.0 as ci +FROM otomi/tools:v2.3.0 as ci ENV APP_HOME=/home/app/stack @@ -27,7 +27,7 @@ FROM ci as clean RUN npm prune --production #----------------------------- -FROM otomi/tools:v2.2.0 as prod +FROM otomi/tools:v2.3.0 as prod ENV APP_HOME=/home/app/stack ENV ENV_DIR=/home/app/stack/env diff --git a/README.md b/README.md index e3ce3aebea..88c240b9bc 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Otomi turns any Kubernetes cluster into an Application Platform to provide paved To install Otomi, make sure to have a K8s cluster running with at least: -- Version `1.25`, `1.26` or `1.27` +- Version `1.27`, `1.28` or `1.29` - A node pool with at least **8 vCPU** and **16GB+ RAM** (more resources might be required based on the activated capabilities) - Calico CNI installed (or any other CNI that supports K8s network policies) - A default storage class configured diff --git a/package.json b/package.json index 6843542071..f1d9d5cedd 100644 --- a/package.json +++ b/package.json @@ -153,7 +153,7 @@ "test:ts": "ENV_DIR=$PWD/tests/fixtures NODE_ENV=test jest", "test:ts-cov": "jest --coverage", "validate-templates": "ENV_DIR=$PWD/tests/fixtures NODE_ENV=test binzx/otomi validate-templates", - "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", + "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", "validate-values": "ENV_DIR=$PWD/tests/fixtures NODE_ENV=test binzx/otomi validate-values", "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", "bootstrap-dev-with-repo": "CI=1 ENV_DIR=/tmp/otomi-bootstrap-dev binzx/otomi bootstrap" diff --git a/schemas/Readme.md b/schemas/Readme.md index d29f4b571e..fb2a8dd16f 100644 --- a/schemas/Readme.md +++ b/schemas/Readme.md @@ -8,7 +8,7 @@ Running k8s cluster (e.g.: minikube) 1. Collect api versions ``` -kubectl api-versions > api-versions/ +kubectl api-versions > schemas/api-versions/ ``` # schemas/v1.XX-standalone.tar.gz diff --git a/schemas/api-versions/1.29.txt b/schemas/api-versions/1.29.txt new file mode 100644 index 0000000000..2fe0f1a464 --- /dev/null +++ b/schemas/api-versions/1.29.txt @@ -0,0 +1,23 @@ +admissionregistration.k8s.io/v1 +apiextensions.k8s.io/v1 +apiregistration.k8s.io/v1 +apps/v1 +authentication.k8s.io/v1 +authorization.k8s.io/v1 +autoscaling/v1 +autoscaling/v2 +batch/v1 +certificates.k8s.io/v1 +coordination.k8s.io/v1 +crd.projectcalico.org/v1 +discovery.k8s.io/v1 +events.k8s.io/v1 +flowcontrol.apiserver.k8s.io/v1 +flowcontrol.apiserver.k8s.io/v1beta3 +networking.k8s.io/v1 +node.k8s.io/v1 +policy/v1 +rbac.authorization.k8s.io/v1 +scheduling.k8s.io/v1 +storage.k8s.io/v1 +v1 diff --git a/schemas/gen-k8s-schemas.sh b/schemas/gen-k8s-schemas.sh index 8ad6e3d949..e604491bba 100755 --- a/schemas/gen-k8s-schemas.sh +++ b/schemas/gen-k8s-schemas.sh @@ -10,6 +10,7 @@ set -ex # X.Y.Z-local - relative references, useful to avoid the network dependency declare -a K8S_VERSIONS=( + v1.29.4 v1.28.3 v1.27.4 v1.26.7 @@ -22,8 +23,8 @@ declare -a K8S_VERSIONS=( pushd schemas -# OPENAPI2JSONSCHEMABIN="docker run -i -v ${PWD}:/out/schemas ghcr.io/yannh/openapi2jsonschema:latest" -OPENAPI2JSONSCHEMABIN="openapi2jsonschema" +OPENAPI2JSONSCHEMABIN="docker run -i -v ${PWD}:/out/schemas ghcr.io/yannh/openapi2jsonschema:latest" +# OPENAPI2JSONSCHEMABIN="openapi2jsonschema" if [ -n "${K8S_VERSION_PREFIX}" ]; then 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 if [ ! -f "${OUT_VERSION}-standalone.tar.gz" ]; then $OPENAPI2JSONSCHEMABIN -o "${OUT_VERSION}-standalone" --expanded --kubernetes --stand-alone "${SCHEMA}" + container_id=$(docker ps -a -l -q) + docker cp $container_id:/out/${OUT_VERSION}-standalone ${PWD}/${OUT_VERSION}-standalone-expanded + $OPENAPI2JSONSCHEMABIN -o "${OUT_VERSION}-standalone" --kubernetes --stand-alone "${SCHEMA}" + container_id=$(docker ps -a -l -q) + docker cp $container_id:/out/${OUT_VERSION}-standalone ${PWD}/${OUT_VERSION}-standalone + + cp -r ${OUT_VERSION}-standalone-expanded/* ${OUT_VERSION}-standalone tar -zcvf "${OUT_VERSION}"-standalone.tar.gz "${OUT_VERSION}"-standalone + rm -rf "${OUT_VERSION}"-standalone-expanded rm -rf "${OUT_VERSION}"-standalone fi diff --git a/schemas/v1.29-standalone.tar.gz b/schemas/v1.29-standalone.tar.gz new file mode 100644 index 0000000000..e8fd9c035e Binary files /dev/null and b/schemas/v1.29-standalone.tar.gz differ diff --git a/src/cmd/validate-templates.ts b/src/cmd/validate-templates.ts index 4fb1e405d9..56e5f8a6cd 100644 --- a/src/cmd/validate-templates.ts +++ b/src/cmd/validate-templates.ts @@ -163,7 +163,7 @@ export const validateTemplates = async (): Promise => { d.info(`K8S Resource Path: ${k8sResourcesPath}`) d.info(`Schema location: file://${schemaOutputPath}`) const kubevalOutput = await nothrow( - $`kubeconform ${verbose} -skip ${skipKinds.join(',')} -ignore-filename-pattern ${skipFilenames.join( + $`kubeconform -skip ${skipKinds.join(',')} -ignore-filename-pattern ${skipFilenames.join( '|', )} -schema-location ${schemaOutputPath}/${vk8sVersion}-standalone/{{.ResourceKind}}{{.KindSuffix}}.json ${k8sResourcesPath}`, ) @@ -200,6 +200,7 @@ export const validateTemplates = async (): Promise => { d.info(`${chalk.redBright('TOTAL ERR')}: %s`, `${errCount} files`) if (kubevalOutput.exitCode !== 0) { + d.info('Kubeval output: %s', kubevalOutput.stdout) throw new Error(`Template validation FAILED: ${kubevalOutput.exitCode}`) } else d.log('Template validation SUCCESS') } diff --git a/src/supportedK8sVersions.json b/src/supportedK8sVersions.json index 7130ea9714..118481eded 100644 --- a/src/supportedK8sVersions.json +++ b/src/supportedK8sVersions.json @@ -1 +1 @@ -{ "supportedK8sVersions": ["1.25", "1.26", "1.27", "1.28"] } +{ "supportedK8sVersions": ["1.27", "1.28", "1.29"] } diff --git a/tools/Dockerfile b/tools/Dockerfile index 789053e204..7116c2c8d6 100644 --- a/tools/Dockerfile +++ b/tools/Dockerfile @@ -4,7 +4,7 @@ FROM ubuntu:20.04 as builder ARG DEBIAN_FRONTEND=noninteractive ARG TARGETARCH # https://github.com/kubernetes/kubernetes/releases -ARG KUBECTL_VERSION=1.28.10 +ARG KUBECTL_VERSION=1.29.5 # https://github.com/helm/helm/tags ARG HELM_VERSION=3.15.1 # https://github.com/databus23/helm-diff/releases