Skip to content

Commit

Permalink
Merge branch 'master' into feat/pg-add-pg-stats-statements
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Bouquillon authored Oct 6, 2023
2 parents 8a70eaf + 23a0468 commit dc702b3
Show file tree
Hide file tree
Showing 84 changed files with 360 additions and 288 deletions.
2 changes: 1 addition & 1 deletion .github/actions/deploy-via-github/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/socialgouv/kontinuous:v1.165.3
FROM ghcr.io/socialgouv/kontinuous:v1.166.0

COPY entrypoint.sh /entrypoint.sh

Expand Down
2 changes: 1 addition & 1 deletion .github/actions/deploy-via-github/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ inputs:
runs:
using: docker
# image: Dockerfile
image: docker://ghcr.io/socialgouv/kontinuous/deploy-via-github:v1.165.3
image: docker://ghcr.io/socialgouv/kontinuous/deploy-via-github:v1.166.0
env:
KS_ENVIRONMENT: ${{ inputs.environment }}
KS_CHART: ${{ inputs.chart }}
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/deploy-via-webhook/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/socialgouv/kontinuous:v1.165.3 as base
FROM ghcr.io/socialgouv/kontinuous:v1.166.0 as base

USER 0

Expand Down
2 changes: 1 addition & 1 deletion .github/actions/deploy-via-webhook/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ inputs:
runs:
using: docker
# image: Dockerfile
image: docker://ghcr.io/socialgouv/kontinuous/deploy-via-webhook:v1.165.3
image: docker://ghcr.io/socialgouv/kontinuous/deploy-via-webhook:v1.166.0
env:
KS_WEBHOOK_TOKEN: ${{ inputs.webhookToken }}
KS_WEBHOOK_URI: ${{ inputs.webhookUri }}
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/deploy-via-webhook/kontinuousVersion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ghcr.io/socialgouv/kontinuous:v1.165.3
ghcr.io/socialgouv/kontinuous:v1.166.0
2 changes: 1 addition & 1 deletion .github/actions/env/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/socialgouv/kontinuous:v1.165.3
FROM ghcr.io/socialgouv/kontinuous:v1.166.0

COPY entrypoint.sh /entrypoint.sh

Expand Down
2 changes: 1 addition & 1 deletion .github/actions/env/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ inputs:
runs:
using: docker
# image: Dockerfile
image: docker://ghcr.io/socialgouv/kontinuous/env:v1.165.3
image: docker://ghcr.io/socialgouv/kontinuous/env:v1.166.0
env:
KS_GIT_BRANCH: ${{ inputs.branch }}
KSENV_REPOSITORY_NAME: ${{ inputs.repositoryName }}
Expand Down
2 changes: 1 addition & 1 deletion .github/kontinuousVersion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ghcr.io/socialgouv/kontinuous:v1.165.3
ghcr.io/socialgouv/kontinuous:v1.166.0
20 changes: 17 additions & 3 deletions .github/workflows/tests-jsonschema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
- "**"
paths:
- "**/values.schema.json"
- "**/config.schema.json"
- "**/kontinuous.schema.json"
- "**/*.values.schema.json"
- ".github/jsonschema/**"
- ".github/workflows/tests-jsonschema.yml"
Expand All @@ -30,11 +32,23 @@ jobs:
- name: install
run: |
# fetch kube json-schema locally and add $id for schema resolution
curl https://raw.githubusercontent.com/ad-m/kubernetes-json-schema/master/master-standalone-strict/_definitions.json | jq '. + {"$id": "https://raw.githubusercontent.com/ad-m/kubernetes-json-schema/master/master-standalone-strict/_definitions.json"}' > kube.json
sudo apt-get update -y
mkdir external-schemas
curl https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.24.0/_definitions.json | jq '. + {"$id": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.24.0/_definitions.json"}' > external-schemas/kube.json
curl https://raw.githubusercontent.com/socialgouv/helm-charts/v1/charts/cnpg-cluster/values.schema.json > external-schemas/cnpg-cluster.schema.json
curl https://raw.githubusercontent.com/socialgouv/kontinuous/v1/plugins/contrib/charts/app/kontinuous.values.schema.json > external-schemas/app.schema.json
curl https://raw.githubusercontent.com/socialgouv/helm-charts/v1/charts/pgweb/values.schema.json > external-schemas/pgweb.schema.json
curl https://raw.githubusercontent.com/socialgouv/helm-charts/v1/charts/maildev/values.schema.json > external-schemas/maildev.schema.json
curl https://raw.githubusercontent.com/SocialGouv/json-schemas/main/postgres/parameters.json > external-schemas/postgres-parameters.schema.json
curl https://raw.githubusercontent.com/SocialGouv/json-schemas/main/postgres/extensions.json > external-schemas/postgres-extensions.schema.json
curl https://raw.githubusercontent.com/SocialGouv/json-schemas/main/nginx/annotations.schema.json > external-schemas/nginx-annotations.schema.json
- name: test valid schema
run: |
AJV_PARAMS="--spec draft7 --allow-union-types --strict=false --all-errors --errors=json --validate-formats=false -r "plugins/**/*.schema.json" -r kube.json"
AJV_PARAMS='--spec draft7 --allow-union-types --strict=false --all-errors --errors=json --validate-formats=false -r "plugins/**/*.schema.json" -r "./external-schemas/**.json"'
echo "jsonschema-valid.yaml should have no error"
cat .github/jsonschema/jsonschema-valid.yml | yq -o=json > jsonschema-valid.json
RES=$(npx ajv-cli validate -s ./docs/values.schema.json -d jsonschema-valid.json $AJV_PARAMS)
Expand All @@ -47,7 +61,7 @@ jobs:
- name: test invalid schema
run: |
AJV_PARAMS="--spec draft7 --allow-union-types --strict=false --all-errors --errors=json --validate-formats=false -r "plugins/**/*.schema.json" -r kube.json"
AJV_PARAMS='--spec draft7 --allow-union-types --strict=false --all-errors --errors=json --validate-formats=false -r "plugins/**/*.schema.json" -r "./external-schemas/**.json"'
echo "jsonschema-invalid.yaml should have 23 errors"
cat .github/jsonschema/jsonschema-invalid.yml | yq -o=json > jsonschema-invalid.json
npx ajv-cli validate -s ./docs/values.schema.json $AJV_PARAMS -d jsonschema-invalid.json 2>&1 | tail --lines=+2 > invalid-result.json
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tests-kubeconform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
echo "Validate against kube API 1.24.9"
for f in ./tests_yaml/*.yaml; do
echo "$f"
./kubeconform -summary -kubernetes-version 1.24.9 -strict -skip monitoring.coreos.com/v1/PodMonitor,postgresql.cnpg.io/v1/Pooler,postgresql.cnpg.io/v1/Cluster,bitnami.com/v1alpha1/SealedSecret "$f"
./kubeconform -summary -kubernetes-version 1.24.9 -strict -skip monitoring.coreos.com/v1/PodMonitor,postgresql.cnpg.io/v1/Pooler,postgresql.cnpg.io/v1/Cluster,postgresql.cnpg.io/v1/ScheduledBackup,bitnami.com/v1alpha1/SealedSecret "$f"
done
- name: Run kubeconform on [email protected]
Expand All @@ -58,7 +58,7 @@ jobs:
echo "Validate against kube API 1.25.7"
for f in ./tests_yaml/*.yaml; do
echo "$f"
./kubeconform -summary -kubernetes-version 1.25.7 -skip monitoring.coreos.com/v1/PodMonitor,postgresql.cnpg.io/v1/Pooler,postgresql.cnpg.io/v1/Cluster,bitnami.com/v1alpha1/SealedSecret "$f"
./kubeconform -summary -kubernetes-version 1.25.7 -skip monitoring.coreos.com/v1/PodMonitor,postgresql.cnpg.io/v1/Pooler,postgresql.cnpg.io/v1/Cluster,postgresql.cnpg.io/v1/ScheduledBackup,bitnami.com/v1alpha1/SealedSecret "$f"
done
- name: Run kubeconform on [email protected]
Expand All @@ -67,5 +67,5 @@ jobs:
echo "Validate against kube API 1.26.2"
for f in ./tests_yaml/*.yaml; do
echo "$f"
./kubeconform -summary -kubernetes-version 1.26.2 -skip monitoring.coreos.com/v1/PodMonitor,postgresql.cnpg.io/v1/Pooler,postgresql.cnpg.io/v1/Cluster,bitnami.com/v1alpha1/SealedSecret "$f"
./kubeconform -summary -kubernetes-version 1.26.2 -skip monitoring.coreos.com/v1/PodMonitor,postgresql.cnpg.io/v1/Pooler,postgresql.cnpg.io/v1/Cluster,postgresql.cnpg.io/v1/ScheduledBackup,bitnami.com/v1alpha1/SealedSecret "$f"
done
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,34 @@

All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.

## 1.166.0 (2023-10-03)


### Features

* **pg:** add pg_stats_statements ([#425](https://github.com/socialgouv/kontinuous/issues/425)) ([0f2302c](https://github.com/socialgouv/kontinuous/commit/0f2302c6efef190ad92b56a4cd34101323608a79))

## 1.165.6 (2023-09-25)


### Bug Fixes

* **pg:** set default priorityClassName ([#422](https://github.com/socialgouv/kontinuous/issues/422)) ([b3f5bad](https://github.com/socialgouv/kontinuous/commit/b3f5bad55f57a42bdddd51629409c7081ab5b4aa))

## 1.165.5 (2023-09-20)


### Bug Fixes

* json schema fixes ([#414](https://github.com/socialgouv/kontinuous/issues/414)) ([b581f28](https://github.com/socialgouv/kontinuous/commit/b581f28d127231f12042bf7bc3568073df1108e0))

## 1.165.4 (2023-09-19)


### Bug Fixes

* cnpg acid consistency compliance ([#419](https://github.com/socialgouv/kontinuous/issues/419)) ([dde9610](https://github.com/socialgouv/kontinuous/commit/dde9610341a78ed8570ca673ef7c51d97dac5605))

## 1.165.3 (2023-09-18)


Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kontinuous-webhook:
image: ghcr.io/socialgouv/kontinuous/webhook:v1.165.3
image: ghcr.io/socialgouv/kontinuous/webhook:v1.166.0
# image: harbor.fabrique.social.gouv.fr/sre/kontinuous/webhook:1
host: "kontinuous.fabrique.social.gouv.fr"

Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ services:
KUBEWEBHOOK_CONFIG_PATH: config.sample.yaml
KUBEWEBHOOK_SUPERTOKEN: ${KUBEWEBHOOK_SUPERTOKEN:-1234}
KUBEWEBHOOK_EXPOSED_PORT: ${KUBEWEBHOOK_EXPOSED_PORT:-7530}
KUBEWEBHOOK_PIPELINE_IMAGE: ${KUBEWEBHOOK_PIPELINE_IMAGE:-"ghcr.io/socialgouv/kontinuous:v1.165.3"}
KUBEWEBHOOK_PIPELINE_CHECKOUT_IMAGE: ${KUBEWEBHOOK_PIPELINE_CHECKOUT_IMAGE:-"ghcr.io/socialgouv/kontinuous/degit:v1.165.3"}
KUBEWEBHOOK_PIPELINE_IMAGE: ${KUBEWEBHOOK_PIPELINE_IMAGE:-"ghcr.io/socialgouv/kontinuous:v1.166.0"}
KUBEWEBHOOK_PIPELINE_CHECKOUT_IMAGE: ${KUBEWEBHOOK_PIPELINE_CHECKOUT_IMAGE:-"ghcr.io/socialgouv/kontinuous/degit:v1.166.0"}
KUBEWEBHOOK_CI_NAMESPACE_ALLOW_ALL: ${KUBEWEBHOOK_CI_NAMESPACE_ALLOW_ALL:-"true"}
KUBEWEBHOOK_HTTPLOGGER_IGNOREUSERAGENTS: backbox-robot
KUBEWEBHOOK_SENTRY_DSN: ${KUBEWEBHOOK_SENTRY_DSN}
Expand Down
20 changes: 14 additions & 6 deletions docs/extract-plugin-config-schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,14 @@ const getPluginSchema = (plugin, dependencies) => {
const folderProperties = getFilesFromPath(folderPath, true).reduce(
(a, file) => ({
...a,
[file.id]: {
[camelCase(file.id)]: {
type: "object",
title: file.id,
markdownDescription: `Configuration of the ${file.id} plugin\n\nSee [plugin source](https://github.com/SocialGouv/kontinuous/blob/master/plugins/${plugin}/${folder}/${file.path})`,
title: camelCase(file.id),
markdownDescription: `Configuration of the ${camelCase(
file.id
)} plugin\n\nSee [plugin source](https://github.com/SocialGouv/kontinuous/blob/master/plugins/${plugin}/${folder}/${
file.path
})`,
properties: {
enabled: {
title: `${file.id}.enabled`,
Expand All @@ -53,7 +57,11 @@ const getPluginSchema = (plugin, dependencies) => {
},
options: {
title: `${file.id}.options`,
markdownDescription: `Options of the ${file.id} plugin\n\nSee [plugin source](https://github.com/SocialGouv/kontinuous/blob/master/plugins/${plugin}/${folder}/${file.path})`,
markdownDescription: `Options of the ${camelCase(
file.id
)} plugin\n\nSee [plugin source](https://github.com/SocialGouv/kontinuous/blob/master/plugins/${plugin}/${folder}/${
file.path
})`,
type: "object",
properties: {},
},
Expand All @@ -64,10 +72,10 @@ const getPluginSchema = (plugin, dependencies) => {
)
return {
...allFolders,
[folder]: {
[camelCase(folder)]: {
type: "object",
title: folder,
markdownDescription: `Options from the ${folder} type.`,
markdownDescription: `Options from the ${camelCase(folder)} type.`,
properties: folderProperties,
},
}
Expand Down
63 changes: 48 additions & 15 deletions docs/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
"$id": "https://raw.githubusercontent.com/socialgouv/kontinuous/v1/docs/values.schema.json",
"title": "schema for .kontinuous/values.yaml",
"type": "object",
"patternProperties": {
"pg-*": {
"$ref": "https://raw.githubusercontent.com/socialgouv/kontinuous/v1/plugins/fabrique/charts/pg/kontinuous.values.schema.json"
},
"app-*": {
"$ref": "https://raw.githubusercontent.com/socialgouv/kontinuous/v1/plugins/contrib/charts/app/kontinuous.values.schema.json"
}
},
"additionalProperties": {
"type": "object",
"title": "Additional helm chart",
Expand All @@ -17,7 +25,7 @@
}
},
"then": {
"$ref": "https://raw.githubusercontent.com/socialgouv/kontinuous/v1/plugins/contrib/charts/app/kontinuous.values.schema.json#"
"$ref": "https://raw.githubusercontent.com/socialgouv/kontinuous/v1/plugins/contrib/charts/app/kontinuous.values.schema.json"
}
},
{
Expand All @@ -30,7 +38,7 @@
}
},
"then": {
"$ref": "https://raw.githubusercontent.com/socialgouv/kontinuous/v1/plugins/fabrique/charts/pg/kontinuous.values.schema.json#"
"$ref": "https://raw.githubusercontent.com/socialgouv/kontinuous/v1/plugins/fabrique/charts/pg/kontinuous.values.schema.json"
}
},
{
Expand All @@ -43,7 +51,7 @@
}
},
"then": {
"$ref": "https://raw.githubusercontent.com/socialgouv/kontinuous/v1/plugins/contrib/charts/jobs/kontinuous.values.schema.json#"
"$ref": "https://raw.githubusercontent.com/socialgouv/kontinuous/v1/plugins/contrib/charts/jobs/kontinuous.values.schema.json"
}
},
{
Expand All @@ -56,7 +64,7 @@
}
},
"then": {
"$ref": "https://raw.githubusercontent.com/socialgouv/kontinuous/v1/plugins/contrib/charts/oauth2-proxy/values.schema.json#"
"$ref": "https://raw.githubusercontent.com/socialgouv/kontinuous/v1/plugins/contrib/charts/oauth2-proxy/values.schema.json"
}
},
{
Expand Down Expand Up @@ -159,7 +167,7 @@
"project": { "type": "object", "additionalProperties": true },

"jobs": {
"$ref": "https://raw.githubusercontent.com/socialgouv/kontinuous/v1/plugins/contrib/charts/jobs/kontinuous.values.schema.json#"
"$ref": "https://raw.githubusercontent.com/socialgouv/kontinuous/v1/plugins/contrib/charts/jobs/kontinuous.values.schema.json"
}
},
"required": [],
Expand All @@ -171,19 +179,44 @@
"description": "Kontinuous chart to use",
"type": "string",
"default": "app",
"examples": [
"app",
"pg",
"hasura",
"metabase",
"pgweb",
"maildev",
"oauth2-proxy",
"redis"
"anyOf": [
{
"const": "app",
"markdownDescription": "The [app chart](https://github.com/SocialGouv/kontinuous/blob/master/plugins/contrib/charts/app) provides all the resources to deploy a kubernetes application\n\n💡 You can use the [meta `~tpl~` prefix](https://socialgouv.github.io/kontinuous/#/./advanced/build?id=meta-values-plugin-tpl) to make any property a [go template](https://docs.gofiber.io/template/html/TEMPLATES_CHEATSHEET/#template-variables)"
},
{
"const": "pg",
"markdownDescription": "The [pg chart](https://github.com/SocialGouv/kontinuous/blob/master/plugins/fabrique/charts/pg) is a wrapper around [cnpg-cluster helm chart](https://github.com/SocialGouv/kontinuous/blob/master/plugins/fabrique/charts/pg)"
},
{
"const": "hasura",
"markdownDescription": "The [hasura chart](https://github.com/SocialGouv/kontinuous/blob/master/plugins/contrib/charts/hasura) deploys an [hasura](https://hasura.io) instance"
},
{
"const": "metabase",
"markdownDescription": "The [metabase chart](https://github.com/SocialGouv/kontinuous/blob/master/plugins/contrib/charts/metabase) deploys a [metabase](https://metabase.com) instance"
},
{
"const": "pgweb",
"markdownDescription": "The [pgweb chart](https://github.com/SocialGouv/kontinuous/blob/master/plugins/fabrique/charts/pgweb) deploys a [pgweb](https://github.com/sosedoff/pgweb) instance"
},
{
"const": "maildev",
"markdownDescription": "The [maildev chart](https://github.com/SocialGouv/kontinuous/blob/master/plugins/fabrique/charts/maildev) deploys a [maildev](https://github.com/maildev/maildev) instance"
},
{
"const": "oauth2-proxy",
"markdownDescription": "The [oauth2-proxy chart](https://github.com/SocialGouv/kontinuous/blob/master/plugins/contrib/charts/oauth2-proxy) deploys an [oauth2-proxy](https://oauth2-proxy.github.io/oauth2-proxy/) instance"
},
{
"const": "redis",
"markdownDescription": "The [redis chart](https://github.com/SocialGouv/kontinuous/blob/master/plugins/contrib/charts/redis) deploys an [redis](https://oauth2-proxy.github.io/redis/) instance"
}
]
},
"~needs": {
"markdownDescription": "Job or deployment dependencies.\n\nThe meta-value `~needs`is used to define dependencies tree between charts and jobs.\n\nYou can target using simple charts or jobs name, or be more specific to avoid collision in more complex cases.\n\nsee [~needs documentation](https://socialgouv.github.io/kontinuous/#https://raw.githubusercontent.com/socialgouv/kontinuous/v1/advanced/build?id=meta-values-plugin-needs)",
"markdownDescription": "The meta-value `~needs`is used to define dependencies tree between charts and jobs.\n\nYou can target using simple charts or jobs name, or be more specific to avoid collision in more complex cases.\n\nsee [~needs documentation](https://socialgouv.github.io/kontinuous/#https://raw.githubusercontent.com/socialgouv/kontinuous/v1/advanced/build?id=meta-values-plugin-needs)",
"title": "Job or deployment dependencies",
"type": "array",
"items": {
"type": "string"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "~dev",
"version": "1.165.3",
"version": "1.166.0",
"repository": "[email protected]:socialgouv/kontinuous.git",
"license": "MIT",
"private": true,
Expand Down
4 changes: 2 additions & 2 deletions packages/argocd/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ RUN chown 1001:1001 /workspace
RUN git config --global --add safe.directory /workspace


COPY --from=ghcr.io/socialgouv/kontinuous:v1.165.3 /usr/local/bin /usr/local/bin/
COPY --from=ghcr.io/socialgouv/kontinuous:v1.165.3 --chown=999:999 /opt/kontinuous /opt/kontinuous/
COPY --from=ghcr.io/socialgouv/kontinuous:v1.166.0 /usr/local/bin /usr/local/bin/
COPY --from=ghcr.io/socialgouv/kontinuous:v1.166.0 --chown=999:999 /opt/kontinuous /opt/kontinuous/

# Switch back to non-root user
USER 999
2 changes: 1 addition & 1 deletion packages/common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "~common",
"version": "1.165.3",
"version": "1.166.0",
"description": "",
"license": "MIT",
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion packages/dev-tools/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "~dev-tools",
"version": "1.165.3",
"version": "1.166.0",
"dependencies": {
"replace": "^1.2.2",
"~common": "workspace:^"
Expand Down
2 changes: 1 addition & 1 deletion packages/helm-tree/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "helm-tree",
"version": "1.165.3",
"version": "1.166.0",
"description": "",
"license": "MIT",
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion packages/kontinuous/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kontinuous",
"version": "1.165.3",
"version": "1.166.0",
"repository": "https://github.com/socialgouv/kontinuous.git",
"homepage": "https://socialgouv.github.io/kontinuous/",
"license": "MIT",
Expand Down
Loading

0 comments on commit dc702b3

Please sign in to comment.