From 63e7108f6a8e023872863469de4241b7fc66f8ae Mon Sep 17 00:00:00 2001 From: "Gary A. Stafford" Date: Sat, 12 Jun 2021 14:20:34 -0400 Subject: [PATCH] Refactor project resources by namespace --- .../prometheus-eks.yaml | 0 resources/aws/trust-eks-policy-internal.json | 17 ----------------- resources/aws/trust-eks-policy.json | 2 +- .../{ => dev}/istio/destination-rules.yaml | 9 +++++++++ .../istio/external-mesh-amazon-mq.yaml | 1 + .../istio/external-mesh-document-db.yaml | 1 + resources/{ => dev}/istio/gateway.yaml | 1 + resources/{ => dev}/istio/virtualservices.yaml | 2 ++ resources/dev/secrets/secrets.yaml | 9 +++++++++ resources/{ => dev}/services/angular-ui.yaml | 0 resources/{ => dev}/services/service-a.yaml | 0 resources/{ => dev}/services/service-b.yaml | 0 resources/{ => dev}/services/service-c.yaml | 0 resources/{ => dev}/services/service-d.yaml | 0 resources/{ => dev}/services/service-e.yaml | 0 resources/{ => dev}/services/service-f.yaml | 0 resources/{ => dev}/services/service-g.yaml | 0 resources/{ => dev}/services/service-h.yaml | 0 .../{other => istio-system}/alb-ingress.yaml | 0 .../{istio => istio-system}/prometheus.yaml | 0 .../aws-load-balancer-controller-v220-all.yaml | 0 .../eks-admin-service-account.yaml | 0 .../{ => mongo-express}/secrets/secrets.yaml | 10 ---------- .../services/mongo-express.yaml | 2 ++ 24 files changed, 26 insertions(+), 28 deletions(-) rename resources/{other => amazon-cloudwatch}/prometheus-eks.yaml (100%) delete mode 100644 resources/aws/trust-eks-policy-internal.json rename resources/{ => dev}/istio/destination-rules.yaml (92%) rename resources/{ => dev}/istio/external-mesh-amazon-mq.yaml (93%) rename resources/{ => dev}/istio/external-mesh-document-db.yaml (93%) rename resources/{ => dev}/istio/gateway.yaml (94%) rename resources/{ => dev}/istio/virtualservices.yaml (95%) create mode 100644 resources/dev/secrets/secrets.yaml rename resources/{ => dev}/services/angular-ui.yaml (100%) rename resources/{ => dev}/services/service-a.yaml (100%) rename resources/{ => dev}/services/service-b.yaml (100%) rename resources/{ => dev}/services/service-c.yaml (100%) rename resources/{ => dev}/services/service-d.yaml (100%) rename resources/{ => dev}/services/service-e.yaml (100%) rename resources/{ => dev}/services/service-f.yaml (100%) rename resources/{ => dev}/services/service-g.yaml (100%) rename resources/{ => dev}/services/service-h.yaml (100%) rename resources/{other => istio-system}/alb-ingress.yaml (100%) rename resources/{istio => istio-system}/prometheus.yaml (100%) rename resources/{other => kube-system}/aws-load-balancer-controller-v220-all.yaml (100%) rename resources/{aws => kube-system}/eks-admin-service-account.yaml (100%) rename resources/{ => mongo-express}/secrets/secrets.yaml (65%) rename resources/{ => mongo-express}/services/mongo-express.yaml (97%) diff --git a/resources/other/prometheus-eks.yaml b/resources/amazon-cloudwatch/prometheus-eks.yaml similarity index 100% rename from resources/other/prometheus-eks.yaml rename to resources/amazon-cloudwatch/prometheus-eks.yaml diff --git a/resources/aws/trust-eks-policy-internal.json b/resources/aws/trust-eks-policy-internal.json deleted file mode 100644 index da833e0..0000000 --- a/resources/aws/trust-eks-policy-internal.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "Version":"2012-10-17", - "Statement":[ - { - "Effect":"Allow", - "Principal":{ - "Federated":" {{ your_openid_connect_arn }}" - }, - "Action":"sts:AssumeRoleWithWebIdentity", - "Condition":{ - "StringEquals":{ - "oidc.eks.us-east-1.amazonaws.com/id/{{ your_open_id_connect_id }}:sub":"system:serviceaccount:kube-system:alb-ingress-controller" - } - } - } - ] -} \ No newline at end of file diff --git a/resources/aws/trust-eks-policy.json b/resources/aws/trust-eks-policy.json index b83080f..99e6268 100644 --- a/resources/aws/trust-eks-policy.json +++ b/resources/aws/trust-eks-policy.json @@ -4,7 +4,7 @@ { "Effect":"Allow", "Principal":{ - "Federated":"arn:aws:iam::676164205626:oidc-provider/oidc.eks.us-east-1.amazonaws.com/id/F91B063F4B2E8BDFED054DD64DAB4368" + "Federated":"arn:aws:iam::1234567890:oidc-provider/oidc.eks.us-east-1.amazonaws.com/id/F91B063F4B2E8BDFED054DD64DAB4368" }, "Action":"sts:AssumeRoleWithWebIdentity", "Condition":{ diff --git a/resources/istio/destination-rules.yaml b/resources/dev/istio/destination-rules.yaml similarity index 92% rename from resources/istio/destination-rules.yaml rename to resources/dev/istio/destination-rules.yaml index f3b82b1..9c2a93b 100644 --- a/resources/istio/destination-rules.yaml +++ b/resources/dev/istio/destination-rules.yaml @@ -2,6 +2,7 @@ apiVersion: networking.istio.io/v1beta1 kind: DestinationRule metadata: name: angular-ui + namespace: dev spec: host: angular-ui.dev.svc.cluster.local subsets: @@ -13,6 +14,7 @@ apiVersion: networking.istio.io/v1beta1 kind: DestinationRule metadata: name: service-a + namespace: dev spec: host: service-a.dev.svc.cluster.local subsets: @@ -24,6 +26,7 @@ apiVersion: networking.istio.io/v1beta1 kind: DestinationRule metadata: name: service-b + namespace: dev spec: host: service-b.dev.svc.cluster.local subsets: @@ -35,6 +38,7 @@ apiVersion: networking.istio.io/v1beta1 kind: DestinationRule metadata: name: service-c + namespace: dev spec: host: service-c.dev.svc.cluster.local subsets: @@ -46,6 +50,7 @@ apiVersion: networking.istio.io/v1beta1 kind: DestinationRule metadata: name: service-d + namespace: dev spec: host: service-d.dev.svc.cluster.local subsets: @@ -57,6 +62,7 @@ apiVersion: networking.istio.io/v1beta1 kind: DestinationRule metadata: name: service-e + namespace: dev spec: host: service-e.dev.svc.cluster.local subsets: @@ -68,6 +74,7 @@ apiVersion: networking.istio.io/v1beta1 kind: DestinationRule metadata: name: service-f + namespace: dev spec: host: service-f.dev.svc.cluster.local subsets: @@ -79,6 +86,7 @@ apiVersion: networking.istio.io/v1beta1 kind: DestinationRule metadata: name: service-g + namespace: dev spec: host: service-g.dev.svc.cluster.local subsets: @@ -90,6 +98,7 @@ apiVersion: networking.istio.io/v1beta1 kind: DestinationRule metadata: name: service-h + namespace: dev spec: host: service-h.dev.svc.cluster.local subsets: diff --git a/resources/istio/external-mesh-amazon-mq.yaml b/resources/dev/istio/external-mesh-amazon-mq.yaml similarity index 93% rename from resources/istio/external-mesh-amazon-mq.yaml rename to resources/dev/istio/external-mesh-amazon-mq.yaml index 81e9824..a1eaf06 100644 --- a/resources/istio/external-mesh-amazon-mq.yaml +++ b/resources/dev/istio/external-mesh-amazon-mq.yaml @@ -2,6 +2,7 @@ apiVersion: networking.istio.io/v1alpha3 kind: ServiceEntry metadata: name: amazon-mq-external-mesh + namespace: dev spec: hosts: - {{ your_amazon_mq_hostname }} diff --git a/resources/istio/external-mesh-document-db.yaml b/resources/dev/istio/external-mesh-document-db.yaml similarity index 93% rename from resources/istio/external-mesh-document-db.yaml rename to resources/dev/istio/external-mesh-document-db.yaml index 89c3026..719e354 100644 --- a/resources/istio/external-mesh-document-db.yaml +++ b/resources/dev/istio/external-mesh-document-db.yaml @@ -2,6 +2,7 @@ apiVersion: networking.istio.io/v1alpha3 kind: ServiceEntry metadata: name: docdb-external-mesh + namespace: dev spec: hosts: - {{ your_document_db_hostname }} diff --git a/resources/istio/gateway.yaml b/resources/dev/istio/gateway.yaml similarity index 94% rename from resources/istio/gateway.yaml rename to resources/dev/istio/gateway.yaml index 3e33e20..31f58cc 100644 --- a/resources/istio/gateway.yaml +++ b/resources/dev/istio/gateway.yaml @@ -2,6 +2,7 @@ apiVersion: networking.istio.io/v1beta1 kind: Gateway metadata: name: istio-gateway + namespace: dev spec: selector: istio: ingressgateway # use istio default controller diff --git a/resources/istio/virtualservices.yaml b/resources/dev/istio/virtualservices.yaml similarity index 95% rename from resources/istio/virtualservices.yaml rename to resources/dev/istio/virtualservices.yaml index 2ed4378..7edb892 100644 --- a/resources/istio/virtualservices.yaml +++ b/resources/dev/istio/virtualservices.yaml @@ -2,6 +2,7 @@ apiVersion: networking.istio.io/v1beta1 kind: VirtualService metadata: name: angular-ui + namespace: dev spec: hosts: - {{ your_ui_hostname }} @@ -22,6 +23,7 @@ apiVersion: networking.istio.io/v1beta1 kind: VirtualService metadata: name: service-a + namespace: dev spec: hosts: - {{ your_api_hostname }} diff --git a/resources/dev/secrets/secrets.yaml b/resources/dev/secrets/secrets.yaml new file mode 100644 index 0000000..5878e87 --- /dev/null +++ b/resources/dev/secrets/secrets.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: Secret +metadata: + name: go-srv-config + namespace: dev +type: Opaque +data: + mongodb.conn: {{ your_base64_encoded_secret }} + rabbitmq.conn: {{ your_base64_encoded_secret }} \ No newline at end of file diff --git a/resources/services/angular-ui.yaml b/resources/dev/services/angular-ui.yaml similarity index 100% rename from resources/services/angular-ui.yaml rename to resources/dev/services/angular-ui.yaml diff --git a/resources/services/service-a.yaml b/resources/dev/services/service-a.yaml similarity index 100% rename from resources/services/service-a.yaml rename to resources/dev/services/service-a.yaml diff --git a/resources/services/service-b.yaml b/resources/dev/services/service-b.yaml similarity index 100% rename from resources/services/service-b.yaml rename to resources/dev/services/service-b.yaml diff --git a/resources/services/service-c.yaml b/resources/dev/services/service-c.yaml similarity index 100% rename from resources/services/service-c.yaml rename to resources/dev/services/service-c.yaml diff --git a/resources/services/service-d.yaml b/resources/dev/services/service-d.yaml similarity index 100% rename from resources/services/service-d.yaml rename to resources/dev/services/service-d.yaml diff --git a/resources/services/service-e.yaml b/resources/dev/services/service-e.yaml similarity index 100% rename from resources/services/service-e.yaml rename to resources/dev/services/service-e.yaml diff --git a/resources/services/service-f.yaml b/resources/dev/services/service-f.yaml similarity index 100% rename from resources/services/service-f.yaml rename to resources/dev/services/service-f.yaml diff --git a/resources/services/service-g.yaml b/resources/dev/services/service-g.yaml similarity index 100% rename from resources/services/service-g.yaml rename to resources/dev/services/service-g.yaml diff --git a/resources/services/service-h.yaml b/resources/dev/services/service-h.yaml similarity index 100% rename from resources/services/service-h.yaml rename to resources/dev/services/service-h.yaml diff --git a/resources/other/alb-ingress.yaml b/resources/istio-system/alb-ingress.yaml similarity index 100% rename from resources/other/alb-ingress.yaml rename to resources/istio-system/alb-ingress.yaml diff --git a/resources/istio/prometheus.yaml b/resources/istio-system/prometheus.yaml similarity index 100% rename from resources/istio/prometheus.yaml rename to resources/istio-system/prometheus.yaml diff --git a/resources/other/aws-load-balancer-controller-v220-all.yaml b/resources/kube-system/aws-load-balancer-controller-v220-all.yaml similarity index 100% rename from resources/other/aws-load-balancer-controller-v220-all.yaml rename to resources/kube-system/aws-load-balancer-controller-v220-all.yaml diff --git a/resources/aws/eks-admin-service-account.yaml b/resources/kube-system/eks-admin-service-account.yaml similarity index 100% rename from resources/aws/eks-admin-service-account.yaml rename to resources/kube-system/eks-admin-service-account.yaml diff --git a/resources/secrets/secrets.yaml b/resources/mongo-express/secrets/secrets.yaml similarity index 65% rename from resources/secrets/secrets.yaml rename to resources/mongo-express/secrets/secrets.yaml index f64b313..c23c69d 100644 --- a/resources/secrets/secrets.yaml +++ b/resources/mongo-express/secrets/secrets.yaml @@ -1,15 +1,5 @@ apiVersion: v1 kind: Secret -metadata: - name: go-srv-config - namespace: dev -type: Opaque -data: - mongodb.conn: {{ your_base64_encoded_secret }} - rabbitmq.conn: {{ your_base64_encoded_secret }} ---- -apiVersion: v1 -kind: Secret metadata: name: mongo-express-config namespace: mongo-express diff --git a/resources/services/mongo-express.yaml b/resources/mongo-express/services/mongo-express.yaml similarity index 97% rename from resources/services/mongo-express.yaml rename to resources/mongo-express/services/mongo-express.yaml index 4b59d2c..b7ee135 100644 --- a/resources/services/mongo-express.yaml +++ b/resources/mongo-express/services/mongo-express.yaml @@ -2,6 +2,7 @@ apiversion: v1 kind: Service metadata: name: mongo-express + namespace: mongo-express labels: app: mongo-express spec: @@ -16,6 +17,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: mongo-express + namespace: mongo-express labels: app: mongo-express spec: