diff --git a/artifacts/argocd-apps/grafana-operator-app/Chart.yaml b/artifacts/argocd-apps/grafana-operator-app/Chart.yaml new file mode 100644 index 0000000..8a00c37 --- /dev/null +++ b/artifacts/argocd-apps/grafana-operator-app/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v1 +appVersion: "1.0" +name: grafana-operator-application +description: App of apps chart for the Grafana Operator. +version: 1.0.0 diff --git a/artifacts/argocd-apps/grafana-operator-app/templates/grafana-operator-app.yaml b/artifacts/argocd-apps/grafana-operator-app/templates/grafana-operator-app.yaml new file mode 100644 index 0000000..d255988 --- /dev/null +++ b/artifacts/argocd-apps/grafana-operator-app/templates/grafana-operator-app.yaml @@ -0,0 +1,24 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: grafana-operator-app + namespace: {{ .Values.argoNamespace | default "argocd" }} + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + project: {{ .Values.argoProject | default "default" }} + destination: + namespace: grafana-operator + server: {{ .Values.spec.destination.server }} + source: + repoURL: {{ .Values.spec.source.repoURL }} + targetRevision: {{ .Values.spec.source.targetRevision }} + path: artifacts/argocd-apps/grafana-operator-chart + helm: + values: | + {{- toYaml .Values | nindent 8 }} + syncPolicy: + automated: + prune: true + syncOptions: + - CreateNamespace=true diff --git a/artifacts/argocd-apps/grafana-operator-app/values.yaml b/artifacts/argocd-apps/grafana-operator-app/values.yaml new file mode 100644 index 0000000..c48fa69 --- /dev/null +++ b/artifacts/argocd-apps/grafana-operator-app/values.yaml @@ -0,0 +1,25 @@ +argoNamespace: '' +argoProject: '' + +spec: + destination: + server: https://kubernetes.default.svc + source: + repoURL: https://github.com/iamprakkie/aws-observability-accelerator.git + targetRevision: artifacts + +AMP_ASSUME_ROLE_ARN: 'UPDATE_ME_WITH_AMP_ASSUME_ROLE_ARN' +AMP_AWS_REGION: 'UPDATE_ME_WITH_AMP_AWS_REGION' +AMP_ENDPOINT_URL: 'UPDATE_ME_WITH_AMP_ENDPOINT_URL' + +CW_ASSUME_ROLE_ARN: 'UPDATE_ME_WITH_CW_ASSUME_ROLE_ARN' +CW_AWS_REGION: 'UPDATE_ME_WITH_CW_AWS_REGION' + +AMG_ENDPOINT_URL: 'UPDATE_ME_WITH_AMG_ENDPOINT_URL_STARTING_WITH_HTTPS' + +GRAFANA_CLUSTER_DASH_URL: "https://raw.githubusercontent.com/aws-observability/aws-observability-accelerator/main/artifacts/grafana-dashboards/eks/infrastructure/cluster.json" +GRAFANA_KUBELET_DASH_URL: "https://raw.githubusercontent.com/aws-observability/aws-observability-accelerator/main/artifacts/grafana-dashboards/eks/infrastructure/kubelet.json" +GRAFANA_NSWRKLDS_DASH_URL: "https://raw.githubusercontent.com/aws-observability/aws-observability-accelerator/main/artifacts/grafana-dashboards/eks/infrastructure/namespace-workloads.json" +GRAFANA_NODEEXP_DASH_URL: "https://raw.githubusercontent.com/aws-observability/aws-observability-accelerator/main/artifacts/grafana-dashboards/eks/infrastructure/nodeexporter-nodes.json" +GRAFANA_NODES_DASH_URL: "https://raw.githubusercontent.com/aws-observability/aws-observability-accelerator/main/artifacts/grafana-dashboards/eks/infrastructure/nodes.json" +GRAFANA_WORKLOADS_DASH_URL: "https://raw.githubusercontent.com/aws-observability/aws-observability-accelerator/main/artifacts/grafana-dashboards/eks/infrastructure/workloads.json" diff --git a/artifacts/argocd-apps/grafana-operator-chart/.helmignore b/artifacts/argocd-apps/grafana-operator-chart/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/artifacts/argocd-apps/grafana-operator-chart/.helmignore @@ -0,0 +1,23 @@ +# 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/artifacts/argocd-apps/grafana-operator-chart/Chart.yaml b/artifacts/argocd-apps/grafana-operator-chart/Chart.yaml new file mode 100644 index 0000000..147e85d --- /dev/null +++ b/artifacts/argocd-apps/grafana-operator-chart/Chart.yaml @@ -0,0 +1,21 @@ +apiVersion: v2 +name: grafana-operator-chart +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: 1.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. 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.0.0" diff --git a/artifacts/argocd-apps/grafana-operator-chart/templates/amg_grafana-amp-datasource.yaml b/artifacts/argocd-apps/grafana-operator-chart/templates/amg_grafana-amp-datasource.yaml new file mode 100644 index 0000000..37124d8 --- /dev/null +++ b/artifacts/argocd-apps/grafana-operator-chart/templates/amg_grafana-amp-datasource.yaml @@ -0,0 +1,24 @@ +apiVersion: grafana.integreatly.org/v1beta1 +kind: GrafanaDatasource +metadata: + name: grafanadatasource-amp + namespace: grafana-operator +spec: + instanceSelector: + matchLabels: + dashboards: "external-grafana" + datasource: + name: grafana-operator-amp-datasource + type: prometheus + access: proxy + url: {{ .Values.AMP_ENDPOINT_URL }} + isDefault: true + jsonData: + 'tlsSkipVerify': false + 'timeInterval': "5s" + 'sigV4Auth': true + 'sigV4AuthType': "ec2_iam_role" + 'sigV4AssumeRoleArn': {{ .Values.AMP_ASSUME_ROLE_ARN }} + 'sigV4Region': {{ .Values.AMP_AWS_REGION }} + 'defaultRegion': {{ .Values.AMP_AWS_REGION }} + editable: true diff --git a/artifacts/argocd-apps/grafana-operator-chart/templates/amg_grafana-cw-datasource.yaml b/artifacts/argocd-apps/grafana-operator-chart/templates/amg_grafana-cw-datasource.yaml new file mode 100644 index 0000000..d9bbec0 --- /dev/null +++ b/artifacts/argocd-apps/grafana-operator-chart/templates/amg_grafana-cw-datasource.yaml @@ -0,0 +1,21 @@ +apiVersion: grafana.integreatly.org/v1beta1 +kind: GrafanaDatasource +metadata: + name: grafanadatasource-cw + namespace: grafana-operator +spec: + instanceSelector: + matchLabels: + dashboards: "external-grafana" + datasource: + name: grafana-operator-cloudwatch-datasource + type: cloudwatch + access: server + isDefault: false + jsonData: + 'tlsSkipVerify': false + 'authType': "ec2_iam_role" + 'assumeRoleArn': {{ .Values.CW_ASSUME_ROLE_ARN }} + 'defaultRegion': {{ .Values.CW_AWS_REGION }} + 'customMetricsNamespaces': "ContainerInsights/Prometheus" + editable: true diff --git a/artifacts/argocd-apps/grafana-operator-chart/templates/amg_grafana-dashboard.yaml b/artifacts/argocd-apps/grafana-operator-chart/templates/amg_grafana-dashboard.yaml new file mode 100644 index 0000000..f9e8876 --- /dev/null +++ b/artifacts/argocd-apps/grafana-operator-chart/templates/amg_grafana-dashboard.yaml @@ -0,0 +1,71 @@ +apiVersion: grafana.integreatly.org/v1beta1 +kind: GrafanaDashboard +metadata: + name: node-exporter-grafanadashboard + namespace: grafana-operator +spec: + folder: "Observability Accelerator Dashboards" + instanceSelector: + matchLabels: + dashboards: "external-grafana" + url: {{ .Values.GRAFANA_NODEEXP_DASH_URL }} +--- +apiVersion: grafana.integreatly.org/v1beta1 +kind: GrafanaDashboard +metadata: + name: cluster-grafanadashboard + namespace: grafana-operator +spec: + folder: "Observability Accelerator Dashboards" + instanceSelector: + matchLabels: + dashboards: "external-grafana" + url: {{ .Values.GRAFANA_CLUSTER_DASH_URL }} +--- +apiVersion: grafana.integreatly.org/v1beta1 +kind: GrafanaDashboard +metadata: + name: kubelet-grafanadashboard + namespace: grafana-operator +spec: + folder: "Observability Accelerator Dashboards" + instanceSelector: + matchLabels: + dashboards: "external-grafana" + url: {{ .Values.GRAFANA_KUBELET_DASH_URL }} +--- +apiVersion: grafana.integreatly.org/v1beta1 +kind: GrafanaDashboard +metadata: + name: namespace-workloads-grafanadashboard + namespace: grafana-operator +spec: + folder: "Observability Accelerator Dashboards" + instanceSelector: + matchLabels: + dashboards: "external-grafana" + url: {{ .Values.GRAFANA_NSWRKLDS_DASH_URL }} +--- +apiVersion: grafana.integreatly.org/v1beta1 +kind: GrafanaDashboard +metadata: + name: nodes-grafanadashboard + namespace: grafana-operator +spec: + folder: "Observability Accelerator Dashboards" + instanceSelector: + matchLabels: + dashboards: "external-grafana" + url: {{ .Values.GRAFANA_NODES_DASH_URL }} +--- +apiVersion: grafana.integreatly.org/v1beta1 +kind: GrafanaDashboard +metadata: + name: workloads-grafanadashboard + namespace: grafana-operator +spec: + folder: "Observability Accelerator Dashboards" + instanceSelector: + matchLabels: + dashboards: "external-grafana" + url: {{ .Values.GRAFANA_WORKLOADS_DASH_URL }} diff --git a/artifacts/argocd-apps/grafana-operator-chart/templates/amg_grafana-identity.yaml b/artifacts/argocd-apps/grafana-operator-chart/templates/amg_grafana-identity.yaml new file mode 100644 index 0000000..b23e46e --- /dev/null +++ b/artifacts/argocd-apps/grafana-operator-chart/templates/amg_grafana-identity.yaml @@ -0,0 +1,13 @@ +apiVersion: grafana.integreatly.org/v1beta1 +kind: Grafana +metadata: + name: external-grafana + namespace: grafana-operator + labels: + dashboards: "external-grafana" +spec: + external: + url: {{ .Values.AMG_ENDPOINT_URL }} + apiKey: + name: grafana-admin-credentials + key: GF_SECURITY_ADMIN_APIKEY diff --git a/artifacts/argocd-apps/grafana-operator-chart/templates/amg_grafana-xray-datasource.yaml b/artifacts/argocd-apps/grafana-operator-chart/templates/amg_grafana-xray-datasource.yaml new file mode 100644 index 0000000..d74912d --- /dev/null +++ b/artifacts/argocd-apps/grafana-operator-chart/templates/amg_grafana-xray-datasource.yaml @@ -0,0 +1,20 @@ +apiVersion: grafana.integreatly.org/v1beta1 +kind: GrafanaDatasource +metadata: + name: grafanadatasource-xray + namespace: grafana-operator +spec: + instanceSelector: + matchLabels: + dashboards: "external-grafana" + datasource: + name: grafana-operator-xray-datasource + type: grafana-x-ray-datasource + access: server + isDefault: false + jsonData: + 'tlsSkipVerify': false + 'authType': "ec2_iam_role" + 'assumeRoleArn': {{ .Values.CW_ASSUME_ROLE_ARN }} + 'defaultRegion': {{ .Values.CW_AWS_REGION }} + editable: true diff --git a/artifacts/argocd-apps/grafana-operator-chart/values.yaml b/artifacts/argocd-apps/grafana-operator-chart/values.yaml new file mode 100644 index 0000000..e4779cd --- /dev/null +++ b/artifacts/argocd-apps/grafana-operator-chart/values.yaml @@ -0,0 +1 @@ +kubernetesClusterDomain: cluster.local diff --git a/artifacts/argocd-apps/sample-apps/envs/prod/Chart.yaml b/artifacts/argocd-apps/sample-apps/envs/prod/Chart.yaml new file mode 100644 index 0000000..7419ad1 --- /dev/null +++ b/artifacts/argocd-apps/sample-apps/envs/prod/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v1 +appVersion: "1.0" +name: prod-applications +description: App of apps chart for the prod EKS environment. +version: 1.0.0 diff --git a/artifacts/argocd-apps/sample-apps/envs/prod/templates/team-geordie.yaml b/artifacts/argocd-apps/sample-apps/envs/prod/templates/team-geordie.yaml new file mode 100644 index 0000000..87fb9a3 --- /dev/null +++ b/artifacts/argocd-apps/sample-apps/envs/prod/templates/team-geordie.yaml @@ -0,0 +1,26 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: team-geordie + namespace: {{ .Values.argoNamespace | default "argocd" }} + labels: + {{- toYaml .Values.labels | nindent 4 }} + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + project: {{ .Values.argoProject | default "default" }} + destination: + namespace: {{ .Values.argoNamespace | default "argocd" }} + server: {{ .Values.destinationServer | default .Values.spec.destination.server }} + source: + repoURL: {{ .Values.spec.source.repoURL }} + targetRevision: {{ .Values.spec.source.targetRevision }} + path: artifacts/argocd-apps/teams/team-geordie/prod + helm: + values: | + {{- toYaml .Values | nindent 8 }} + syncPolicy: + automated: + prune: true + syncOptions: + - CreateNamespace=true diff --git a/artifacts/argocd-apps/sample-apps/envs/prod/values.yaml b/artifacts/argocd-apps/sample-apps/envs/prod/values.yaml new file mode 100644 index 0000000..e3a5838 --- /dev/null +++ b/artifacts/argocd-apps/sample-apps/envs/prod/values.yaml @@ -0,0 +1,21 @@ +destinationServer: '' +argoNamespace: '' +argoProject: '' + +labels: + env: prod +spec: + destination: + server: https://kubernetes.default.svc + source: + repoURL: https://github.com/iamprakkie/aws-observability-accelerator.git + targetRevision: artifacts + + # Thoses default values can be surcharged by Infrastructure as Code + env: prod + clusterName: coa-eks-blueprint-cluster # the name of EKS cluster + blueprint: 'terraform' # cdk | terraform + karpenterInstanceProfile: + ingress: + type: 'alb' # nginx | alb + host: # empty or your domain like dev.example.com diff --git a/artifacts/argocd-apps/teams/team-geordie/prod/Chart.yaml b/artifacts/argocd-apps/teams/team-geordie/prod/Chart.yaml new file mode 100644 index 0000000..6b80150 --- /dev/null +++ b/artifacts/argocd-apps/teams/team-geordie/prod/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v1 +appVersion: "1.0" +name: monapps +description: Charts of Monitoring Apps for the prod EKS environment. +version: 0.1.0 diff --git a/artifacts/argocd-apps/teams/team-geordie/prod/ho11y/Chart.yaml b/artifacts/argocd-apps/teams/team-geordie/prod/ho11y/Chart.yaml new file mode 100644 index 0000000..b50d129 --- /dev/null +++ b/artifacts/argocd-apps/teams/team-geordie/prod/ho11y/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v1 +appVersion: "1.0" +name: ho11y +description: Charts of Monitoring Apps for the prod EKS environment. +version: 0.1.0 diff --git a/artifacts/argocd-apps/teams/team-geordie/prod/ho11y/templates/ho11y.yaml b/artifacts/argocd-apps/teams/team-geordie/prod/ho11y/templates/ho11y.yaml new file mode 100644 index 0000000..5156dfc --- /dev/null +++ b/artifacts/argocd-apps/teams/team-geordie/prod/ho11y/templates/ho11y.yaml @@ -0,0 +1,155 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: ho11y +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: frontend + namespace: geordie +spec: + selector: + matchLabels: + app: frontend + replicas: 1 + template: + metadata: + labels: + app: frontend + spec: + containers: + - name: ho11y + image: public.ecr.aws/z0a4o2j5/ho11y:latest + ports: + - containerPort: 8765 + env: + - name: DISABLE_OM + value: "on" + - name: HO11Y_LOG_DEST + value: "stdout" + - name: OTEL_RESOURCE_ATTRIB + value: "frontend" + - name: OTEL_EXPORTER_OTLP_ENDPOINT + value: "otel-collector-xray-collector.default.svc.cluster.local:4317" + - name: HO11Y_INJECT_FAILURE + value: "enabled" + - name: DOWNSTREAM0 + value: "http://downstream0" + - name: DOWNSTREAM1 + value: "http://downstream1" + imagePullPolicy: Always +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: downstream0 + namespace: geordie +spec: + selector: + matchLabels: + app: downstream0 + replicas: 1 + template: + metadata: + labels: + app: downstream0 + spec: + containers: + - name: ho11y + image: public.ecr.aws/mhausenblas/ho11y:stable + ports: + - containerPort: 8765 + env: + - name: DISABLE_OM + value: "on" + - name: HO11Y_LOG_DEST + value: "stdout" + - name: OTEL_RESOURCE_ATTRIB + value: "downstream0" + - name: OTEL_EXPORTER_OTLP_ENDPOINT + value: "otel-collector-xray-collector.default.svc.cluster.local:4317" + - name: DOWNSTREAM0 + value: "https://mhausenblas.info/" + imagePullPolicy: Always +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: downstream1 + namespace: geordie +spec: + selector: + matchLabels: + app: downstream1 + replicas: 1 + template: + metadata: + labels: + app: downstream1 + spec: + containers: + - name: ho11y + image: public.ecr.aws/mhausenblas/ho11y:stable + ports: + - containerPort: 8765 + env: + - name: DISABLE_OM + value: "on" + - name: HO11Y_LOG_DEST + value: "stdout" + - name: OTEL_RESOURCE_ATTRIB + value: "downstream1" + - name: OTEL_EXPORTER_OTLP_ENDPOINT + value: "otel-collector-xray-collector.default.svc.cluster.local:4317" + - name: DOWNSTREAM0 + value: "https://o11y.news/2021-03-01/" + - name: DOWNSTREAM1 + value: "DUMMY:187kB:42ms" + - name: DOWNSTREAM2 + value: "DUMMY:13kB:2ms" + imagePullPolicy: Always +--- +apiVersion: v1 +kind: Service +metadata: + name: frontend + namespace: geordie + annotations: + scrape: "true" +spec: + type: LoadBalancer + ports: + - port: 80 + targetPort: 8765 + selector: + app: frontend +--- +apiVersion: v1 +kind: Service +metadata: + name: downstream0 + namespace: geordie + annotations: + scrape: "true" +spec: + ports: + - port: 80 + targetPort: 8765 + selector: + app: downstream0 +--- +apiVersion: v1 +kind: Service +metadata: + name: downstream1 + namespace: geordie + annotations: + scrape: "true" +spec: + ports: + - port: 80 + targetPort: 8765 + selector: + app: downstream1 +--- diff --git a/artifacts/argocd-apps/teams/team-geordie/prod/ho11y/templates/ingress.yaml b/artifacts/argocd-apps/teams/team-geordie/prod/ho11y/templates/ingress.yaml new file mode 100644 index 0000000..60913a6 --- /dev/null +++ b/artifacts/argocd-apps/teams/team-geordie/prod/ho11y/templates/ingress.yaml @@ -0,0 +1,49 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + namespace: geordie + name: ho11y-ingress + annotations: +{{ if eq .Values.spec.ingress.type "alb" }} + #rewrite does not exist yet in ALB + #https://github.com/kubernetes-sigs/aws-load-balancer-controller/issues/1571 + #so commenting grouping feature + #alb.ingress.kubernetes.io/group.name: geordie + alb.ingress.kubernetes.io/scheme: internet-facing + alb.ingress.kubernetes.io/target-type: ip + {{ if .Values.spec.ingress.host }} + alb.ingress.kubernetes.io/listen-ports: '[{"HTTP":80,"HTTPS": 443}]' + alb.ingress.kubernetes.io/ssl-redirect: '443' + {{ else }} + alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}]' + {{ end }} + alb.ingress.kubernetes.io/tags: Environment={{ .Values.labels.env }},Team=Geordie +{{ else }} + kubernetes.io/ingress.class: "nginx" +{{ end }} + {{ if .Values.spec.ingress.host }} + external-dns.alpha.kubernetes.io/set-identifier: {{ .Values.spec.clusterName }} + external-dns.alpha.kubernetes.io/aws-weight: '{{ .Values.spec.ingress.route53_weight }}' + external-dns.alpha.kubernetes.io/ttl: "10" + {{ end }} +spec: +{{ if eq .Values.spec.ingress.type "nginx" }} + ingressClassName: nginx +{{ else }} + ingressClassName: alb +{{ end }} + rules: +{{ if .Values.spec.ingress.host }} + - host: ho11y.{{ .Values.spec.ingress.host }} +{{ else }} + - host: +{{ end }} + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: frontend + port: + number: 80 diff --git a/artifacts/argocd-apps/teams/team-geordie/prod/ho11y/values.yaml b/artifacts/argocd-apps/teams/team-geordie/prod/ho11y/values.yaml new file mode 100644 index 0000000..3db6731 --- /dev/null +++ b/artifacts/argocd-apps/teams/team-geordie/prod/ho11y/values.yaml @@ -0,0 +1,9 @@ +labels: + env: prod + team: geordie +spec: + destination: + server: https://kubernetes.default.svc + source: + repoURL: https://github.com/aws-samples/eks-blueprints-workloads + targetRevision: main diff --git a/artifacts/argocd-apps/teams/team-geordie/prod/templates/ho11y-app.yaml b/artifacts/argocd-apps/teams/team-geordie/prod/templates/ho11y-app.yaml new file mode 100644 index 0000000..f0434e8 --- /dev/null +++ b/artifacts/argocd-apps/teams/team-geordie/prod/templates/ho11y-app.yaml @@ -0,0 +1,24 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: ho11y + # namespace is specified as namespace destination in env/{dev,test,prod}/team-geordie.yaml + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + project: {{ .Values.argoProject | default "default" }} + destination: + namespace: geordie + server: {{ .Values.spec.destination.server }} + source: + repoURL: {{ .Values.spec.source.repoURL }} + targetRevision: {{ .Values.spec.source.targetRevision }} + path: artifacts/argocd-apps/teams/team-geordie/prod/ho11y + helm: + values: | + {{- toYaml .Values | nindent 8 }} + syncPolicy: + automated: + prune: true + syncOptions: + - CreateNamespace=true diff --git a/artifacts/argocd-apps/teams/team-geordie/prod/templates/yelb-app.yaml b/artifacts/argocd-apps/teams/team-geordie/prod/templates/yelb-app.yaml new file mode 100644 index 0000000..6eeb8bf --- /dev/null +++ b/artifacts/argocd-apps/teams/team-geordie/prod/templates/yelb-app.yaml @@ -0,0 +1,24 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: yelb + # namespace is specified as namespace destination in env/{dev,test,prod}/team-geordie.yaml + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + project: {{ .Values.argoProject | default "default" }} + destination: + namespace: geordie + server: {{ .Values.spec.destination.server }} + source: + repoURL: {{ .Values.spec.source.repoURL }} + targetRevision: {{ .Values.spec.source.targetRevision }} + path: artifacts/argocd-apps/teams/team-geordie/prod/yelb + helm: + values: | + {{- toYaml .Values | nindent 8 }} + syncPolicy: + automated: + prune: true + syncOptions: + - CreateNamespace=true diff --git a/artifacts/argocd-apps/teams/team-geordie/prod/values.yaml b/artifacts/argocd-apps/teams/team-geordie/prod/values.yaml new file mode 100644 index 0000000..19902f7 --- /dev/null +++ b/artifacts/argocd-apps/teams/team-geordie/prod/values.yaml @@ -0,0 +1,11 @@ +argoProject: '' + +labels: + env: prod + team: geordie +spec: + destination: + server: https://kubernetes.default.svc + source: + repoURL: https://github.com/aws-samples/eks-blueprints-workloads + targetRevision: main diff --git a/artifacts/argocd-apps/teams/team-geordie/prod/yelb/Chart.yaml b/artifacts/argocd-apps/teams/team-geordie/prod/yelb/Chart.yaml new file mode 100644 index 0000000..513359b --- /dev/null +++ b/artifacts/argocd-apps/teams/team-geordie/prod/yelb/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v1 +appVersion: "1.0" +description: Yelb! The only hub for healthy food recommendations +name: yelb +version: 0.1.0 diff --git a/artifacts/argocd-apps/teams/team-geordie/prod/yelb/templates/deployment.yaml b/artifacts/argocd-apps/teams/team-geordie/prod/yelb/templates/deployment.yaml new file mode 100644 index 0000000..f03cc0f --- /dev/null +++ b/artifacts/argocd-apps/teams/team-geordie/prod/yelb/templates/deployment.yaml @@ -0,0 +1,158 @@ +apiVersion: v1 +kind: Service +metadata: + namespace: geordie + name: redis-server + labels: + app: redis-server + tier: cache +spec: + type: ClusterIP + ports: + - port: 6379 + selector: + app: redis-server + tier: cache +--- +apiVersion: v1 +kind: Service +metadata: + namespace: geordie + name: yelb-db + labels: + app: yelb-db + tier: backenddb +spec: + type: ClusterIP + ports: + - port: 5432 + selector: + app: yelb-db + tier: backenddb +--- +apiVersion: v1 +kind: Service +metadata: + namespace: geordie + name: yelb-appserver + labels: + app: yelb-appserver + tier: middletier +spec: + type: ClusterIP + ports: + - port: 4567 + selector: + app: yelb-appserver + tier: middletier +--- +apiVersion: v1 +kind: Service +metadata: + namespace: geordie + name: yelb-ui + labels: + app: yelb-ui + tier: frontend +spec: + type: LoadBalancer + ports: + - port: 80 + protocol: TCP + targetPort: 80 + selector: + app: yelb-ui + tier: frontend +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + namespace: geordie + name: yelb-ui +spec: + replicas: 1 + selector: + matchLabels: + app: yelb-ui + tier: frontend + template: + metadata: + labels: + app: yelb-ui + tier: frontend + spec: + containers: + - name: yelb-ui + image: mreferre/yelb-ui:0.7 + ports: + - containerPort: 80 +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + namespace: geordie + name: redis-server +spec: + selector: + matchLabels: + app: redis-server + tier: cache + replicas: 1 + template: + metadata: + labels: + app: redis-server + tier: cache + spec: + containers: + - name: redis-server + image: redis:4.0.2 + ports: + - containerPort: 6379 +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + namespace: geordie + name: yelb-db +spec: + replicas: 1 + selector: + matchLabels: + app: yelb-db + tier: backenddb + template: + metadata: + labels: + app: yelb-db + tier: backenddb + spec: + containers: + - name: yelb-db + image: mreferre/yelb-db:0.5 + ports: + - containerPort: 5432 +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + namespace: geordie + name: yelb-appserver +spec: + replicas: 1 + selector: + matchLabels: + app: yelb-appserver + tier: middletier + template: + metadata: + labels: + app: yelb-appserver + tier: middletier + spec: + containers: + - name: yelb-appserver + image: mreferre/yelb-appserver:0.5 + ports: + - containerPort: 4567 +--- diff --git a/artifacts/argocd-apps/teams/team-geordie/prod/yelb/templates/ingress.yaml b/artifacts/argocd-apps/teams/team-geordie/prod/yelb/templates/ingress.yaml new file mode 100644 index 0000000..aaebc13 --- /dev/null +++ b/artifacts/argocd-apps/teams/team-geordie/prod/yelb/templates/ingress.yaml @@ -0,0 +1,51 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + namespace: geordie + name: yelb-ingress + annotations: +{{ if eq .Values.spec.ingress.type "alb" }} + #rewrite does not exist yet in ALB + #https://github.com/kubernetes-sigs/aws-load-balancer-controller/issues/1571 + #so commenting grouping feature + #alb.ingress.kubernetes.io/group.name: geordie + alb.ingress.kubernetes.io/scheme: internet-facing + alb.ingress.kubernetes.io/target-type: ip + {{ if .Values.spec.ingress.host }} + alb.ingress.kubernetes.io/listen-ports: '[{"HTTP":80,"HTTPS": 443}]' + alb.ingress.kubernetes.io/ssl-redirect: '443' + {{ else }} + alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}]' + {{ end }} + alb.ingress.kubernetes.io/tags: Environment={{ .Values.labels.env }},Team=Geordie +{{ else }} + kubernetes.io/ingress.class: "nginx" +{{ end }} + {{ if .Values.spec.ingress.host }} + external-dns.alpha.kubernetes.io/set-identifier: {{ .Values.spec.clusterName }} + external-dns.alpha.kubernetes.io/aws-weight: '{{ .Values.spec.ingress.route53_weight }}' + external-dns.alpha.kubernetes.io/ttl: "10" + {{ end }} + labels: + app: yelb-ui +spec: +{{ if eq .Values.spec.ingress.type "nginx" }} + ingressClassName: nginx +{{ else }} + ingressClassName: alb +{{ end }} + rules: +{{ if .Values.spec.ingress.host }} + - host: yelb.{{ .Values.spec.ingress.host }} +{{ else }} + - host: +{{ end }} + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: yelb-ui + port: + number: 80 diff --git a/artifacts/argocd-apps/teams/team-geordie/prod/yelb/values.yaml b/artifacts/argocd-apps/teams/team-geordie/prod/yelb/values.yaml new file mode 100644 index 0000000..3db6731 --- /dev/null +++ b/artifacts/argocd-apps/teams/team-geordie/prod/yelb/values.yaml @@ -0,0 +1,9 @@ +labels: + env: prod + team: geordie +spec: + destination: + server: https://kubernetes.default.svc + source: + repoURL: https://github.com/aws-samples/eks-blueprints-workloads + targetRevision: main