Unverified Commit 5fbace68 authored by Julien Bouquillon's avatar Julien Bouquillon 🐫 Committed by GitHub
Browse files

fix: use preprod env to update prod cluster due to ram usage (#31)

* fix(k8s): use prod.nodeSelector

* fix: use preprod env to update prod cluster due to ram usage

* fix(indexing): rm nodeSelector
parent d68ceddd
......@@ -60,8 +60,9 @@ Download and Index (prod):
- if: "$CI_COMMIT_TAG"
when: manual
variables:
KOSKO_GENERATE_ARGS: --env prod jobs/indexing
# the preprod env is used for production index
# so it runs on the dev cluster
KOSKO_GENERATE_ARGS: --env preprod jobs/indexing
environment:
name: ${AUTO_DEVOPS_PROD_ENVIRONMENT_NAME}
url: https://${CI_PROJECT_NAME}.${KUBE_INGRESS_BASE_DOMAIN}
\ No newline at end of file
name: ${CI_COMMIT_REF_NAME}${AUTO_DEVOPS_DEV_ENVIRONMENT_NAME}
url: https://${CI_ENVIRONMENT_SLUG}-${CI_PROJECT_NAME}.${KUBE_INGRESS_BASE_DOMAIN}
......@@ -7,7 +7,6 @@ kind: SealedSecret
metadata:
name: elastic-recherche-entreprises-write
annotations:
sealedsecrets.bitnami.com/cluster-wide: 'true'
app.gitlab.com/app: socialgouv-recherche-entreprises
app.gitlab.com/env: recherche-entreprises-209-gitlab3-dev2
app.gitlab.com/env.name: gitlab3-dev2
......@@ -20,13 +19,12 @@ metadata:
spec:
encryptedData:
ELASTICSEARCH_URL: >-
AgDGWiSE5kUv0Mv4Dot8KfbSGm5XVlyi4V9yLiMI97deZctFWRd2T31MtTUz/XgT4VlFH4NUhK+dQonLEILE2P9rs4MMDaY09cc3NZiDLB9GJoBcWnWsa02QV4Xykk8UthTHQPFC4g+0ElFU4UewbIc3Zc2ZqIk5Y803TnYkRuAF1bM1ZdpWGnm+yh7+lXnbRMmFo62vhPVB8lnl9Z/RVxhs1jx6xnbIFyTjvelM4/sySiyHZ0h74fL61DAvOcNBgCTd49RRBBzcAhp6a8KL45FL1eAYyOqS8vW5uNeFu59Cu9ByRruhyTELjpPtLesjsBUHiqmfB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P7kC8UwC4ZFAnWRrf8jsjqynS68ETPaAZQNYSxYFlcwX2Nwo5NcxxtB1zrg353rTVKLZX9NNTkBJ5xZ1P1CuyaI6Y81DzJm7jvoGIMxFHLjaaLdW9RTlKdM+2Q9XmnHtvjFGQ74ncA6+v7ndC4XzrQeTIPkcz36xFyq464zP2y9jX8IG1sEMAKGu17hkoXhDrE+kf+XAUr/nhIxy6b5Jz+4xgsacpkOURQ1Zao7CJdLPTCaZSCJeF61t+lQ/Zk6+6kgvH6G4d3hu4TbxgsVH3WH1clBsHGC5BsffYHt1OrVduAt8PGb2SX905+NrzlyBl+dY8tBk9ps3U8KBz6xeksoJgEwv3+fklKNJ+VpP/ulA+ANYqwBzuw/LiO0hC1JV5y/SngihduKdcOubVEpTUjq/AhZOk6Fz0hdw9y95pokJZuljOqdILr5r32jeMCY5s2npobBgd83wTzqlqCqZo8S2mVuRJKjscOrJd/VEuIPaiIfKxzYjDBSmYhzl0Lcpa05JP97mXT4o03cubUpD7CYB5/VHbGj1QX9jG2pde0zq+xBeJpbjgWEYwvFUBmiIGxzyz7X4h5T2quKGlJIxaQsNd1Vq2tx2289olBsfyyr2Qj5v5NJVBZtWfskBtqnPuGJwNANyf2zYl9Umrv9Gos4lzK1EccTtWjPnHjkGPdZXIHyJezc9ct9xJ60coUsFazd+j1fRBIXSuEAgxqHvX4Cc3/5tEgTwj7mIVHVnnRqJbXG3fko=
template:
metadata:
annotations:
sealedsecrets.bitnami.com/cluster-wide: 'true'
app.gitlab.com/app: socialgouv-recherche-entreprises
app.gitlab.com/env: recherche-entreprises-209-gitlab3-dev2
app.gitlab.com/env.name: gitlab3-dev2
......
......@@ -8,6 +8,7 @@ import { addInitContainer } from "@socialgouv/kosko-charts/utils/addInitContaine
import { Container } from "kubernetes-models/v1/Container";
import { ConfigMap } from "kubernetes-models/_definitions/IoK8sApiCoreV1ConfigMap";
import { IIoK8sApiCoreV1PodSpec } from "kubernetes-models/api/core/v1/PodSpec";
import { IIoK8sApimachineryPkgApisMetaV1ObjectMeta } from "kubernetes-models/apimachinery/pkg/apis/meta/v1/ObjectMeta";
import gitlab from "@socialgouv/kosko-charts/environments/gitlab";
import { SealedSecret } from "@kubernetes-models/sealed-secrets/bitnami.com/v1alpha1/SealedSecret";
......@@ -32,6 +33,12 @@ const secrets = {
ELASTICSEARCH_API_KEY:
"AgDE1F8SFMKtRpPd9BKozxXC5YcwVae1SRc+ECX/9EUhLSaqxGXenqVbtE2tj6kovFcru8sSMgPQZIOGDel4QIpwGC9HozNQWGXkEf9AABjulJ82hwlyo/22XOYodqAs3FuZc0tiodEK6+GUw9KKVf6I2P3Y55AzwfZNuar319LG1H0OmkvJbaXjkQwuELjBeU0OG1hPSf3LSIX4F6hc9JlunyDgWFT+vqe7FN+0Q/BmRgbY9SJ4ZqD+TZxzLfKCmWAtGFWW2eFf5jJDmuXp5A4QK+jSd1vonJGjFn16fEgA32tOnBxaA+7TpcBqVq/oOqYvBckuXlDUrBIXkfKRK/FqjvFCxtkhpzrYRe6FFntA6MFmnYvzhsUEoIOSrn3O8Unlaae//am/sukctTkqTum4IF0316k5UwUjcEsd/1qTFM84l3mcPBeU656t1B0sAaTK5JEPSOkJvz1nk9Ei1RUXPJCVTp3i64hia5OeWgEaTWUsP1udhMhC1eGSt0tf5QtNnnDlpASebmI7oubuSiOLveXg/+RcHNXTztrbc3xSNAUIML8GTXNbA4TJXorvZKdecvVbmtsbH7u+4awna7J+SuAysKNdWdTeMsT0uMdFA0o4fez+PQVXc9+IF0DqU0T8EDeLfz62663aW1R7rQ2KEjK/2Vvy8W6EUjXIdY1DEPv1BmHpI9xRJJ8P8sTucaXBmohjPJb1lXzh+/9AmeIRhy/mDJTnCox/UOfyRrpx+FcU/Vi6TvJvV8ab7JZbufOVmo1iEPnP3Wx3rcQ=",
},
preprod: {
ELASTICSEARCH_URL:
"AgAkda1Xa3iLWJ4vUT1aDprWjzLi+LS+ZBZiiH5LY2ZZparvRLxs4yja0r38mhe/1yCoVGJXfeLrviM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wXIFQ726kse5sMh8Ste+z1lKEIfq6jOKZZ7sUiSTwuLuGTmEqy5mdcmkyeCgp4paYOyzKHhYDNXaoZkKguZP9DuOY+44g4uch9Uj3hGvZb+4dV41FGIJ3PB0YZbbxgHF3UA6iHGkZcITwxhn4lJADU7yJyQcrziDXccKa1yiGe9BOOjGn2+WOLF0lrLsA6Uxk70sEiwZygYJQCJGN6KsHPz7Resz6aF/YTY3K+m65VeI4g==",
......@@ -42,27 +49,19 @@ const secrets = {
// return a sealed-secret manifest
const getSealedSecret = (
env: string,
values: Record<string, string>
values: Record<string, string>,
annotations?: IIoK8sApimachineryPkgApisMetaV1ObjectMeta["annotations"]
): SealedSecret =>
new SealedSecret({
metadata: {
name: "elastic-recherche-entreprises-write",
annotations:
(env === "dev" && {
"sealedsecrets.bitnami.com/cluster-wide": "true",
}) ||
{},
annotations,
},
spec: {
encryptedData: values,
template: {
metadata: {
annotations:
(env === "dev" && {
"sealedsecrets.bitnami.com/cluster-wide": "true",
}) ||
{},
annotations,
name: "elastic-recherche-entreprises-write",
},
type: "Opaque",
......@@ -71,10 +70,14 @@ const getSealedSecret = (
});
// create a sealed secret for the indexing job
const sealedSecretContext = env.env === "prod" ? "prod" : "dev";
const sealedSecretSecrets =
env.env === "prod" ? "prod" : env.env === "preprod" ? "preprod" : "dev";
const sealedSecret = getSealedSecret(
sealedSecretContext,
secrets[sealedSecretContext]
secrets[sealedSecretSecrets],
(env.env === "dev" && {
"sealedsecrets.bitnami.com/cluster-wide": "true",
}) ||
{}
);
// base definition of the job
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment