diff --git a/atlantis/applicationset.yaml b/atlantis/applicationset.yaml new file mode 100644 index 00000000..b3ca748d --- /dev/null +++ b/atlantis/applicationset.yaml @@ -0,0 +1,37 @@ +apiVersion: argoproj.io/v1alpha1 +kind: ApplicationSet +metadata: + name: atlantis + namespace: argocd +spec: + generators: + - list: + elements: + - cluster: https://kubernetes.default.svc + env: prod + hostname: atlantis.srv.oceanbox.io + - cluster: https://kubernetes.default.svc + env: staging + hostname: atlantis.beta.oceanbox.io + template: + metadata: + name: '{{ env }}-atlantis' + spec: + project: atlantis + destination: + namespace: atlantis + server: '{{ cluster }}' + sources: + - repoURL: https://gitlab.com/oceanbox/manifests.git + targetRevision: HEAD + path: atlantis + plugin: + name: kustomize-helm-with-rewrite + parameters: + - name: env + string: '{{ env }}' + - name: hostname + string: '{{ hostname }}' + - repoURL: https://gitlab.com/oceanbox/manifests.git + targetRevision: HEAD + path: atlantis/manifests diff --git a/atlantis/base/deployment_patch.yaml b/atlantis/base/deployment_patch.yaml new file mode 100644 index 00000000..53a116df --- /dev/null +++ b/atlantis/base/deployment_patch.yaml @@ -0,0 +1,6 @@ +- op: replace + path: /spec/template/spec/containers/0/livenessProbe/httpGet/path + value: /healthz +- op: replace + path: /spec/template/spec/containers/0/readinessProbe/httpGet/path + value: /healthz diff --git a/atlantis/base/kustomization.yaml b/atlantis/base/kustomization.yaml new file mode 100644 index 00000000..e205ccce --- /dev/null +++ b/atlantis/base/kustomization.yaml @@ -0,0 +1,16 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +patches: + - target: + version: v1 + group: apps + kind: Deployment + name: atlantis + path: deployment_patch.yaml + - target: + version: v1 + kind: Service + name: atlantis + path: service_patch.yaml +resources: + - _manifest.yaml \ No newline at end of file diff --git a/atlantis/base/service_patch.yaml b/atlantis/base/service_patch.yaml new file mode 100644 index 00000000..b0505054 --- /dev/null +++ b/atlantis/base/service_patch.yaml @@ -0,0 +1,7 @@ +- op: add + path: /spec/ports/- + value: + name: intra + port: 8000 + protocol: TCP + targetPort: 8000 \ No newline at end of file diff --git a/atlantis/chart/.helmignore b/atlantis/chart/.helmignore new file mode 100644 index 00000000..61e5ef82 --- /dev/null +++ b/atlantis/chart/.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/atlantis/chart/Chart.yaml b/atlantis/chart/Chart.yaml new file mode 100644 index 00000000..77905781 --- /dev/null +++ b/atlantis/chart/Chart.yaml @@ -0,0 +1,21 @@ +apiVersion: v2 +name: atlantis +description: Atlantis map and simulation service + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +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: 1.0.1 + +# 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: 0.0.0 diff --git a/atlantis/chart/templates/NOTES.txt b/atlantis/chart/templates/NOTES.txt new file mode 100644 index 00000000..a89039c4 --- /dev/null +++ b/atlantis/chart/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 "Atlantis.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 "Atlantis.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "Atlantis.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 "Atlantis.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/atlantis/chart/templates/_helpers.tpl b/atlantis/chart/templates/_helpers.tpl new file mode 100644 index 00000000..b7532841 --- /dev/null +++ b/atlantis/chart/templates/_helpers.tpl @@ -0,0 +1,63 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "Atlantis.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 "Atlantis.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 "Atlantis.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "Atlantis.labels" -}} +helm.sh/chart: {{ include "Atlantis.chart" . }} +{{ include "Atlantis.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "Atlantis.selectorLabels" -}} +app.kubernetes.io/name: {{ include "Atlantis.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "Atlantis.serviceAccountName" -}} +{{- if .Values.serviceAccount.create -}} + {{ default (include "Atlantis.fullname" .) .Values.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} diff --git a/atlantis/chart/templates/cluster.yaml b/atlantis/chart/templates/cluster.yaml new file mode 100644 index 00000000..957837c0 --- /dev/null +++ b/atlantis/chart/templates/cluster.yaml @@ -0,0 +1,26 @@ +{{- if .Values.cluster.enabled -}} +apiVersion: postgresql.cnpg.io/v1 +kind: Cluster +metadata: + name: {{ include "Atlantis.fullname" . }} + annotations: + linkerd.io/inject: disabled + labels: + {{- include "Atlantis.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/atlantis/chart/templates/deployment.yaml b/atlantis/chart/templates/deployment.yaml new file mode 100644 index 00000000..9b9fbd0a --- /dev/null +++ b/atlantis/chart/templates/deployment.yaml @@ -0,0 +1,99 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "Atlantis.fullname" . }} + labels: + {{- include "Atlantis.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "Atlantis.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "Atlantis.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "Atlantis.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: /healthz + port: http + readinessProbe: + httpGet: + path: /healthz + 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 "Atlantis.fullname" .) }} + {{- else }} + emptyDir: {} + {{- end }} + - name: appsettings + secret: + secretName: {{ template "Atlantis.name" . }}-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/atlantis/chart/templates/hpa.yaml b/atlantis/chart/templates/hpa.yaml new file mode 100644 index 00000000..88ff2c11 --- /dev/null +++ b/atlantis/chart/templates/hpa.yaml @@ -0,0 +1,28 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "Atlantis.fullname" . }} + labels: + {{- include "Atlantis.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "Atlantis.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/atlantis/chart/templates/ingress.yaml b/atlantis/chart/templates/ingress.yaml new file mode 100644 index 00000000..588939f4 --- /dev/null +++ b/atlantis/chart/templates/ingress.yaml @@ -0,0 +1,61 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "Atlantis.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 "Atlantis.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/atlantis/chart/templates/pvc.yaml b/atlantis/chart/templates/pvc.yaml new file mode 100644 index 00000000..2e9d6b11 --- /dev/null +++ b/atlantis/chart/templates/pvc.yaml @@ -0,0 +1,25 @@ +{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }} +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: {{ template "Atlantis.fullname" . }} +{{- with .Values.persistence.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} + labels: +{{ include "Atlantis.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/atlantis/chart/templates/service.yaml b/atlantis/chart/templates/service.yaml new file mode 100644 index 00000000..de02894a --- /dev/null +++ b/atlantis/chart/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "Atlantis.fullname" . }} + labels: + {{- include "Atlantis.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "Atlantis.selectorLabels" . | nindent 4 }} diff --git a/atlantis/chart/templates/serviceaccount.yaml b/atlantis/chart/templates/serviceaccount.yaml new file mode 100644 index 00000000..b665c29a --- /dev/null +++ b/atlantis/chart/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "Atlantis.serviceAccountName" . }} + labels: + {{- include "Atlantis.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/atlantis/chart/values.yaml b/atlantis/chart/values.yaml new file mode 100644 index 00000000..c2c89f9e --- /dev/null +++ b/atlantis/chart/values.yaml @@ -0,0 +1,100 @@ +# Default values for Atlantis. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: registry.gitlab.com/oceanbox/atlantis + tag: latest + pullPolicy: IfNotPresent + +init: + enabled: false + image: ubuntu:rolling + command: [ "/bin/sh", "-c", "true" ] + +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: atlantis.srv.oceanbox.io + paths: + - path: / + pathType: ImplementationSpecific + tls: + - hosts: + - atlantis.srv.oceanbox.io + secretName: atlantis-tls + +persistence: + enabled: false + size: 1G + storageClass: "" + accessMode: ReadWriteOnce + +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 + +nodeSelector: {} + +tolerations: [] + +affinity: {} diff --git a/atlantis/manifests/subscriptions.yaml b/atlantis/manifests/subscriptions.yaml new file mode 100644 index 00000000..e08afd0a --- /dev/null +++ b/atlantis/manifests/subscriptions.yaml @@ -0,0 +1,25 @@ +apiVersion: dapr.io/v1alpha1 +kind: Subscription +metadata: + name: hipster-events +spec: + topic: hipster + route: /hipster-events + pubsubname: pubsub +scopes: +- staging-atlantis +- production-atlantis +- x-review-atlantis +--- +apiVersion: dapr.io/v1alpha1 +kind: Subscription +metadata: + name: inbox-events +spec: + topic: inbox + route: /inbox-events + pubsubname: pubsub +scopes: +- staging-atlantis +- production-atlantis +- x-review-atlantis diff --git a/atlantis/prod-values.yaml b/atlantis/prod-values.yaml new file mode 100644 index 00000000..22801a09 --- /dev/null +++ b/atlantis/prod-values.yaml @@ -0,0 +1,30 @@ +fullnameOverride: atlantis + +ingress: + annotations: + cert-manager.io/cluster-issuer: letsencrypt-production + nginx.ingress.kubernetes.io/proxy-buffer-size: 128k + # nginx.ingress.kubernetes.io/whitelist-source-range: 0.0.0.0/0 + hosts: + - host: atlantis.srv.oceanbox.io + paths: + - path: / + pathType: ImplementationSpecific + - host: maps.oceanbox.io + paths: + - path: / + pathType: ImplementationSpecific + tls: + - hosts: + - atlantis.srv.oceanbox.io + - maps.oceanbox.io + secretName: atlantis-tls + +resources: + limits: + cpu: 250m + memory: 1Gi + requests: + cpu: 250m + memory: 1Gi + diff --git a/atlantis/prod/appsettings.json b/atlantis/prod/appsettings.json new file mode 100644 index 00000000..4c2c1cbb --- /dev/null +++ b/atlantis/prod/appsettings.json @@ -0,0 +1,35 @@ +{ + "oidc": { + "issuer": "https://idp.oceanbox.io/dex", + "authorization_endpoint": "https://idp.oceanbox.io/dex/auth", + "token_endpoint": "https://idp.oceanbox.io/dex/token", + "jwks_uri": "https://idp.oceanbox.io/dex/keys", + "userinfo_endpoint": "https://idp.oceanbox.io/dex/userinfo", + "device_authorization_endpoint": "https://idp.oceanbox.io/dex/device/code", + "clientId": "atlantis", + "clientSecret": "KOJ6bDHzE5vdyfSrzgwLjtM5PzA809Zm", + "scopes": [ + "openid", + "email", + "offline_access", + "profile" + ] + }, + "sso": { + "cookieDomain": ".oceanbox.io", + "signedOutRedirectUri": "https://idp.oceanbox.io/dex/static/logout.html", + "redis": "redis-master,user=default,password=ymL4dlOBvU", + "appDomain": "atlantis", + "dataProtectionKeys": "DataProtection-Keys" + }, + "archmeister" : "https://archmeister.srv.oceanbox.io", + "sorcerer" : "https://sorcerer.archive.oceanbox.io", + "allowedOrigins": [ + "http://maps.oceanbox.io", + "https://maps.oceanbox.io", + "http://atlantis.srv.oceanbox.io", + "https://atlantis.srv.oceanbox.io" + ], + "logService" : "https://seq.oceanbox.io", + "logApiKey": "bFdYPKLDvnau3fQa1vRV" +} \ No newline at end of file diff --git a/atlantis/prod/deployment_patch.yaml b/atlantis/prod/deployment_patch.yaml new file mode 100644 index 00000000..2197b1e2 --- /dev/null +++ b/atlantis/prod/deployment_patch.yaml @@ -0,0 +1,25 @@ +- op: add + path: /spec/template/metadata/annotations + value: + dapr.io/enabled: "true" + dapr.io/app-id: "prod-atlantis" + dapr.io/app-port: "8000" + dapr.io/config: "tracing" +- op: add + path: /spec/template/spec/containers/0/env/- + value: + name: BARENTSWATCH_SECRET + valueFrom: + secretKeyRef: + name: prod-atlantis-barentswatch + key: secret + optional: true +- op: add + path: /spec/template/spec/containers/0/env/- + value: + name: BARENTSWATCH_CLIENT_ID + valueFrom: + secretKeyRef: + name: prod-atlantis-barentswatch + key: client-id + optional: true \ No newline at end of file diff --git a/atlantis/prod/kustomization.yaml b/atlantis/prod/kustomization.yaml new file mode 100644 index 00000000..df28c11b --- /dev/null +++ b/atlantis/prod/kustomization.yaml @@ -0,0 +1,16 @@ +namePrefix: prod- +generatorOptions: + disableNameSuffixHash: true +secretGenerator: + - name: atlantis-appsettings + files: + - appsettings.json +patches: + - target: + group: apps + version: v1 + kind: Deployment + name: atlantis + path: deployment_patch.yaml +resources: + - ../base \ No newline at end of file diff --git a/atlantis/staging-values.yaml b/atlantis/staging-values.yaml new file mode 100644 index 00000000..37b01222 --- /dev/null +++ b/atlantis/staging-values.yaml @@ -0,0 +1,29 @@ +fullnameOverride: atlantis + +image: + tag: latest + +ingress: + annotations: + cert-manager.io/cluster-issuer: letsencrypt-production + nginx.ingress.kubernetes.io/proxy-buffer-size: 128k + # nginx.ingress.kubernetes.io/whitelist-source-range: 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 + # nginx.ingress.kubernetes.io/whitelist-source-range: 0.0.0.0/0 + hosts: + - host: atlantis.beta.oceanbox.io + paths: + - path: / + pathType: ImplementationSpecific + tls: + - hosts: + - atlantis.beta.oceanbox.io + secretName: atlantis-tls + +resources: + limits: + cpu: 250m + memory: 1Gi + requests: + cpu: 250m + memory: 1Gi + diff --git a/atlantis/staging/appsettings.json b/atlantis/staging/appsettings.json new file mode 100644 index 00000000..84671a7e --- /dev/null +++ b/atlantis/staging/appsettings.json @@ -0,0 +1,33 @@ +{ + "oidc": { + "issuer": "https://idp.oceanbox.io/dex", + "authorization_endpoint": "https://idp.oceanbox.io/dex/auth", + "token_endpoint": "https://idp.oceanbox.io/dex/token", + "jwks_uri": "https://idp.oceanbox.io/dex/keys", + "userinfo_endpoint": "https://idp.oceanbox.io/dex/userinfo", + "device_authorization_endpoint": "https://idp.oceanbox.io/dex/device/code", + "clientId": "atlantis_dev", + "clientSecret": "3QjfSPmAemjn34XVA2o1fvoS7I4gKvOR", + "scopes": [ + "openid", + "email", + "offline_access", + "profile" + ] + }, + "sso": { + "cookieDomain": ".oceanbox.io", + "signedOutRedirectUri": "https://idp.oceanbox.io/dex/static/logout.html", + "redis": "redis-master,user=default,password=JICkoUKD0Y", + "appDomain": "atlantis", + "dataProtectionKeys": "DataProtection-Keys" + }, + "archmeister" : "https://archmeister.beta.oceanbox.io", + "sorcerer" : "https://sorcerer.beta.archive.oceanbox.io", + "allowedOrigins": [ + "http://atlantis.beta.oceanbox.io", + "https://atlantis.beta.oceanbox.io" + ], + "logService" : "https://seq.oceanbox.io", + "logApiKey": "WmZplDeFoxIHpJQ5BiDk" +} \ No newline at end of file diff --git a/atlantis/staging/auth b/atlantis/staging/auth new file mode 100644 index 00000000..c5302c42 --- /dev/null +++ b/atlantis/staging/auth @@ -0,0 +1 @@ +oceanbox:$apr1$4njCUY7A$fmWQSymNJ6abSHvwDpNGU/ diff --git a/atlantis/staging/deployment_patch.yaml b/atlantis/staging/deployment_patch.yaml new file mode 100644 index 00000000..35ed76e6 --- /dev/null +++ b/atlantis/staging/deployment_patch.yaml @@ -0,0 +1,30 @@ +- op: add + path: /spec/template/metadata/annotations + value: + dapr.io/enabled: "true" + dapr.io/app-id: "staging-atlantis" + dapr.io/app-port: "8000" + dapr.io/config: "tracing" +- op: replace + path: /spec/template/spec/containers/0/env/0 + value: + name: LOG_LEVEL + value: "4" +- op: add + path: /spec/template/spec/containers/0/env/- + value: + name: BARENTSWATCH_SECRET + valueFrom: + secretKeyRef: + name: staging-atlantis-barentswatch + key: secret + optional: true +- op: add + path: /spec/template/spec/containers/0/env/- + value: + name: BARENTSWATCH_CLIENT_ID + valueFrom: + secretKeyRef: + name: staging-atlantis-barentswatch + key: client-id + optional: true \ No newline at end of file diff --git a/atlantis/staging/kustomization.yaml b/atlantis/staging/kustomization.yaml new file mode 100644 index 00000000..d8020684 --- /dev/null +++ b/atlantis/staging/kustomization.yaml @@ -0,0 +1,16 @@ +namePrefix: staging- +generatorOptions: + disableNameSuffixHash: true +secretGenerator: + - name: atlantis-appsettings + files: + - appsettings.json +patches: + - target: + group: apps + version: v1 + kind: Deployment + name: atlantis + path: deployment_patch.yaml +resources: + - ../base \ No newline at end of file