From a79c6f71b6a504c26ce43c03335319f3d4f2ba6d Mon Sep 17 00:00:00 2001 From: Denis Patrakeev Date: Mon, 10 Feb 2025 19:00:54 +0300 Subject: [PATCH] [DO-1431] Deploy PlantUML to new prod k8s (!11) [DO-1431] Co-authored-by: denis.patrakeev Reviewed-on: https://git.avroid.tech/K8s/k8s-configs/pulls/11 --- .../plantuml/argocd-apps-plantuml-app.yaml | 53 +++++++++++++++++++ .../argocd-apps-plantuml-namespace.yaml | 25 +++++++++ .../namespaces/plantuml/values.yaml | 41 ++++++++++++++ 3 files changed, 119 insertions(+) create mode 100644 clusters/k8s-avroid-office.prod.local/namespaces/plantuml/argocd-apps-plantuml-app.yaml create mode 100644 clusters/k8s-avroid-office.prod.local/namespaces/plantuml/argocd-apps-plantuml-namespace.yaml create mode 100644 clusters/k8s-avroid-office.prod.local/namespaces/plantuml/values.yaml diff --git a/clusters/k8s-avroid-office.prod.local/namespaces/plantuml/argocd-apps-plantuml-app.yaml b/clusters/k8s-avroid-office.prod.local/namespaces/plantuml/argocd-apps-plantuml-app.yaml new file mode 100644 index 0000000..3cc0f54 --- /dev/null +++ b/clusters/k8s-avroid-office.prod.local/namespaces/plantuml/argocd-apps-plantuml-app.yaml @@ -0,0 +1,53 @@ +--- +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: plantuml + namespace: argocd + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + project: plantuml + destination: + server: https://kubernetes.default.svc + namespace: plantuml + sources: + - repoURL: https://git.avroid.tech/K8s/k8s-configs.git + targetRevision: master + ref: values + # https://github.com/stevehipwell/helm-charts/blob/main/charts/plantuml + - repoURL: https://nexus.avroid.tech/repository/avroid-charts + chart: "plantuml" + targetRevision: 3.36.0 + helm: + valueFiles: + - $values/clusters/k8s-avroid-office.prod.local/namespaces/plantuml/values.yaml + syncPolicy: + automated: + prune: true + selfHeal: true + syncOptions: + - ApplyOutOfSyncOnly=true + - CreateNamespace=true +--- +apiVersion: argoproj.io/v1alpha1 +kind: AppProject +metadata: + name: plantuml + 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://github.com/stevehipwell/helm-charts/blob/main/charts/plantuml + - https://nexus.avroid.tech/repository/avroid-charts + - https://git.avroid.tech/K8s/k8s-configs.git + # Only permit applications to deploy to the guestbook namespace in the same cluster + destinations: + - namespace: plantuml + 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/plantuml/argocd-apps-plantuml-namespace.yaml b/clusters/k8s-avroid-office.prod.local/namespaces/plantuml/argocd-apps-plantuml-namespace.yaml new file mode 100644 index 0000000..039c67a --- /dev/null +++ b/clusters/k8s-avroid-office.prod.local/namespaces/plantuml/argocd-apps-plantuml-namespace.yaml @@ -0,0 +1,25 @@ +--- +apiVersion: v1 +kind: Namespace +metadata: + name: plantuml + labels: + name: plantuml + 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: plantuml + namespace: plantuml + labels: + app.kubernetes.io/managed-by: argocd +spec: + hard: + requests.cpu: "0.5" + requests.memory: 2Gi + limits.cpu: "2" + limits.memory: 4Gi diff --git a/clusters/k8s-avroid-office.prod.local/namespaces/plantuml/values.yaml b/clusters/k8s-avroid-office.prod.local/namespaces/plantuml/values.yaml new file mode 100644 index 0000000..091c7c3 --- /dev/null +++ b/clusters/k8s-avroid-office.prod.local/namespaces/plantuml/values.yaml @@ -0,0 +1,41 @@ +# https://github.com/stevehipwell/helm-charts/blob/main/charts/plantuml/values.yaml + +image: + # -- Image repository for the default container. + repository: harbor.avroid.tech/docker-hub-proxy/plantuml/plantuml-server + +ingress: + # -- If `true`, create an `Ingress` resource. + enabled: true + # -- Ingress annotations. + annotations: + kubernetes.io/ingress.class: nginx + ingressClassName: "nginx" + # -- (list) Ingress hosts. + # @default -- See _values.yaml_ + hosts: + - plantuml.avroid.tech + # -- (string) Ingress path. + path: / + # -- (list) Ingress TLS. + # @default -- See _values.yaml_ + tls: [] + # - hosts: + # - plantuml.local + # secretName: plantuml-tls + +# -- Number of replicas to create if `autoscaling.enabled` is `false`. +replicaCount: 2 + +# -- Resources for the default container. +resources: + requests: + cpu: 500m + memory: 1024Mi + limits: + cpu: 1000m + memory: 2048Mi + +# -- Node labels to match for pod scheduling. +nodeSelector: + node-role.kubernetes.io/worker: ""