diff --git a/helm/ingress.yaml b/helm/ingress.yaml new file mode 100644 index 0000000..27fac8c --- /dev/null +++ b/helm/ingress.yaml @@ -0,0 +1,46 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: my-ingress + annotations: + kubernetes.io/ingress.class: "gce" + kubernetes.io/ingress.allow-http: "false" +spec: + rules: + - http: + paths: + - path: /public + pathType: Prefix + backend: + service: + name: api-service + port: + number: 3000 + - path: /private + pathType: Prefix + backend: + service: + name: api-service + port: + number: 4000 + - path: /caching + pathType: Prefix + backend: + service: + name: api-service + port: + number: 5201 + - path: /grafana + pathType: Prefix + backend: + service: + name: grafana-service + port: + number: 3010 + - path: /prometheus + pathType: Prefix + backend: + service: + name: prometheus-service + port: + number: 9090 \ No newline at end of file diff --git a/helm/mx-app/.helmignore b/helm/mx-app/.helmignore deleted file mode 100644 index 0e8a0eb..0000000 --- a/helm/mx-app/.helmignore +++ /dev/null @@ -1,23 +0,0 @@ -# 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 -*.orig -*~ -# Various IDEs -.project -.idea/ -*.tmproj -.vscode/ diff --git a/helm/mx-app/Chart.yaml b/helm/mx-app/Chart.yaml deleted file mode 100644 index 332b903..0000000 --- a/helm/mx-app/Chart.yaml +++ /dev/null @@ -1,24 +0,0 @@ -apiVersion: v2 -name: mx-app -description: A Helm chart for Kubernetes - -# 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. -# Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.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. Versions are not expected to -# follow Semantic Versioning. They should reflect the version the application is using. -# It is recommended to use it with quotes. -appVersion: "1.16.0" diff --git a/helm/mx-app/grafana-dashboards-configmap.yaml b/helm/mx-app/grafana-dashboards-configmap.yaml deleted file mode 100644 index 8d91c1c..0000000 --- a/helm/mx-app/grafana-dashboards-configmap.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: grafana-dashboards - labels: - app: grafana -data: - prometheus.yaml: | -{{ .Files.Get "../../../monitoring/grafana/dashboards/prometheus.yml" | indent 2 }} - template_service_dashboard.json: | -{{ .Files.Get "../../../monitoring/grafana/dashboards/template_service_dashboard.json" | indent 2 }} \ No newline at end of file diff --git a/helm/mx-app/grafana-datasource-configmap.yaml b/helm/mx-app/grafana-datasource-configmap.yaml deleted file mode 100644 index 7fb610a..0000000 --- a/helm/mx-app/grafana-datasource-configmap.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: grafana-datasource - labels: - app: grafana -data: - prometheus.yaml: | -{{ .Files.Get "../../../monitoring/grafana/datasources/prometheus.yml" | indent 2 }} \ No newline at end of file diff --git a/helm/mx-app/grafana-deployment.yaml b/helm/mx-app/grafana-deployment.yaml deleted file mode 100644 index f20b2a0..0000000 --- a/helm/mx-app/grafana-deployment.yaml +++ /dev/null @@ -1,34 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: grafana -spec: - replicas: 1 - selector: - matchLabels: - app: grafana - template: - metadata: - labels: - app: grafana - spec: - containers: - - name: grafana - image: grafana/grafana - env: - - name: GF_SECURITY_ADMIN_PASSWORD - value: {{ .Values.grafana.adminPassword }} - - name: GF_SECURITY_ADMIN_USER - value: {{ .Values.grafana.adminUser }} - volumeMounts: - - name: datasource-volume - mountPath: /etc/grafana/provisioning/datasources - - name: dashboard-volume - mountPath: /etc/grafana/provisioning/dashboards - volumes: - - name: datasource-volume - configMap: - name: grafana-datasource - - name: dashboard-volume - configMap: - name: grafana-dashboards \ No newline at end of file diff --git a/helm/mx-app/prometheus-configmap.yaml b/helm/mx-app/prometheus-configmap.yaml deleted file mode 100644 index 940fcc7..0000000 --- a/helm/mx-app/prometheus-configmap.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: prometheus-config - labels: - app: prometheus -data: - prometheus.yaml: | -{{ .Files.Get "../../../monitoring/prometheus/prometheus.yml" | indent 2 }} \ No newline at end of file diff --git a/helm/mx-app/prometheus-deployment.yaml b/helm/mx-app/prometheus-deployment.yaml deleted file mode 100644 index e15d369..0000000 --- a/helm/mx-app/prometheus-deployment.yaml +++ /dev/null @@ -1,26 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: prometheus -spec: - replicas: 1 - selector: - matchLabels: - app: prometheus - template: - metadata: - labels: - app: prometheus - spec: - containers: - - name: prometheus - image: prom/prometheus - args: - - "--config.file=/etc/prometheus/prometheus.yaml" - volumeMounts: - - name: config-volume - mountPath: /etc/prometheus - volumes: - - name: config-volume - configMap: - name: prometheus-config \ No newline at end of file diff --git a/helm/mx-app/templates/NOTES.txt b/helm/mx-app/templates/NOTES.txt deleted file mode 100644 index cecf36c..0000000 --- a/helm/mx-app/templates/NOTES.txt +++ /dev/null @@ -1,22 +0,0 @@ -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 "mx-app.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 "mx-app.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "mx-app.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 "mx-app.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/helm/mx-app/templates/_helpers.tpl b/helm/mx-app/templates/_helpers.tpl deleted file mode 100644 index ade4fb5..0000000 --- a/helm/mx-app/templates/_helpers.tpl +++ /dev/null @@ -1,62 +0,0 @@ -{{/* -Expand the name of the chart. -*/}} -{{- define "mx-app.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 "mx-app.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 "mx-app.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Common labels -*/}} -{{- define "mx-app.labels" -}} -helm.sh/chart: {{ include "mx-app.chart" . }} -{{ include "mx-app.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} - -{{/* -Selector labels -*/}} -{{- define "mx-app.selectorLabels" -}} -app.kubernetes.io/name: {{ include "mx-app.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} - -{{/* -Create the name of the service account to use -*/}} -{{- define "mx-app.serviceAccountName" -}} -{{- if .Values.serviceAccount.create }} -{{- default (include "mx-app.fullname" .) .Values.serviceAccount.name }} -{{- else }} -{{- default "default" .Values.serviceAccount.name }} -{{- end }} -{{- end }} diff --git a/helm/mx-app/templates/deployment.yaml b/helm/mx-app/templates/deployment.yaml deleted file mode 100644 index d4a9376..0000000 --- a/helm/mx-app/templates/deployment.yaml +++ /dev/null @@ -1,68 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "mx-app.fullname" . }} - labels: - {{- include "mx-app.labels" . | nindent 4 }} -spec: - {{- if not .Values.autoscaling.enabled }} - replicas: {{ .Values.replicaCount }} - {{- end }} - selector: - matchLabels: - {{- include "mx-app.selectorLabels" . | nindent 6 }} - template: - metadata: - {{- with .Values.podAnnotations }} - annotations: - {{- toYaml . | nindent 8 }} - {{- end }} - labels: - {{- include "mx-app.labels" . | nindent 8 }} - {{- with .Values.podLabels }} - {{- toYaml . | nindent 8 }} - {{- end }} - spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - serviceAccountName: {{ include "mx-app.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 - livenessProbe: - {{- toYaml .Values.livenessProbe | nindent 12 }} - readinessProbe: - {{- toYaml .Values.readinessProbe | nindent 12 }} - resources: - {{- toYaml .Values.resources | nindent 12 }} - {{- with .Values.volumeMounts }} - volumeMounts: - {{- toYaml . | nindent 12 }} - {{- end }} - {{- with .Values.volumes }} - volumes: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- 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/helm/mx-app/templates/hpa.yaml b/helm/mx-app/templates/hpa.yaml deleted file mode 100644 index 11ea7f3..0000000 --- a/helm/mx-app/templates/hpa.yaml +++ /dev/null @@ -1,32 +0,0 @@ -{{- if .Values.autoscaling.enabled }} -apiVersion: autoscaling/v2 -kind: HorizontalPodAutoscaler -metadata: - name: {{ include "mx-app.fullname" . }} - labels: - {{- include "mx-app.labels" . | nindent 4 }} -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: {{ include "mx-app.fullname" . }} - minReplicas: {{ .Values.autoscaling.minReplicas }} - maxReplicas: {{ .Values.autoscaling.maxReplicas }} - metrics: - {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - target: - type: Utilization - averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} - {{- end }} - {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - - type: Resource - resource: - name: memory - target: - type: Utilization - averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} - {{- end }} -{{- end }} diff --git a/helm/mx-app/templates/ingress.yaml b/helm/mx-app/templates/ingress.yaml deleted file mode 100644 index 59ca983..0000000 --- a/helm/mx-app/templates/ingress.yaml +++ /dev/null @@ -1,61 +0,0 @@ -{{- if .Values.ingress.enabled -}} -{{- $fullName := include "mx-app.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 "mx-app.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/helm/mx-app/templates/service.yaml b/helm/mx-app/templates/service.yaml deleted file mode 100644 index 597ce8a..0000000 --- a/helm/mx-app/templates/service.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ include "mx-app.fullname" . }} - labels: - {{- include "mx-app.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} - ports: - - port: {{ .Values.service.port }} - targetPort: http - protocol: TCP - name: http - selector: - {{- include "mx-app.selectorLabels" . | nindent 4 }} diff --git a/helm/mx-app/templates/serviceaccount.yaml b/helm/mx-app/templates/serviceaccount.yaml deleted file mode 100644 index 7173cd8..0000000 --- a/helm/mx-app/templates/serviceaccount.yaml +++ /dev/null @@ -1,13 +0,0 @@ -{{- if .Values.serviceAccount.create -}} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "mx-app.serviceAccountName" . }} - labels: - {{- include "mx-app.labels" . | nindent 4 }} - {{- with .Values.serviceAccount.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -automountServiceAccountToken: {{ .Values.serviceAccount.automount }} -{{- end }} diff --git a/helm/mx-app/templates/tests/test-connection.yaml b/helm/mx-app/templates/tests/test-connection.yaml deleted file mode 100644 index ed6fd76..0000000 --- a/helm/mx-app/templates/tests/test-connection.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: "{{ include "mx-app.fullname" . }}-test-connection" - labels: - {{- include "mx-app.labels" . | nindent 4 }} - annotations: - "helm.sh/hook": test -spec: - containers: - - name: wget - image: busybox - command: ['wget'] - args: ['{{ include "mx-app.fullname" . }}:{{ .Values.service.port }}'] - restartPolicy: Never diff --git a/helm/mx-app/values.yaml b/helm/mx-app/values.yaml deleted file mode 100644 index dfd31d4..0000000 --- a/helm/mx-app/values.yaml +++ /dev/null @@ -1,107 +0,0 @@ -# Default values for mx-app. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -replicaCount: 1 - -image: - repository: nginx - pullPolicy: IfNotPresent - # Overrides the image tag whose default is the chart appVersion. - tag: "" - -imagePullSecrets: [] -nameOverride: "" -fullnameOverride: "" - -serviceAccount: - # Specifies whether a service account should be created - create: true - # Automatically mount a ServiceAccount's API credentials? - automount: 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: {} -podLabels: {} - -podSecurityContext: {} - # fsGroup: 2000 - -securityContext: {} - # capabilities: - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 - -service: - type: ClusterIP - port: 80 - -ingress: - enabled: false - className: "" - annotations: {} - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - hosts: - - host: chart-example.local - paths: - - path: / - pathType: ImplementationSpecific - tls: [] - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - -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 - -livenessProbe: - httpGet: - path: / - port: http -readinessProbe: - httpGet: - path: / - port: http - -autoscaling: - enabled: false - minReplicas: 1 - maxReplicas: 100 - targetCPUUtilizationPercentage: 80 - # targetMemoryUtilizationPercentage: 80 - -# Additional volumes on the output Deployment definition. -volumes: [] -# - name: foo -# secret: -# secretName: mysecret -# optional: false - -# Additional volumeMounts on the output Deployment definition. -volumeMounts: [] -# - name: foo -# mountPath: "/etc/foo" -# readOnly: true - -nodeSelector: {} - -tolerations: [] - -affinity: {} diff --git a/helm/mx-challenge-app/Chart.yaml b/helm/mx-challenge-app/Chart.yaml index 94d15b0..ed9bed2 100644 --- a/helm/mx-challenge-app/Chart.yaml +++ b/helm/mx-challenge-app/Chart.yaml @@ -1,4 +1,4 @@ -apiVersion: v2 +apiVersion: v1 name: mx-challenge-app description: A Helm chart for Kubernetes @@ -21,7 +21,7 @@ version: 0.1.0 # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: '1.16.0' +appVersion: '1.0.0' dependencies: - name: mongodb diff --git a/helm/mx-challenge-app/dashboards/transactions.json b/helm/mx-challenge-app/dashboards/transactions.json index 5fbba56..fd373bd 100644 --- a/helm/mx-challenge-app/dashboards/transactions.json +++ b/helm/mx-challenge-app/dashboards/transactions.json @@ -24,7 +24,7 @@ { "datasource": { "type": "prometheus", - "uid": "edm4w08oxb56of" + "uid": "PBFA97CFB590B2093" }, "fieldConfig": { "defaults": { @@ -39,7 +39,7 @@ "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "bars", - "fillOpacity": 18, + "fillOpacity": 11, "gradientMode": "none", "hideFrom": { "legend": false, @@ -97,7 +97,7 @@ ] }, "gridPos": { - "h": 17, + "h": 19, "w": 22, "x": 0, "y": 0 @@ -119,7 +119,7 @@ { "datasource": { "type": "prometheus", - "uid": "edm4w08oxb56of" + "uid": "PBFA97CFB590B2093" }, "disableTextWrap": false, "editorMode": "builder", @@ -133,7 +133,7 @@ "useBackend": false } ], - "title": "Transactions [6s]", + "title": "Panel Title", "transformations": [ { "id": "calculateField", @@ -150,13 +150,13 @@ "list": [] }, "time": { - "from": "now-15m", + "from": "now-6h", "to": "now" }, "timepicker": {}, "timezone": "browser", - "title": "transactions", - "uid": "ddm4xlmzwit4we", + "title": "Transactions", + "uid": "adm85vxn5hdkwf", "version": 1, "weekStart": "" } \ No newline at end of file diff --git a/helm/mx-challenge-app/mx-challenge-app-0.1.0.tgz b/helm/mx-challenge-app/mx-challenge-app-0.1.0.tgz new file mode 100644 index 0000000..36daeb5 Binary files /dev/null and b/helm/mx-challenge-app/mx-challenge-app-0.1.0.tgz differ diff --git a/helm/mx-challenge-app/templates/api/deployment.yaml b/helm/mx-challenge-app/templates/api/deployment.yaml index ebf9590..39072e1 100644 --- a/helm/mx-challenge-app/templates/api/deployment.yaml +++ b/helm/mx-challenge-app/templates/api/deployment.yaml @@ -26,7 +26,6 @@ spec: env: - name: NODE_ENV value: 'production' - - name: MONGODB_URI - name: NODE_ENV value: 'production' - name: NOSQL_HOST diff --git a/helm/mx-challenge-app/templates/api/service.yaml b/helm/mx-challenge-app/templates/api/service.yaml new file mode 100644 index 0000000..97a6283 --- /dev/null +++ b/helm/mx-challenge-app/templates/api/service.yaml @@ -0,0 +1,21 @@ +apiVersion: v1 +kind: Service +metadata: + name: api-service +spec: + type: LoadBalancer + selector: + app: api + ports: + - name: private-api + protocol: TCP + port: 4000 + targetPort: 4000 + - name: public-api + protocol: TCP + port: 80 + targetPort: 3000 + - name: websocket + protocol: TCP + port: 3005 + targetPort: 3005 \ No newline at end of file diff --git a/helm/mx-challenge-app/templates/cache-warmer/service.yaml b/helm/mx-challenge-app/templates/cache-warmer/service.yaml new file mode 100644 index 0000000..0223f2e --- /dev/null +++ b/helm/mx-challenge-app/templates/cache-warmer/service.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Service +metadata: + name: cache-warmer-service +spec: + type: LoadBalancer + selector: + app: cache-warmer + ports: + - name: cache-warmer + protocol: TCP + port: 5201 + targetPort: 5201 \ No newline at end of file diff --git a/helm/mx-challenge-app/templates/grafana-dashboards-configmap.yaml b/helm/mx-challenge-app/templates/grafana-dashboards-configmap.yaml new file mode 100644 index 0000000..bd5304f --- /dev/null +++ b/helm/mx-challenge-app/templates/grafana-dashboards-configmap.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: grafana-dashboards + labels: + app: grafana + grafana_dashboard: "1" +data: + transactions.json: | +{{ .Files.Get "dashboards/transactions.json" | indent 4 }} + template_service_dashboard.json: | +{{ .Files.Get "dashboards/template_service_dashboard.json" | indent 4 }} diff --git a/helm/mx-challenge-app/templates/grafana-datasource-configmap.yaml b/helm/mx-challenge-app/templates/grafana-datasource-configmap.yaml deleted file mode 100644 index eba7a8f..0000000 --- a/helm/mx-challenge-app/templates/grafana-datasource-configmap.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: grafana-datasource - labels: - app: grafana -data: - prometheus.yaml: | - apiVersion: 1 - datasources: - - name: 'Prometheus' - type: 'prometheus' - access: 'proxy' - url: 'http://mx-challenge-app-prometheus-server:9090' - isDefault: true \ No newline at end of file diff --git a/helm/mx-challenge-app/templates/queue-worker/service b/helm/mx-challenge-app/templates/queue-worker/service new file mode 100644 index 0000000..8016528 --- /dev/null +++ b/helm/mx-challenge-app/templates/queue-worker/service @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Service +metadata: + name: queue-worker-service +spec: + type: LoadBalancer + selector: + app: queue-worker + ports: + - name: queue-worker + protocol: TCP + port: 8000 + targetPort: 8000 \ No newline at end of file diff --git a/helm/mx-challenge-app/templates/transactions-processor/deployment.yaml.old b/helm/mx-challenge-app/templates/transactions-processor/deployment.yaml similarity index 100% rename from helm/mx-challenge-app/templates/transactions-processor/deployment.yaml.old rename to helm/mx-challenge-app/templates/transactions-processor/deployment.yaml diff --git a/helm/mx-challenge-app/templates/transactions-processor/service.yaml b/helm/mx-challenge-app/templates/transactions-processor/service.yaml new file mode 100644 index 0000000..4c7805d --- /dev/null +++ b/helm/mx-challenge-app/templates/transactions-processor/service.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Service +metadata: + name: transactions-processor-service +spec: + type: LoadBalancer + selector: + app: transactions-processor + ports: + - name: transactions-processor + protocol: TCP + port: 5202 + targetPort: 5202 diff --git a/helm/mx-challenge-app/values.yaml b/helm/mx-challenge-app/values.yaml index ae51774..9b4468b 100644 --- a/helm/mx-challenge-app/values.yaml +++ b/helm/mx-challenge-app/values.yaml @@ -1,3 +1,20 @@ +apiVersion: v1 +kind: Config + +urls: + api: 'https://api.multiversx.com' + swagger: + - 'https://microservice.multiversx.com' + - 'https://devnet-microservice.multiversx.com' + - 'https://testnet-microservice.multiversx.com' + redis: 'mx-challenge-app-redis-headless' +database: + host: 'mx-challenge-app-mysql-headless' + port: 3306 + username: 'root' + password: 'root' + name: 'example' + redis: architecture: standalone image: @@ -29,6 +46,7 @@ prometheus: enabled: false nodeExporter: enabled: false + server: global: scrape_interval: 6s @@ -39,12 +57,18 @@ prometheus: metrics_path: /metrics static_configs: - targets: ['api:4000'] + service: + type: LoadBalancer + servicePort: 9090 grafana: service: - type: NodePort + type: LoadBalancer + port: 3010 + targetPort: 3000 adminUser: admin adminPassword: admin + dashboardProviders: dashboardproviders.yaml: apiVersion: 1 @@ -56,11 +80,10 @@ grafana: disableDeletion: false editable: true options: - path: /var/lib/grafana/dashboards/default - dashboards: - default: - transactions-dashboard: - file: /var/lib/grafana/dashboards/default/transactions-dashboard.json + path: '/var/lib/grafana/dashboards/default' + dashboardsConfigMaps: + default: "grafana-dashboards" + datasources: prometheus.yaml: apiVersion: 1 @@ -68,19 +91,5 @@ grafana: - name: 'Prometheus' type: 'prometheus' access: 'proxy' - url: 'http://mx-challenge-app-prometheus-server' + url: 'http://mx-challenge-app-prometheus-server:9090' isDefault: true - -urls: - api: 'https://api.multiversx.com' - swagger: - - 'https://microservice.multiversx.com' - - 'https://devnet-microservice.multiversx.com' - - 'https://testnet-microservice.multiversx.com' - redis: 'mx-challenge-app-redis-headless' -database: - host: 'mx-challenge-app-mysql-headless' - port: 3306 - username: 'root' - password: 'root' - name: 'example'