From 8ceba8a21774f731cd90bda5f69eca71b4e0e1de Mon Sep 17 00:00:00 2001 From: Denis Patrakeev Date: Mon, 10 Feb 2025 15:47:08 +0300 Subject: [PATCH] [DO-1431] Test deploy karma in new prod K8s (!8) [DO-1431] Co-authored-by: denis.patrakeev Reviewed-on: https://git.avroid.tech/K8s/k8s-configs/pulls/8 --- .../karma/argocd-apps-karma-app.yaml | 51 ++++++++++++++++ .../karma/argocd-apps-karma-namespace.yaml | 25 ++++++++ .../namespaces/karma/values.yaml | 60 +++++++++++++++++++ 3 files changed, 136 insertions(+) create mode 100644 clusters/k8s-avroid-office.prod.local/namespaces/karma/argocd-apps-karma-app.yaml create mode 100644 clusters/k8s-avroid-office.prod.local/namespaces/karma/argocd-apps-karma-namespace.yaml create mode 100644 clusters/k8s-avroid-office.prod.local/namespaces/karma/values.yaml diff --git a/clusters/k8s-avroid-office.prod.local/namespaces/karma/argocd-apps-karma-app.yaml b/clusters/k8s-avroid-office.prod.local/namespaces/karma/argocd-apps-karma-app.yaml new file mode 100644 index 0000000..2f63c78 --- /dev/null +++ b/clusters/k8s-avroid-office.prod.local/namespaces/karma/argocd-apps-karma-app.yaml @@ -0,0 +1,51 @@ +--- +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: karma + namespace: argocd + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + project: karma + destination: + server: https://kubernetes.default.svc + namespace: karma + sources: + - repoURL: https://git.avroid.tech/K8s/k8s-configs.git + targetRevision: master + ref: values + - repoURL: https://wiremind.github.io/wiremind-helm-charts + chart: "karma" + targetRevision: 2.9.3 + helm: + valueFiles: + - $values/clusters/k8s-avroid-office.prod.local/namespaces/karma/values.yaml + syncPolicy: + automated: + prune: true + selfHeal: true + syncOptions: + - ApplyOutOfSyncOnly=true + - CreateNamespace=true +--- +apiVersion: argoproj.io/v1alpha1 +kind: AppProject +metadata: + name: karma + namespace: argocd + # Finalizer that ensures that project is not deleted until it is not referenced by any application + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + sourceRepos: + - https://wiremind.github.io/wiremind-helm-charts + - https://git.avroid.tech/K8s/k8s-configs.git + # Only permit applications to deploy to the guestbook namespace in the same cluster + destinations: + - namespace: karma + server: https://kubernetes.default.svc + # Deny all cluster-scoped resources from being created, except for Namespace + clusterResourceWhitelist: + - group: '' + kind: Namespace diff --git a/clusters/k8s-avroid-office.prod.local/namespaces/karma/argocd-apps-karma-namespace.yaml b/clusters/k8s-avroid-office.prod.local/namespaces/karma/argocd-apps-karma-namespace.yaml new file mode 100644 index 0000000..fa689ad --- /dev/null +++ b/clusters/k8s-avroid-office.prod.local/namespaces/karma/argocd-apps-karma-namespace.yaml @@ -0,0 +1,25 @@ +--- +apiVersion: v1 +kind: Namespace +metadata: + name: karma + labels: + name: karma + app.kubernetes.io/managed-by: argocd + annotations: + argocd.argoproj.io/sync-wave: "-1" + scheduler.alpha.kubernetes.io/node-selector: node-role.kubernetes.io/worker= +--- +apiVersion: v1 +kind: ResourceQuota +metadata: + name: karma + namespace: karma + labels: + app.kubernetes.io/managed-by: argocd +spec: + hard: + requests.cpu: "0.5" + requests.memory: 1Gi + limits.cpu: "1" + limits.memory: 2Gi diff --git a/clusters/k8s-avroid-office.prod.local/namespaces/karma/values.yaml b/clusters/k8s-avroid-office.prod.local/namespaces/karma/values.yaml new file mode 100644 index 0000000..faa8656 --- /dev/null +++ b/clusters/k8s-avroid-office.prod.local/namespaces/karma/values.yaml @@ -0,0 +1,60 @@ +# https://github.com/wiremind/wiremind-helm-charts/blob/main/charts/karma/values.yaml + +# Number of replicas +replicaCount: 2 + +image: + repository: ghcr.io/prymitive/karma + +ingress: + enabled: true + annotations: + kubernetes.io/ingress.class: nginx + hosts: + - karma.avroid.tech + ingressClassName: "nginx" + path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +nodeSelector: node-role.kubernetes.io/worker= + +configMap: + enabled: true + rawConfig: + alertmanager: + interval: 30s + servers: + - cluster: standalone + name: avroid + uri: http://h-mon.avroid.tech:9093 + timeout: 10s + proxy: true + cors: + credentials: same-origin + labels: + color: + static: + - job + unique: + - alertname + - alertgroup + - severity + - name + - job + - instance + - subsystem + - device + - mountpoint + ui: + refresh: 10s + animations: true + colorTitlebar: true + multiGridLabel: severity + filters: + default: + - "@state!=suppressed" + - "@receiver!=avroid_alerts_critical"