diff --git a/charts/plume/.helmignore b/charts/plume/.helmignore new file mode 100644 index 00000000..61e5ef82 --- /dev/null +++ b/charts/plume/.helmignore @@ -0,0 +1,26 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ +base/ +prod/ +staging/ +review/ diff --git a/charts/plume/Chart.yaml b/charts/plume/Chart.yaml new file mode 100644 index 00000000..33c25a8c --- /dev/null +++ b/charts/plume/Chart.yaml @@ -0,0 +1,10 @@ +apiVersion: v2 +name: plume +description: A Helm chart for Kubernetes +type: application +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +version: v1.0.0 +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. +appVersion: v1.0.0 diff --git a/charts/plume/templates/NOTES.txt b/charts/plume/templates/NOTES.txt new file mode 100644 index 00000000..c8b089ca --- /dev/null +++ b/charts/plume/templates/NOTES.txt @@ -0,0 +1,22 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "Sorcerer.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "Sorcerer.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "Sorcerer.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "Sorcerer.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT +{{- end }} diff --git a/charts/plume/templates/_helpers.tpl b/charts/plume/templates/_helpers.tpl new file mode 100644 index 00000000..873455be --- /dev/null +++ b/charts/plume/templates/_helpers.tpl @@ -0,0 +1,63 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "Sorcerer.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "Sorcerer.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "Sorcerer.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "Sorcerer.labels" -}} +helm.sh/chart: {{ include "Sorcerer.chart" . }} +{{ include "Sorcerer.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "Sorcerer.selectorLabels" -}} +app.kubernetes.io/name: {{ include "Sorcerer.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "Sorcerer.serviceAccountName" -}} +{{- if .Values.serviceAccount.create -}} + {{ default (include "Sorcerer.fullname" .) .Values.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} diff --git a/charts/plume/templates/cluster.yaml b/charts/plume/templates/cluster.yaml new file mode 100644 index 00000000..14ae12e1 --- /dev/null +++ b/charts/plume/templates/cluster.yaml @@ -0,0 +1,26 @@ +{{- if .Values.cluster.enabled -}} +apiVersion: postgresql.cnpg.io/v1 +kind: Cluster +metadata: + name: {{ include "Sorcerer.fullname" . }} + annotations: + linkerd.io/inject: disabled + labels: + {{- include "Sorcerer.labels" . | nindent 4 }} +spec: + instances: {{ .Values.cluster.instances | default "2" }} + + # Example of rolling update strategy: + # - unsupervised: automated update of the primary once all + # replicas have been upgraded (default) + # - supervised: requires manual supervision to perform + # the switchover of the primary + primaryUpdateStrategy: unsupervised + backup: + retentionPolicy: {{ .Values.cluster.backupRetention | default "60d" }} + + storage: + size: {{ .Values.cluster.size | default "5Gi" }} +{{- end }} + + diff --git a/charts/plume/templates/deployment.yaml b/charts/plume/templates/deployment.yaml new file mode 100644 index 00000000..bdb675ba --- /dev/null +++ b/charts/plume/templates/deployment.yaml @@ -0,0 +1,99 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "Sorcerer.fullname" . }} + labels: + {{- include "Sorcerer.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "Sorcerer.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "Sorcerer.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "Sorcerer.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: {{ .Values.service.port }} + protocol: TCP + env: + {{- toYaml .Values.env | nindent 12 }} + livenessProbe: + httpGet: + path: / + port: http + readinessProbe: + httpGet: + path: / + port: http + resources: + {{- toYaml .Values.resources | nindent 12 }} + volumeMounts: + - name: data + mountPath: /data + - name: appsettings + mountPath: /app/appsettings.json + subPath: appsettings.json + readOnly: true + {{- if .Values.service.https }} + - name: tls-certificates + mountPath: /app/tls + readOnly: true + {{- end }} + {{- if .Values.init.enabled }} + initContainers: + - name: init + image: {{ .Values.init.image }} + command: {{- toYaml .Values.init.command | nindent 10 }} + volumeMounts: + - name: data + mountPath: /data + - name: appsettings + mountPath: /app/appsettings.json + subPath: appsettings.json + readOnly: true + {{- end }} + volumes: + - name: data + {{- if .Values.persistence.enabled }} + persistentVolumeClaim: + claimName: {{ .Values.persistence.existingClaim | default (include "Sorcerer.fullname" .) }} + {{- else }} + emptyDir: {} + {{- end }} + - name: appsettings + configMap: + name: {{ template "Sorcerer.fullname" . }}-appsettings + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/charts/plume/templates/hpa.yaml b/charts/plume/templates/hpa.yaml new file mode 100644 index 00000000..5f9e4563 --- /dev/null +++ b/charts/plume/templates/hpa.yaml @@ -0,0 +1,28 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "Sorcerer.fullname" . }} + labels: + {{- include "Sorcerer.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "Sorcerer.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/charts/plume/templates/ingress.yaml b/charts/plume/templates/ingress.yaml new file mode 100644 index 00000000..697dd44b --- /dev/null +++ b/charts/plume/templates/ingress.yaml @@ -0,0 +1,61 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "Sorcerer.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} + {{- end }} +{{- end }} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "Sorcerer.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .pathType }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} diff --git a/charts/plume/templates/internal-ingress.yaml b/charts/plume/templates/internal-ingress.yaml new file mode 100644 index 00000000..58ab6280 --- /dev/null +++ b/charts/plume/templates/internal-ingress.yaml @@ -0,0 +1,62 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "Sorcerer.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} + {{- end }} +{{- end }} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }}-internal + labels: + {{- include "Sorcerer.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + atlantis.oceanbox.io/expose: internal + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .internal }} + - path: {{ .path }} + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .pathType }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} diff --git a/charts/plume/templates/pvc.yaml b/charts/plume/templates/pvc.yaml new file mode 100644 index 00000000..5b81b095 --- /dev/null +++ b/charts/plume/templates/pvc.yaml @@ -0,0 +1,25 @@ +{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }} +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: {{ template "Sorcerer.fullname" . }} +{{- with .Values.persistence.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} + labels: +{{ include "Sorcerer.labels" . | indent 4 }} +spec: + accessModes: + - {{ .Values.persistence.accessMode | quote }} + resources: + requests: + storage: {{ .Values.persistence.size | quote }} +{{- if .Values.persistence.storageClass }} +{{- if (eq "-" .Values.persistence.storageClass) }} + storageClassName: "" +{{- else }} + storageClassName: "{{ .Values.persistence.storageClass }}" +{{- end }} +{{- end }} +{{- end }} diff --git a/charts/plume/templates/service.yaml b/charts/plume/templates/service.yaml new file mode 100644 index 00000000..bb151e12 --- /dev/null +++ b/charts/plume/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "Sorcerer.fullname" . }} + labels: + {{- include "Sorcerer.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "Sorcerer.selectorLabels" . | nindent 4 }} diff --git a/charts/plume/templates/serviceaccount.yaml b/charts/plume/templates/serviceaccount.yaml new file mode 100644 index 00000000..3691ec99 --- /dev/null +++ b/charts/plume/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "Sorcerer.serviceAccountName" . }} + labels: + {{- include "Sorcerer.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/charts/plume/values.yaml b/charts/plume/values.yaml new file mode 100644 index 00000000..43971408 --- /dev/null +++ b/charts/plume/values.yaml @@ -0,0 +1,100 @@ +# Default values for Plume. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. +replicaCount: 1 +image: + repository: registry.gitlab.com/oceanbox/plume + tag: v1.10.0 + pullPolicy: IfNotPresent +init: + enabled: false + image: ubuntu:rolling + command: ["/bin/sh", "-c", "true"] +env: + - name: LOG_LEVEL + value: "2" + - name: APP_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: APP_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace +imagePullSecrets: + - name: gitlab-pull-secret +nameOverride: "" +fullnameOverride: "" +serviceAccount: + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" +podAnnotations: {} +podSecurityContext: + fsGroup: 2000 +securityContext: + capabilities: + drop: + - ALL + readOnlyRootFilesystem: false + runAsNonRoot: true + runAsUser: 1000 +service: + type: ClusterIP + port: 8085 +ingress: + enabled: true + className: "nginx" + annotations: + nginx.ingress.kubernetes.io/ssl-redirect: "true" + nginx.ingress.kubernetes.io/backend-protocol: HTTP + hosts: + - host: plume.srv.oceanbox.io + paths: + - path: / + pathType: ImplementationSpecific + internal: + - path: /internal + pathType: ImplementationSpecific + tls: + - hosts: + - plume.srv.oceanbox.io + secretName: plume-tls +persistence: + enabled: false + existingClaim: oceanbox-archives + # size: 10G + # storageClass: "" + # accessMode: ReadWriteMany +cluster: + enabled: false + instances: 2 + backupEnabled: true + backupRetention: 60d + size: 5Gi +resources: {} +# We usually recommend not to specify default resources and to leave this as a conscious +# choice for the user. This also increases chances charts run on environments with little +# resources, such as Minikube. If you do want to specify resources, uncomment the following +# lines, adjust them as necessary, and remove the curly braces after 'resources:'. +# limits: +# cpu: 100m +# memory: 128Mi +# requests: +# cpu: 100m +# memory: 128Mi + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 +serviceMonitor: + enabled: true +nodeSelector: {} +tolerations: [] +affinity: {} diff --git a/helmfile.d/kyverno.yaml.gotmpl b/helmfile.d/kyverno.yaml.gotmpl index 957f034b..659ff2c5 100644 --- a/helmfile.d/kyverno.yaml.gotmpl +++ b/helmfile.d/kyverno.yaml.gotmpl @@ -22,7 +22,7 @@ releases: - ../values/kyverno/values/kyverno-{{ .Environment.Name }}.yaml.gotmpl postRenderer: ../bin/kustomizer postRendererArgs: - - ../values/postgres-operator/kustomize/{{ .Environment.Name }} + - ../values/kyverno/kustomize/{{ .Environment.Name }} missingFileHandler: Info - name: kyverno-manifests namespace: kyverno diff --git a/helmfile.d/plume.yaml.gotmpl b/helmfile.d/plume.yaml.gotmpl new file mode 100644 index 00000000..67f1b74a --- /dev/null +++ b/helmfile.d/plume.yaml.gotmpl @@ -0,0 +1,38 @@ +bases: + - ../envs/environments.yaml.gotmpl + +commonLabels: + tier: plume + +releases: +- name: plume + namespace: {{ .Environment.Name }}-plume + chart: ../charts/plume + condition: plume.enabled + values: + - ../values/plume/values/plume.yaml.gotmpl + - ../values/plume/values/plume-{{ .Environment.Name }}.yaml.gotmpl + postRenderer: ../bin/kustomizer + postRendererArgs: + - ../values/plume/kustomize/{{ .Environment.Name }} + missingFileHandler: Info +- name: plume-manifests + namespace: {{ .Environment.Name }}-plume + chart: _plume-manifests + condition: plume.enabled + missingFileHandler: Info + values: + - ../values/values.yaml + - ../values/values-{{ requiredEnv "ARGOCD_ENV_CLUSTER_NAME" }}.yaml + - ../values/plume/values.yaml.gotmpl + - ../values/plume/values-{{ requiredEnv "ARGOCD_ENV_CLUSTER_NAME" }}.yaml.gotmpl + hooks: + - events: [ prepare, cleanup ] + showlogs: true + command: ../bin/helmify + args: + - '{{`{{ if eq .Event.Name "prepare" }}build{{ else }}clean{{ end }}`}}' + - '{{`{{ .Release.Chart }}`}}' + - '{{`{{ .Environment.Name }}`}}' + - ../values/plume/manifests + - _plume-manifests diff --git a/shell.nix b/shell.nix index e47068dd..2a52b293 100644 --- a/shell.nix +++ b/shell.nix @@ -22,6 +22,7 @@ pkgs.mkShellNoCC { packages = with pkgs; [ # nix helpers + just npins nix-converter diff --git a/values/env-ekman.yaml b/values/env-ekman.yaml new file mode 100644 index 00000000..14f54423 --- /dev/null +++ b/values/env-ekman.yaml @@ -0,0 +1,165 @@ +clusterConfig: + manifests: https://gitlab.com/oceanbox/manifests.git + cilium: + enabled: false + env: "prod" + distro: "nixos" + domain: "ekman.oceanbox.io" + initca: "/var/lib/kubernetes/secrets" + apiserver: "frontend" + apiserverip: "10.255.241.99" + etcd_nodes: [ "10.255.241.80, 10.255.241.90, 10.255.241.99" ] + k8s_nodes: [ "10.255.241.80, 10.255.241.90, 10.255.241.99, 10.255.241.100, 10.255.241.101, 10.255.241.102, 10.255.241.103, 10.255.241.104, 10.255.241.105, 10.255.241.106, 10.255.241.107, 10.255.241.108, 10.255.241.109, 10.255.241.110, 10.255.241.111, 10.255.241.112, 10.255.241.113, 10.255.241.114, 10.255.241.116, 10.255.241.121, 10.255.241.122, 10.255.241.123, 10.255.241.124, 10.255.241.125, 10.255.241.126, 10.255.241.127, 10.255.241.128" ] + cluster: "ekman" + ingress_nodes: ["ekman ,frontend" ] + ingress_replica_count: 2 + fileserver: "10.255.241.90" + acme_email: "acme@oceanbox.io" + oidc: + - name: oceanbox + provider: azuread + tenant: "3f737008-e9a0-4485-9d27-40329d288089" + secret_ref: + name: oceanbox-oidc + group_id: "eb17a659-4ce6-41bc-9153-d9b117c44479" + nodes: + - name: frontend + taints: [] + labels: + - "node-role.kubernetes.io=control-plane" + - name: ekman + taints: [] + labels: + - "node-role.kubernetes.io=control-plane" + - name: nfs1 + taints: + - "workload=data:NoSchedule" + labels: + - "node-role.kubernetes.io=control-plane" + - "nfs=data" + - name: fs2 + taints: + - "workload=data:NoSchedule" + labels: + - "node-role.kubernetes.io=control-plane" + - "nfs=data" + - name: c0-1 + taints: + - "workload=compute:NoSchedule" + - name: c0-2 + taints: + - "workload=compute:NoSchedule" + - name: c0-3 + taints: + - "workload=compute:NoSchedule" + - name: c0-4 + taints: + - "workload=compute:NoSchedule" + - name: c0-5 + taints: + - "workload=compute:NoSchedule" + - name: c0-6 + taints: + - "workload=compute:NoSchedule" + - name: c0-7 + taints: + - "workload=compute:NoSchedule" + - name: c0-8 + taints: + - "workload=compute:NoSchedule" + - name: c0-9 + taints: + - "workload=compute:NoSchedule" + - name: c0-10 + taints: + - "workload=compute:NoSchedule" + - name: c0-11 + taints: + - "workload=compute:NoSchedule" + - name: c0-12 + taints: + - "workload=compute:NoSchedule" + - name: c0-13 + taints: + - "workload=compute:NoSchedule" + - name: c0-14 + taints: + - "workload=compute:NoSchedule" + - name: c0-15 + taints: + - "workload=compute:NoSchedule" + - name: c0-16 + taints: + - "workload=compute:NoSchedule" + - name: c1-1 + taints: + - "workload=compute:NoSchedule" + - name: c1-2 + taints: + - "workload=compute:NoSchedule" + - name: c1-3 + taints: + - "workload=compute:NoSchedule" + - name: c1-4 + taints: + - "workload=compute:NoSchedule" + - name: c1-5 + taints: + - "workload=compute:NoSchedule" + - name: c1-6 + taints: + - "workload=compute:NoSchedule" + - name: c1-7 + taints: + - "workload=compute:NoSchedule" + - name: c1-8 + taints: + - "workload=compute:NoSchedule" +# TODO(mrtz): Move to values/*/helmfile.yaml +# argocd: +# adminLogin: false +# additional_rbac_settings: +# - g, "eb17a659-4ce6-41bc-9153-d9b117c44479", role:org-admin +# linkerd: +# trustAnchorPEM: | +# -----BEGIN CERTIFICATE----- +# MIIBtDCCAVqgAwIBAgIQRlhbOLj9zw+QTGHqbOBaozAKBggqhkjOPQQDAjAlMSMw +# IQYDVQQDExpyb290LmxpbmtlcmQuY2x1c3Rlci5sb2NhbDAeFw0yMTA0MDkxNDAy +# NTFaFw0zMTA0MDcxNDAyNTFaMCUxIzAhBgNVBAMTGnJvb3QubGlua2VyZC5jbHVz +# dGVyLmxvY2FsMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEljOLtSPSi6XIEdFP +# VCGa4BKoQ0X5dBSZvHRLt/IzHRzAbIVIjgjvyRQc7EQlRKvZ8P9um/WG1ypyyA2l +# C9MWz6NsMGowDgYDVR0PAQH/BAQDAgEGMBIGA1UdEwEB/wQIMAYBAf8CAQEwHQYD +# VR0OBBYEFHz4UuVKCNX8/hsZCcdTlmWnSCGXMCUGA1UdEQQeMByCGnJvb3QubGlu +# a2VyZC5jbHVzdGVyLmxvY2FsMAoGCCqGSM49BAMCA0gAMEUCIGAiz3yNhboVdze1 +# sNFcFL2GF5WwW9z53u03UkPkiuBTAiEA4ZHWZJVGV5VAQArL5v32HeH/IjC1ssGl +# 7Y8D0rQqkis= +# -----END CERTIFICATE----- +# webhookPEM: | +# -----BEGIN CERTIFICATE----- +# MIIBlDCCATqgAwIBAgIRAP9aY0pRwkDnXqi3FwKmfZowCgYIKoZIzj0EAwIwKDEm +# MCQGA1UEAxMdd2ViaG9vay5saW5rZXJkLmNsdXN0ZXIubG9jYWwwHhcNMjIxMDI3 +# MDUxNTE0WhcNMjQxMDI1MDkxNTE0WjAoMSYwJAYDVQQDEx13ZWJob29rLmxpbmtl +# cmQuY2x1c3Rlci5sb2NhbDBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABIGSt6Th +# 62wgjM5dRbZLa9YwPQAm/T2QnTzzrAUm+GeqvKfBhpPMGX6+91/x20X0uV26LvKz +# YV1wVMs7tuPZioijRTBDMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAGAQH/ +# AgEBMB0GA1UdDgQWBBQWV6+eqRWOPyLWz9s0HT96MOr01zAKBggqhkjOPQQDAgNI +# ADBFAiBTBFuIJUBEI5T2unrnFhM+Bj0rZFfuxQqEwD6+z2YRzwIhAOINkH5u7Z8M +# zIVl06Biq2N+MO4TJ+CSS1C1w/22CDru +# -----END CERTIFICATE----- +# multicluster: +# enabled: false +# prometheus: +# version: 39.6.0 +# snitchUrl: "https://nosnch.in/bceb803932" +# nfs_provisioner: +# version: 4.0.17 +# cert_manager: +# version: 1.9.1 +# gitlab_runner: +# enabled: false +# velero: +# enabled: false +# kyverno: +# enabled: true +# nginx: +# version: 4.12.1 diff --git a/values/plume/manifests/plume.yaml b/values/plume/manifests/plume.yaml new file mode 100644 index 00000000..0f1a5624 --- /dev/null +++ b/values/plume/manifests/plume.yaml @@ -0,0 +1,38 @@ +{{ if .Values.clusterConfig.argo.enabled }} +{{- range .Values.plume.envs }} +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: {{ . }}-plume + namespace: argocd + annotations: + argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + destination: + namespace: {{ . }}-plume + server: https://10.255.241.99:4443 + project: plume + sources: + - repoURL: https://gitlab.com/oceanbox/manifests.git + targetRevision: HEAD + path: helmfile.d + plugin: + name: helmfile-cmp + env: + - name: CLUSTER_NAME + value: {{ $.Values.clusterConfig.cluster }} + - name: HELMFILE_ENVIRONMENT + value: {{ . }} + - name: HELMFILE_FILE_PATH + value: plume.yaml.gotmpl + syncPolicy: + syncOptions: + - CreateNamespace=true + - ApplyOutOfSyncOnly=true + # automated: + # prune: true + # selfHeal: false +{{- end }} +{{- end }} diff --git a/values/plume/values-ekman.yaml.gotmpl b/values/plume/values-ekman.yaml.gotmpl new file mode 100644 index 00000000..f33e724e --- /dev/null +++ b/values/plume/values-ekman.yaml.gotmpl @@ -0,0 +1,4 @@ +plume: + enabled: true + envs: + - staging diff --git a/values/plume/values-oceanbox.yaml.gotmpl b/values/plume/values-oceanbox.yaml.gotmpl new file mode 100644 index 00000000..f33e724e --- /dev/null +++ b/values/plume/values-oceanbox.yaml.gotmpl @@ -0,0 +1,4 @@ +plume: + enabled: true + envs: + - staging diff --git a/values/plume/values.yaml.gotmpl b/values/plume/values.yaml.gotmpl new file mode 100644 index 00000000..006747c7 --- /dev/null +++ b/values/plume/values.yaml.gotmpl @@ -0,0 +1,3 @@ +plume: + enabled: false + autosync: true diff --git a/values/plume/values/.gitkeep b/values/plume/values/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/values/prometheus/env-oceanbox.yaml.gotmpl b/values/prometheus/env-oceanbox.yaml.gotmpl index 5e1fe5bf..0eede571 100644 --- a/values/prometheus/env-oceanbox.yaml.gotmpl +++ b/values/prometheus/env-oceanbox.yaml.gotmpl @@ -1,5 +1,6 @@ prometheus: snitchUrl: "https://nosnch.in/136c1b564f" + oncallUrl: "https://oncall-prod-eu-west-0.grafana.net/oncall/integrations/v1/alertmanager/Tl7qW8KNUTkaYaRzW63kOgDG6/" pagerdutyRoutingKey: a5cff1fc46414d0bc02851e4af159ee7 certRenewCronEnabled: false fullname: prom