diff --git a/aws/apps/didymosxr/didymosxr-mongo-db.yaml b/aws/apps/didymosxr/didymosxr-mongo-db.yaml new file mode 100644 index 00000000..687425af --- /dev/null +++ b/aws/apps/didymosxr/didymosxr-mongo-db.yaml @@ -0,0 +1,18 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: didymosxr-mongo-db + namespace: argocd +spec: + destination: + namespace: didymosxr + server: https://kubernetes.default.svc + project: default + source: + path: aws/didymosxr/mongodb + repoURL: https://github.com/FIWARE-Ops/fiware-gitops + targetRevision: HEAD + syncPolicy: + automated: + prune: true + selfHeal: true \ No newline at end of file diff --git a/aws/apps/didymosxr/didymosxr-nginx.yaml b/aws/apps/didymosxr/didymosxr-nginx.yaml new file mode 100644 index 00000000..ea8bf6bc --- /dev/null +++ b/aws/apps/didymosxr/didymosxr-nginx.yaml @@ -0,0 +1,18 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: didymosxr-nginx + namespace: argocd +spec: + destination: + namespace: didymosxr + server: https://kubernetes.default.svc + project: default + source: + path: aws/didymosxr/nginx + repoURL: https://github.com/FIWARE-Ops/fiware-gitops + targetRevision: HEAD + syncPolicy: + automated: + prune: true + selfHeal: true \ No newline at end of file diff --git a/aws/apps/didymosxr/didymosxr-orion-ld.yaml b/aws/apps/didymosxr/didymosxr-orion-ld.yaml new file mode 100644 index 00000000..fea636a0 --- /dev/null +++ b/aws/apps/didymosxr/didymosxr-orion-ld.yaml @@ -0,0 +1,18 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: didymosxr-orion-ld + namespace: argocd +spec: + destination: + namespace: didymosxr + server: https://kubernetes.default.svc + project: default + source: + path: aws/didymosxr/orion-ld + repoURL: https://github.com/FIWARE-Ops/fiware-gitops + targetRevision: HEAD + syncPolicy: + automated: + prune: true + selfHeal: true \ No newline at end of file diff --git a/aws/didymosxr/mongodb/Chart.yaml b/aws/didymosxr/mongodb/Chart.yaml new file mode 100644 index 00000000..beae826e --- /dev/null +++ b/aws/didymosxr/mongodb/Chart.yaml @@ -0,0 +1,12 @@ +apiVersion: v2 +name: mongo-db-didymosxr +description: Chart holder for argo-cd + +type: application +version: 0.1.0 +appVersion: "4.4.12" + +dependencies: +- name: mongodb + version: 11.0.4 + repository: https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami \ No newline at end of file diff --git a/aws/didymosxr/mongodb/values.yaml b/aws/didymosxr/mongodb/values.yaml new file mode 100644 index 00000000..cda7c4bb --- /dev/null +++ b/aws/didymosxr/mongodb/values.yaml @@ -0,0 +1,17 @@ +mongodb: + auth: + enabled: true + existingSecret: mongodb-secret + + architecture: standalone + podSecurityContext: + enabled: false + containerSecurityContext: + enabled: false + resources: + limits: + cpu: 200m + memory: 512Mi + persistence: + enabled: true + size: 8Gi diff --git a/aws/didymosxr/nginx/Chart.yaml b/aws/didymosxr/nginx/Chart.yaml new file mode 100644 index 00000000..f8752162 --- /dev/null +++ b/aws/didymosxr/nginx/Chart.yaml @@ -0,0 +1,12 @@ +apiVersion: v2 +name: nginx-didymosxr +description: Chart holder for argo-cd + +type: application +version: 0.1.0 +appVersion: "4.4.12" + +dependencies: +- name: nginx + version: 18.1.5 + repository: https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami \ No newline at end of file diff --git a/aws/didymosxr/nginx/templates/_helpers.tpl b/aws/didymosxr/nginx/templates/_helpers.tpl new file mode 100644 index 00000000..d254380a --- /dev/null +++ b/aws/didymosxr/nginx/templates/_helpers.tpl @@ -0,0 +1,51 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "nginx.name" -}} +{{- default .Chart.Name .Values.nginx.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 "nginx.fullname" -}} +{{- if .Values.nginx.fullnameOverride }} +{{- .Values.nginx.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nginx.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 "nginx.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "nginx.labels" -}} +helm.sh/chart: {{ include "nginx.chart" . }} +{{ include "nginx.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "nginx.selectorLabels" -}} +app.kubernetes.io/name: {{ include "nginx.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} diff --git a/aws/didymosxr/nginx/templates/route.yaml b/aws/didymosxr/nginx/templates/route.yaml new file mode 100644 index 00000000..96cbacbb --- /dev/null +++ b/aws/didymosxr/nginx/templates/route.yaml @@ -0,0 +1,25 @@ +{{- if .Values.nginx.route.enabled -}} +{{- $fullName := include "nginx.fullname" . -}} +apiVersion: route.openshift.io/v1 +kind: Route +metadata: + name: {{ include "nginx.fullname" . }} + labels: + {{ include "nginx.labels" . | nindent 4 }} + annotations: + cert-utils-operator.redhat-cop.io/certs-from-secret: {{ include "nginx.fullname" . }}-tls-sec + {{- with .Values.nginx.route.annotations }} + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + host: {{ .Values.nginx.route.host }} + to: + kind: Service + name: {{ include "nginx.fullname" . }} + {{- if .Values.nginx.route.tls }} + tls: + {{- with .Values.nginx.route.tls }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/aws/didymosxr/nginx/values.yaml b/aws/didymosxr/nginx/values.yaml new file mode 100644 index 00000000..6763a764 --- /dev/null +++ b/aws/didymosxr/nginx/values.yaml @@ -0,0 +1,28 @@ +nginx: + fullnameOverride: didymosxr-nginx + service: + type: ClusterIP + route: + enabled: true + host: broker.didymosxr.fiware.dev + tls: + insecureEdgeTerminationPolicy: Redirect + termination: edge + certificate: + issuer: + kind: ClusterIssuer + name: letsencrypt-aws-prod + + serverBlock: |- + server { + listen 0.0.0.0:8080; + location /* { + return 200 "hello!"; + } + location /ngsi-ld/ { + limit_except GET { + deny all; + } + proxy_pass http://didymosxr-orion-ld:1026/ngsi-ld/; + } + } diff --git a/aws/didymosxr/orion-ld/Chart.yaml b/aws/didymosxr/orion-ld/Chart.yaml new file mode 100644 index 00000000..99d63541 --- /dev/null +++ b/aws/didymosxr/orion-ld/Chart.yaml @@ -0,0 +1,12 @@ +apiVersion: v2 +name: orion-ld +description: Chart holder for argo-cd + +type: application +version: 0.1.0 +appVersion: "1.0.1" + +dependencies: +- name: orion + version: 1.1.0 + repository: https://fiware.github.io/helm-charts \ No newline at end of file diff --git a/aws/didymosxr/orion-ld/values.yaml b/aws/didymosxr/orion-ld/values.yaml new file mode 100644 index 00000000..7e0740f8 --- /dev/null +++ b/aws/didymosxr/orion-ld/values.yaml @@ -0,0 +1,19 @@ +orion: + deployment: + additionalAnnotations: + prometheus.io/scrape: 'true' + prometheus.io/port: '8000' + broker: + db: + auth: + user: root + mech: "SCRAM-SHA-1" + hosts: + - didymosxr-mongo-db-mongodb + user: root + existingSecret: + name: mongodb-secret + key: mongodb-root-password + mongo: + # we want to use the individually deployed mongodb + enabled: false diff --git a/aws/namespaces/didymosxr.yaml b/aws/namespaces/didymosxr.yaml new file mode 100644 index 00000000..ee739375 --- /dev/null +++ b/aws/namespaces/didymosxr.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: didymosxr