From 6157950e7bd1d69e864d4b82ef84e324548bc85a Mon Sep 17 00:00:00 2001 From: niallthomson Date: Sun, 16 Apr 2023 23:13:41 +0000 Subject: [PATCH] Release 0.3.0 --- deploy/kubernetes/charts/assets/values.yaml | 2 +- deploy/kubernetes/charts/carts/values.yaml | 2 +- deploy/kubernetes/charts/catalog/values.yaml | 2 +- deploy/kubernetes/charts/checkout/values.yaml | 2 +- deploy/kubernetes/charts/orders/values.yaml | 2 +- deploy/kubernetes/charts/ui/values.yaml | 2 +- deploy/terraform/lib/images/generated.tf.json | 4 +- dist/docker-compose/docker-compose.yml | 33 +- dist/kubernetes/deploy.yaml | 2196 +++++++++++------ 9 files changed, 1418 insertions(+), 827 deletions(-) diff --git a/deploy/kubernetes/charts/assets/values.yaml b/deploy/kubernetes/charts/assets/values.yaml index 1def2ef75..e94db5c06 100644 --- a/deploy/kubernetes/charts/assets/values.yaml +++ b/deploy/kubernetes/charts/assets/values.yaml @@ -7,7 +7,7 @@ replicaCount: 1 image: repository: public.ecr.aws/aws-containers/retail-store-sample-assets pullPolicy: IfNotPresent - tag: 0.2.0 + tag: 0.3.0 imagePullSecrets: [] nameOverride: "" diff --git a/deploy/kubernetes/charts/carts/values.yaml b/deploy/kubernetes/charts/carts/values.yaml index 493149de9..f2dde12ab 100644 --- a/deploy/kubernetes/charts/carts/values.yaml +++ b/deploy/kubernetes/charts/carts/values.yaml @@ -7,7 +7,7 @@ replicaCount: 1 image: repository: public.ecr.aws/aws-containers/retail-store-sample-cart pullPolicy: IfNotPresent - tag: 0.2.0 + tag: 0.3.0 imagePullSecrets: [] nameOverride: "" diff --git a/deploy/kubernetes/charts/catalog/values.yaml b/deploy/kubernetes/charts/catalog/values.yaml index 40af82f2f..04089447c 100644 --- a/deploy/kubernetes/charts/catalog/values.yaml +++ b/deploy/kubernetes/charts/catalog/values.yaml @@ -7,7 +7,7 @@ replicaCount: 1 image: repository: public.ecr.aws/aws-containers/retail-store-sample-catalog pullPolicy: IfNotPresent - tag: 0.2.0 + tag: 0.3.0 imagePullSecrets: [] nameOverride: "" diff --git a/deploy/kubernetes/charts/checkout/values.yaml b/deploy/kubernetes/charts/checkout/values.yaml index 4fb92909e..d605262c9 100644 --- a/deploy/kubernetes/charts/checkout/values.yaml +++ b/deploy/kubernetes/charts/checkout/values.yaml @@ -7,7 +7,7 @@ replicaCount: 1 image: repository: public.ecr.aws/aws-containers/retail-store-sample-checkout pullPolicy: IfNotPresent - tag: 0.2.0 + tag: 0.3.0 imagePullSecrets: [] nameOverride: "" diff --git a/deploy/kubernetes/charts/orders/values.yaml b/deploy/kubernetes/charts/orders/values.yaml index f8883f72e..69353ee74 100644 --- a/deploy/kubernetes/charts/orders/values.yaml +++ b/deploy/kubernetes/charts/orders/values.yaml @@ -7,7 +7,7 @@ replicaCount: 1 image: repository: public.ecr.aws/aws-containers/retail-store-sample-orders pullPolicy: IfNotPresent - tag: 0.2.0 + tag: 0.3.0 imagePullSecrets: [] nameOverride: "" diff --git a/deploy/kubernetes/charts/ui/values.yaml b/deploy/kubernetes/charts/ui/values.yaml index 97d4dfb58..5e0d54cda 100644 --- a/deploy/kubernetes/charts/ui/values.yaml +++ b/deploy/kubernetes/charts/ui/values.yaml @@ -7,7 +7,7 @@ replicaCount: 1 image: repository: public.ecr.aws/aws-containers/retail-store-sample-ui pullPolicy: IfNotPresent - tag: 0.2.0 + tag: 0.3.0 imagePullSecrets: [] nameOverride: "" diff --git a/deploy/terraform/lib/images/generated.tf.json b/deploy/terraform/lib/images/generated.tf.json index c732eca3c..c2ba59f7a 100644 --- a/deploy/terraform/lib/images/generated.tf.json +++ b/deploy/terraform/lib/images/generated.tf.json @@ -1,6 +1,6 @@ { "locals": { - "published_tag": "0.2.0", + "published_tag": "0.3.0", "published_repository": "public.ecr.aws/aws-containers" } -} \ No newline at end of file +} diff --git a/dist/docker-compose/docker-compose.yml b/dist/docker-compose/docker-compose.yml index ced5efefc..996487370 100644 --- a/dist/docker-compose/docker-compose.yml +++ b/dist/docker-compose/docker-compose.yml @@ -15,11 +15,10 @@ # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. version: '2' - services: ui: ports: - - 8888:8080 + - 8888:8080 environment: - JAVA_OPTS=-XX:MaxRAMPercentage=75.0 -Djava.security.egd=file:/dev/urandom - SERVER_TOMCAT_ACCESSLOG_ENABLED=true @@ -29,15 +28,14 @@ services: - ENDPOINTS_CHECKOUT=http://checkout:8080 - ENDPOINTS_ASSETS=http://assets:8080 hostname: ui - image: public.ecr.aws/aws-containers/retail-store-sample-ui:0.2.0 + image: public.ecr.aws/aws-containers/retail-store-sample-ui:0.3.0 restart: always mem_limit: 256m cap_drop: - ALL - catalog: hostname: catalog - image: public.ecr.aws/aws-containers/retail-store-sample-catalog:0.2.0 + image: public.ecr.aws/aws-containers/retail-store-sample-catalog:0.3.0 restart: always environment: - GIN_MODE=release @@ -45,7 +43,6 @@ services: mem_limit: 128m cap_drop: - ALL - catalog-db: image: mariadb:10.9 hostname: catalog-db @@ -57,10 +54,9 @@ services: - MYSQL_USER=catalog_user - MYSQL_PASSWORD=${MYSQL_PASSWORD} mem_limit: 128m - carts: hostname: carts - image: public.ecr.aws/aws-containers/retail-store-sample-cart:0.2.0 + image: public.ecr.aws/aws-containers/retail-store-sample-cart:0.3.0 restart: always environment: - JAVA_OPTS=-XX:MaxRAMPercentage=75.0 -Djava.security.egd=file:/dev/urandom @@ -73,19 +69,15 @@ services: mem_limit: 256m cap_drop: - ALL - carts-db: image: amazon/dynamodb-local:1.20.0 hostname: carts-db restart: always - mem_limit: 128m - + mem_limit: 256m orders: hostname: orders - image: public.ecr.aws/aws-containers/retail-store-sample-orders:0.2.0 + image: public.ecr.aws/aws-containers/retail-store-sample-orders:0.3.0 restart: always - ports: - - 8083:8080 environment: - JAVA_OPTS=-XX:MaxRAMPercentage=75.0 -Djava.security.egd=file:/dev/urandom - SERVER_TOMCAT_ACCESSLOG_ENABLED=true @@ -100,7 +92,6 @@ services: mem_limit: 256m cap_drop: - ALL - orders-db: image: mariadb:10.9 hostname: orders-db @@ -112,41 +103,35 @@ services: - MYSQL_USER=orders_user - MYSQL_PASSWORD=${MYSQL_PASSWORD} mem_limit: 128m - checkout: - image: public.ecr.aws/aws-containers/retail-store-sample-checkout:0.2.0 + image: public.ecr.aws/aws-containers/retail-store-sample-checkout:0.3.0 hostname: checkout restart: always read_only: true tmpfs: - /tmp:rw,noexec,nosuid - ports: - - 8084:8080 environment: - REDIS_URL=redis://checkout-redis:6379 - ENDPOINTS_ORDERS=http://orders:8080 mem_limit: 256m cap_drop: - ALL - checkout-redis: image: redis:6-alpine hostname: checkout-redis restart: always mem_limit: 128m - assets: hostname: assets environment: - PORT=8080 - image: public.ecr.aws/aws-containers/retail-store-sample-assets:0.2.0 + image: public.ecr.aws/aws-containers/retail-store-sample-assets:0.3.0 restart: always mem_limit: 64m cap_drop: - ALL - rabbitmq: image: rabbitmq:3-management ports: - "5672:5672" - - "15672:15672" \ No newline at end of file + - "15672:15672" diff --git a/dist/kubernetes/deploy.yaml b/dist/kubernetes/deploy.yaml index c7dd43245..bd7b90bd0 100644 --- a/dist/kubernetes/deploy.yaml +++ b/dist/kubernetes/deploy.yaml @@ -1,732 +1,1286 @@ -apiVersion: v1 -kind: Namespace -metadata: - labels: - app.kubernetes.io/created-by: retail-store-sample - name: assets --- +# Source: catalog/templates/serviceaccount.yaml apiVersion: v1 -kind: Namespace -metadata: - labels: - app.kubernetes.io/created-by: retail-store-sample - name: carts ---- -apiVersion: v1 -kind: Namespace +kind: ServiceAccount metadata: - labels: - app.kubernetes.io/created-by: retail-store-sample name: catalog ---- -apiVersion: v1 -kind: Namespace -metadata: labels: - app.kubernetes.io/created-by: retail-store-sample - name: checkout + helm.sh/chart: catalog-0.0.1 + app.kubernetes.io/name: catalog + app.kubernetes.io/instance: catalog + app.kubernetes.io/component: service + app.kubernetes.io/managed-by: Helm --- +# Source: catalog/templates/mysql-secret.yaml apiVersion: v1 -kind: Namespace +kind: Secret metadata: - name: orders + name: catalog-db +data: + username: "Y2F0YWxvZw==" + password: "WHJoaGduRXNQT2oxa0NiMA==" --- +# Source: catalog/templates/configmap.yml apiVersion: v1 -kind: Namespace +kind: ConfigMap metadata: - name: rabbitmq + name: catalog +data: + DB_ENDPOINT: catalog-mysql:3306 + DB_READ_ENDPOINT: catalog-mysql:3306 + DB_NAME: catalog --- +# Source: catalog/templates/mysql-service.yaml apiVersion: v1 -kind: Namespace +kind: Service metadata: + name: catalog-mysql labels: - app.kubernetes.io/created-by: retail-store-sample - name: ui ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - name: assets - namespace: assets ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - name: carts - namespace: carts + helm.sh/chart: catalog-0.0.1 + app.kubernetes.io/name: catalog + app.kubernetes.io/instance: catalog + app.kubernetes.io/component: mysql + app.kubernetes.io/managed-by: Helm +spec: + type: ClusterIP + ports: + - port: 3306 + targetPort: mysql + protocol: TCP + name: mysql + selector: + app.kubernetes.io/name: catalog + app.kubernetes.io/instance: catalog + app.kubernetes.io/component: mysql --- +# Source: catalog/templates/service.yaml apiVersion: v1 -kind: ServiceAccount +kind: Service metadata: name: catalog - namespace: catalog + labels: + helm.sh/chart: catalog-0.0.1 + app.kubernetes.io/name: catalog + app.kubernetes.io/instance: catalog + app.kubernetes.io/component: service + app.kubernetes.io/managed-by: Helm +spec: + type: ClusterIP + ports: + - port: 80 + targetPort: http + protocol: TCP + name: http + selector: + app.kubernetes.io/name: catalog + app.kubernetes.io/instance: catalog + app.kubernetes.io/component: service --- -apiVersion: v1 -kind: ServiceAccount +# Source: catalog/templates/deployment.yaml +apiVersion: apps/v1 +kind: Deployment metadata: - name: checkout - namespace: checkout + name: catalog + labels: + helm.sh/chart: catalog-0.0.1 + app.kubernetes.io/name: catalog + app.kubernetes.io/instance: catalog + app.kubernetes.io/component: service + app.kubernetes.io/managed-by: Helm +spec: + replicas: 1 + strategy: + rollingUpdate: + maxUnavailable: 1 + type: RollingUpdate + selector: + matchLabels: + app.kubernetes.io/name: catalog + app.kubernetes.io/instance: catalog + app.kubernetes.io/component: service + template: + metadata: + annotations: + prometheus.io/path: /metrics + prometheus.io/port: "8080" + prometheus.io/scrape: "true" + labels: + app.kubernetes.io/name: catalog + app.kubernetes.io/instance: catalog + app.kubernetes.io/component: service + spec: + serviceAccountName: catalog + securityContext: + fsGroup: 1000 + containers: + - name: catalog + env: + - name: DB_USER + valueFrom: + secretKeyRef: + name: catalog-db + key: username + - name: DB_PASSWORD + valueFrom: + secretKeyRef: + name: catalog-db + key: password + envFrom: + - configMapRef: + name: catalog + securityContext: + capabilities: + drop: + - ALL + readOnlyRootFilesystem: true + runAsNonRoot: true + runAsUser: 1000 + image: "public.ecr.aws/aws-containers/retail-store-sample-catalog:0.3.0" + imagePullPolicy: IfNotPresent + ports: + - name: http + containerPort: 8080 + protocol: TCP + livenessProbe: + httpGet: + path: /health + port: 8080 + initialDelaySeconds: 30 + periodSeconds: 3 + resources: + limits: + memory: 256Mi + requests: + cpu: 128m + memory: 256Mi + volumeMounts: + - mountPath: /tmp + name: tmp-volume + volumes: + - name: tmp-volume + emptyDir: + medium: Memory --- -apiVersion: v1 -kind: ServiceAccount +# Source: catalog/templates/mysql-statefulset.yaml +apiVersion: apps/v1 +kind: StatefulSet metadata: - name: orders - namespace: orders + name: catalog-mysql + labels: + helm.sh/chart: catalog-0.0.1 + app.kubernetes.io/name: catalog + app.kubernetes.io/instance: catalog + app.kubernetes.io/component: mysql + app.kubernetes.io/managed-by: Helm +spec: + replicas: 1 + serviceName: catalog-mysql + selector: + matchLabels: + app.kubernetes.io/name: catalog + app.kubernetes.io/instance: catalog + app.kubernetes.io/component: mysql + template: + metadata: + labels: + app.kubernetes.io/name: catalog + app.kubernetes.io/instance: catalog + app.kubernetes.io/component: mysql + spec: + containers: + - name: mysql + image: "public.ecr.aws/docker/library/mysql:5.7" + imagePullPolicy: IfNotPresent + env: + - name: MYSQL_ROOT_PASSWORD + value: my-secret-pw + - name: MYSQL_DATABASE + value: catalog + - name: MYSQL_USER + valueFrom: + secretKeyRef: + name: catalog-db + key: username + - name: MYSQL_PASSWORD + valueFrom: + secretKeyRef: + name: catalog-db + key: password + args: + - "--ignore-db-dir=lost+found" + volumeMounts: + - name: data + mountPath: /var/lib/mysql + ports: + - name: mysql + containerPort: 3306 + protocol: TCP + volumeClaimTemplates: + - metadata: + name: data + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: "10Gi" --- +# Source: catalog/templates/tests/test-connection.yaml apiVersion: v1 -kind: ServiceAccount +kind: Pod metadata: - name: rabbitmq - namespace: rabbitmq + name: "catalog-test-connection" + labels: + helm.sh/chart: catalog-0.0.1 + app.kubernetes.io/name: catalog + app.kubernetes.io/instance: catalog + app.kubernetes.io/component: service + app.kubernetes.io/managed-by: Helm + annotations: + "helm.sh/hook": test-success +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['catalog:80'] + restartPolicy: Never + --- +# Source: ui/templates/serviceaccount.yaml apiVersion: v1 kind: ServiceAccount metadata: + name: ui labels: - app.kubernetes.io/component: service - app.kubernetes.io/instance: ui + helm.sh/chart: ui-0.0.1 app.kubernetes.io/name: ui - name: ui - namespace: ui + app.kubernetes.io/instance: ui + app.kubernetes.io/component: service + app.kubernetes.io/managed-by: Helm --- +# Source: ui/templates/configmap.yml apiVersion: v1 -data: - PORT: "8080" kind: ConfigMap metadata: - name: assets - namespace: assets ---- -apiVersion: v1 + name: ui data: - AWS_ACCESS_KEY_ID: key - AWS_SECRET_ACCESS_KEY: secret - CARTS_DYNAMODB_CREATETABLE: "true" - CARTS_DYNAMODB_ENDPOINT: http://carts-dynamodb:8000 - CARTS_DYNAMODB_TABLENAME: Items -kind: ConfigMap -metadata: - name: carts - namespace: carts + + ENDPOINTS_CATALOG: http://catalog --- +# Source: ui/templates/service.yaml apiVersion: v1 -data: null -kind: ConfigMap -metadata: - name: catalog - namespace: catalog ---- -apiVersion: v1 -data: - ENDPOINTS_ORDERS: http://orders.orders.svc:80 - REDIS_URL: redis://checkout-redis:6379 -kind: ConfigMap +kind: Service metadata: - name: checkout - namespace: checkout + name: ui + labels: + helm.sh/chart: ui-0.0.1 + app.kubernetes.io/name: ui + app.kubernetes.io/instance: ui + app.kubernetes.io/component: service + app.kubernetes.io/managed-by: Helm +spec: + type: ClusterIP + ports: + - port: 80 + targetPort: http + protocol: TCP + name: http + selector: + app.kubernetes.io/name: ui + app.kubernetes.io/instance: ui + app.kubernetes.io/component: service --- -apiVersion: v1 -data: - SPRING_PROFILES_ACTIVE: mysql,rabbitmq - SPRING_RABBITMQ_HOST: rabbitmq.rabbitmq.svc -kind: ConfigMap +# Source: ui/templates/deployment.yaml +apiVersion: apps/v1 +kind: Deployment metadata: - name: orders - namespace: orders + name: ui + labels: + helm.sh/chart: ui-0.0.1 + app.kubernetes.io/name: ui + app.kubernetes.io/instance: ui + app.kubernetes.io/component: service + app.kubernetes.io/managed-by: Helm +spec: + replicas: 1 + strategy: + rollingUpdate: + maxUnavailable: 1 + type: RollingUpdate + selector: + matchLabels: + app.kubernetes.io/name: ui + app.kubernetes.io/instance: ui + app.kubernetes.io/component: service + template: + metadata: + annotations: + prometheus.io/path: /actuator/prometheus + prometheus.io/port: "8080" + prometheus.io/scrape: "true" + labels: + app.kubernetes.io/name: ui + app.kubernetes.io/instance: ui + app.kubernetes.io/component: service + spec: + serviceAccountName: ui + securityContext: + fsGroup: 1000 + containers: + - name: ui + env: + - name: JAVA_OPTS + value: -XX:MaxRAMPercentage=75.0 -Djava.security.egd=file:/dev/urandom + envFrom: + - configMapRef: + name: ui + securityContext: + capabilities: + add: + - NET_BIND_SERVICE + drop: + - ALL + readOnlyRootFilesystem: true + runAsNonRoot: true + runAsUser: 1000 + image: "public.ecr.aws/aws-containers/retail-store-sample-ui:0.3.0" + imagePullPolicy: IfNotPresent + ports: + - name: http + containerPort: 8080 + protocol: TCP + livenessProbe: + httpGet: + path: /actuator/health/liveness + port: 8080 + initialDelaySeconds: 45 + periodSeconds: 3 + resources: + limits: + memory: 512Mi + requests: + cpu: 128m + memory: 512Mi + volumeMounts: + - mountPath: /tmp + name: tmp-volume + volumes: + - name: tmp-volume + emptyDir: + medium: Memory --- +# Source: ui/templates/tests/test-connection.yaml apiVersion: v1 -data: null -kind: ConfigMap +kind: Pod metadata: - name: rabbitmq - namespace: rabbitmq + name: "ui-test-connection" + labels: + helm.sh/chart: ui-0.0.1 + app.kubernetes.io/name: ui + app.kubernetes.io/instance: ui + app.kubernetes.io/component: service + app.kubernetes.io/managed-by: Helm + annotations: + "helm.sh/hook": test-success +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['ui:80'] + restartPolicy: Never + --- +# Source: catalog/templates/serviceaccount.yaml apiVersion: v1 -data: - ENDPOINTS_ASSETS: http://assets.assets.svc:80 - ENDPOINTS_CARTS: http://carts.carts.svc:80 - ENDPOINTS_CATALOG: http://catalog.catalog.svc:80 - ENDPOINTS_CHECKOUT: http://checkout.checkout.svc:80 - ENDPOINTS_ORDERS: http://orders.orders.svc:80 -kind: ConfigMap +kind: ServiceAccount metadata: - name: ui - namespace: ui + name: catalog + labels: + helm.sh/chart: catalog-0.0.1 + app.kubernetes.io/name: catalog + app.kubernetes.io/instance: catalog + app.kubernetes.io/component: service + app.kubernetes.io/managed-by: Helm --- +# Source: catalog/templates/mysql-secret.yaml apiVersion: v1 -data: - endpoint: Y2F0YWxvZy1teXNxbDozMzA2 - name: Y2F0YWxvZw== - password: ZGVmYXVsdF9wYXNzd29yZA== - username: Y2F0YWxvZ191c2Vy kind: Secret metadata: name: catalog-db - namespace: catalog ---- -apiVersion: v1 data: - name: b3JkZXJz - password: ZGVmYXVsdF9wYXNzd29yZA== - url: amRiYzptYXJpYWRiOi8vb3JkZXJzLW15c3FsOjMzMDYvb3JkZXJz - username: b3JkZXJzX3VzZXI= -kind: Secret -metadata: - name: orders-db - namespace: orders + username: "Y2F0YWxvZw==" + password: "R0sxak95UVkzcHBIbUl4dQ==" --- +# Source: catalog/templates/configmap.yml apiVersion: v1 -kind: Service +kind: ConfigMap metadata: - name: assets - namespace: assets -spec: - ports: - - name: http - port: 80 - protocol: TCP - targetPort: http - selector: - app.kubernetes.io/component: service - app.kubernetes.io/instance: assets - app.kubernetes.io/name: assets - type: ClusterIP + name: catalog +data: + DB_ENDPOINT: catalog-mysql:3306 + DB_READ_ENDPOINT: catalog-mysql:3306 + DB_NAME: catalog --- +# Source: catalog/templates/mysql-service.yaml apiVersion: v1 kind: Service metadata: - name: carts - namespace: carts + name: catalog-mysql + labels: + helm.sh/chart: catalog-0.0.1 + app.kubernetes.io/name: catalog + app.kubernetes.io/instance: catalog + app.kubernetes.io/component: mysql + app.kubernetes.io/managed-by: Helm spec: - ports: - - name: http - port: 80 - protocol: TCP - targetPort: http - selector: - app.kubernetes.io/component: service - app.kubernetes.io/instance: carts - app.kubernetes.io/name: carts type: ClusterIP ---- -apiVersion: v1 -kind: Service -metadata: - name: carts-dynamodb - namespace: carts -spec: ports: - - name: dynamodb - port: 8000 - protocol: TCP - targetPort: dynamodb + - port: 3306 + targetPort: mysql + protocol: TCP + name: mysql selector: - app.kubernetes.io/component: dynamodb - app.kubernetes.io/instance: carts - app.kubernetes.io/name: carts - type: ClusterIP + app.kubernetes.io/name: catalog + app.kubernetes.io/instance: catalog + app.kubernetes.io/component: mysql --- +# Source: catalog/templates/service.yaml apiVersion: v1 kind: Service metadata: name: catalog - namespace: catalog + labels: + helm.sh/chart: catalog-0.0.1 + app.kubernetes.io/name: catalog + app.kubernetes.io/instance: catalog + app.kubernetes.io/component: service + app.kubernetes.io/managed-by: Helm spec: + type: ClusterIP ports: - - name: http - port: 80 - protocol: TCP - targetPort: http + - port: 80 + targetPort: http + protocol: TCP + name: http selector: - app.kubernetes.io/component: service - app.kubernetes.io/instance: catalog app.kubernetes.io/name: catalog - type: ClusterIP + app.kubernetes.io/instance: catalog + app.kubernetes.io/component: service --- -apiVersion: v1 -kind: Service +# Source: catalog/templates/deployment.yaml +apiVersion: apps/v1 +kind: Deployment metadata: - name: catalog-mysql - namespace: catalog + name: catalog + labels: + helm.sh/chart: catalog-0.0.1 + app.kubernetes.io/name: catalog + app.kubernetes.io/instance: catalog + app.kubernetes.io/component: service + app.kubernetes.io/managed-by: Helm spec: - ports: - - name: mysql - port: 3306 - protocol: TCP - targetPort: mysql + replicas: 1 + strategy: + rollingUpdate: + maxUnavailable: 1 + type: RollingUpdate selector: - app.kubernetes.io/component: mysql - app.kubernetes.io/instance: catalog - app.kubernetes.io/name: catalog - type: ClusterIP + matchLabels: + app.kubernetes.io/name: catalog + app.kubernetes.io/instance: catalog + app.kubernetes.io/component: service + template: + metadata: + annotations: + prometheus.io/path: /metrics + prometheus.io/port: "8080" + prometheus.io/scrape: "true" + labels: + app.kubernetes.io/name: catalog + app.kubernetes.io/instance: catalog + app.kubernetes.io/component: service + spec: + serviceAccountName: catalog + securityContext: + fsGroup: 1000 + containers: + - name: catalog + env: + - name: DB_USER + valueFrom: + secretKeyRef: + name: catalog-db + key: username + - name: DB_PASSWORD + valueFrom: + secretKeyRef: + name: catalog-db + key: password + envFrom: + - configMapRef: + name: catalog + securityContext: + capabilities: + drop: + - ALL + readOnlyRootFilesystem: true + runAsNonRoot: true + runAsUser: 1000 + image: "public.ecr.aws/aws-containers/retail-store-sample-catalog:0.3.0" + imagePullPolicy: IfNotPresent + ports: + - name: http + containerPort: 8080 + protocol: TCP + livenessProbe: + httpGet: + path: /health + port: 8080 + initialDelaySeconds: 30 + periodSeconds: 3 + resources: + limits: + memory: 256Mi + requests: + cpu: 128m + memory: 256Mi + volumeMounts: + - mountPath: /tmp + name: tmp-volume + volumes: + - name: tmp-volume + emptyDir: + medium: Memory --- -apiVersion: v1 -kind: Service +# Source: catalog/templates/mysql-statefulset.yaml +apiVersion: apps/v1 +kind: StatefulSet metadata: - name: checkout - namespace: checkout + name: catalog-mysql + labels: + helm.sh/chart: catalog-0.0.1 + app.kubernetes.io/name: catalog + app.kubernetes.io/instance: catalog + app.kubernetes.io/component: mysql + app.kubernetes.io/managed-by: Helm spec: - ports: - - name: http - port: 80 - protocol: TCP - targetPort: http + replicas: 1 + serviceName: catalog-mysql selector: - app.kubernetes.io/component: service - app.kubernetes.io/instance: checkout - app.kubernetes.io/name: checkout - type: ClusterIP + matchLabels: + app.kubernetes.io/name: catalog + app.kubernetes.io/instance: catalog + app.kubernetes.io/component: mysql + template: + metadata: + labels: + app.kubernetes.io/name: catalog + app.kubernetes.io/instance: catalog + app.kubernetes.io/component: mysql + spec: + containers: + - name: mysql + image: "public.ecr.aws/docker/library/mysql:5.7" + imagePullPolicy: IfNotPresent + env: + - name: MYSQL_ROOT_PASSWORD + value: my-secret-pw + - name: MYSQL_DATABASE + value: catalog + - name: MYSQL_USER + valueFrom: + secretKeyRef: + name: catalog-db + key: username + - name: MYSQL_PASSWORD + valueFrom: + secretKeyRef: + name: catalog-db + key: password + args: + - "--ignore-db-dir=lost+found" + volumeMounts: + - name: data + mountPath: /var/lib/mysql + ports: + - name: mysql + containerPort: 3306 + protocol: TCP + volumeClaimTemplates: + - metadata: + name: data + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: "10Gi" --- +# Source: catalog/templates/tests/test-connection.yaml apiVersion: v1 -kind: Service +kind: Pod metadata: - name: checkout-redis - namespace: checkout + name: "catalog-test-connection" + labels: + helm.sh/chart: catalog-0.0.1 + app.kubernetes.io/name: catalog + app.kubernetes.io/instance: catalog + app.kubernetes.io/component: service + app.kubernetes.io/managed-by: Helm + annotations: + "helm.sh/hook": test-success spec: - ports: - - name: redis - port: 6379 - protocol: TCP - targetPort: redis - selector: - app.kubernetes.io/component: redis - app.kubernetes.io/instance: checkout - app.kubernetes.io/name: checkout - type: ClusterIP + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['catalog:80'] + restartPolicy: Never + --- +# Source: carts/templates/serviceaccount.yaml apiVersion: v1 -kind: Service +kind: ServiceAccount metadata: - name: orders - namespace: orders -spec: - ports: - - name: http - port: 80 - protocol: TCP - targetPort: http - selector: + name: carts + labels: + helm.sh/chart: carts-0.0.1 + app.kubernetes.io/name: carts + app.kubernetes.io/instance: carts app.kubernetes.io/component: service - app.kubernetes.io/instance: orders - app.kubernetes.io/name: orders - type: ClusterIP ---- -apiVersion: v1 -kind: Service -metadata: - name: orders-mysql - namespace: orders -spec: - ports: - - name: mysql - port: 3306 - protocol: TCP - targetPort: mysql - selector: - app.kubernetes.io/component: mysql - app.kubernetes.io/instance: orders - app.kubernetes.io/name: orders - type: ClusterIP + app.kubernetes.io/managed-by: Helm --- +# Source: carts/templates/configmap.yml apiVersion: v1 -kind: Service +kind: ConfigMap metadata: - name: rabbitmq - namespace: rabbitmq -spec: - ports: - - name: amqp - port: 5672 - protocol: TCP - targetPort: amqp - - name: http - port: 15672 - protocol: TCP - targetPort: http - selector: - app.kubernetes.io/component: rabbitmq - app.kubernetes.io/instance: rabbitmq - app.kubernetes.io/name: rabbitmq - type: ClusterIP + name: carts +data: + SPRING_PROFILES_ACTIVE: dynamodb + CARTS_DYNAMODB_TABLENAME: Items + CARTS_DYNAMODB_CREATETABLE: "false" + CARTS_DYNAMODB_CREATETABLE: "true" + AWS_ACCESS_KEY_ID: key + AWS_SECRET_ACCESS_KEY: secret + CARTS_DYNAMODB_ENDPOINT: http://carts-dynamodb:8000 --- +# Source: carts/templates/dynamodb-service.yaml apiVersion: v1 kind: Service metadata: + name: carts-dynamodb labels: - app.kubernetes.io/component: service - app.kubernetes.io/instance: ui - app.kubernetes.io/name: ui - name: ui - namespace: ui + helm.sh/chart: carts-0.0.1 + app.kubernetes.io/name: carts + app.kubernetes.io/instance: carts + app.kubernetes.io/component: dynamodb + app.kubernetes.io/managed-by: Helm spec: + type: ClusterIP ports: - - name: http - port: 80 - protocol: TCP - targetPort: http + - port: 8000 + targetPort: dynamodb + protocol: TCP + name: dynamodb selector: - app.kubernetes.io/component: service - app.kubernetes.io/instance: ui - app.kubernetes.io/name: ui - type: ClusterIP + app.kubernetes.io/name: carts + app.kubernetes.io/instance: carts + app.kubernetes.io/component: dynamodb --- +# Source: carts/templates/service.yaml apiVersion: v1 kind: Service metadata: + name: carts labels: + helm.sh/chart: carts-0.0.1 + app.kubernetes.io/name: carts + app.kubernetes.io/instance: carts app.kubernetes.io/component: service - app.kubernetes.io/instance: ui - app.kubernetes.io/name: ui - name: ui-lb - namespace: ui + app.kubernetes.io/managed-by: Helm spec: + type: ClusterIP ports: - - name: http - port: 80 - protocol: TCP - targetPort: http + - port: 80 + targetPort: http + protocol: TCP + name: http selector: + app.kubernetes.io/name: carts + app.kubernetes.io/instance: carts app.kubernetes.io/component: service - app.kubernetes.io/instance: ui - app.kubernetes.io/name: ui - type: LoadBalancer --- +# Source: carts/templates/deployment.yaml apiVersion: apps/v1 kind: Deployment metadata: + name: carts labels: - app.kubernetes.io/created-by: retail-store-sample - name: assets - namespace: assets + helm.sh/chart: carts-0.0.1 + app.kubernetes.io/name: carts + app.kubernetes.io/instance: carts + app.kubernetes.io/component: service + app.kubernetes.io/managed-by: Helm spec: replicas: 1 + strategy: + rollingUpdate: + maxUnavailable: 1 + type: RollingUpdate selector: matchLabels: + app.kubernetes.io/name: carts + app.kubernetes.io/instance: carts app.kubernetes.io/component: service - app.kubernetes.io/instance: assets - app.kubernetes.io/name: assets template: metadata: annotations: - prometheus.io/path: /metrics + prometheus.io/path: /actuator/prometheus prometheus.io/port: "8080" prometheus.io/scrape: "true" labels: + app.kubernetes.io/name: carts + app.kubernetes.io/instance: carts app.kubernetes.io/component: service - app.kubernetes.io/created-by: retail-store-sample - app.kubernetes.io/instance: assets - app.kubernetes.io/name: assets spec: + serviceAccountName: carts + securityContext: + fsGroup: 1000 containers: - - envFrom: - - configMapRef: - name: assets - image: public.ecr.aws/aws-containers/retail-store-sample-assets:0.2.0 - imagePullPolicy: IfNotPresent - livenessProbe: - httpGet: - path: /health.html - port: 8080 - initialDelaySeconds: 30 - periodSeconds: 3 - name: assets - ports: - - containerPort: 8080 - name: http - protocol: TCP - resources: - limits: - memory: 128Mi - requests: - cpu: 128m - memory: 128Mi - securityContext: - capabilities: - drop: - - ALL - readOnlyRootFilesystem: false - volumeMounts: - - mountPath: /tmp - name: tmp-volume - securityContext: {} - serviceAccountName: assets + - name: carts + env: + - name: JAVA_OPTS + value: -XX:MaxRAMPercentage=75.0 -Djava.security.egd=file:/dev/urandom + envFrom: + - configMapRef: + name: carts + securityContext: + capabilities: + drop: + - ALL + readOnlyRootFilesystem: true + runAsNonRoot: true + runAsUser: 1000 + image: "public.ecr.aws/aws-containers/retail-store-sample-cart:0.3.0" + imagePullPolicy: IfNotPresent + ports: + - name: http + containerPort: 8080 + protocol: TCP + livenessProbe: + httpGet: + path: /actuator/health/liveness + port: 8080 + initialDelaySeconds: 45 + periodSeconds: 3 + resources: + limits: + memory: 512Mi + requests: + cpu: 128m + memory: 512Mi + volumeMounts: + - mountPath: /tmp + name: tmp-volume volumes: - - emptyDir: - medium: Memory - name: tmp-volume + - name: tmp-volume + emptyDir: + medium: Memory --- +# Source: carts/templates/dynamodb-deployment.yaml apiVersion: apps/v1 kind: Deployment metadata: + name: carts-dynamodb labels: - app.kubernetes.io/created-by: retail-store-sample - app.kubernetes.io/type: app - name: carts - namespace: carts + helm.sh/chart: carts-0.0.1 + app.kubernetes.io/name: carts + app.kubernetes.io/instance: carts + app.kubernetes.io/component: dynamodb + app.kubernetes.io/managed-by: Helm spec: replicas: 1 selector: matchLabels: - app.kubernetes.io/component: service - app.kubernetes.io/instance: carts app.kubernetes.io/name: carts + app.kubernetes.io/instance: carts + app.kubernetes.io/component: dynamodb template: metadata: - annotations: - prometheus.io/path: /actuator/prometheus - prometheus.io/port: "80801" - prometheus.io/scrape: "true" labels: - app.kubernetes.io/component: service - app.kubernetes.io/created-by: retail-store-sample - app.kubernetes.io/instance: carts app.kubernetes.io/name: carts + app.kubernetes.io/instance: carts + app.kubernetes.io/component: dynamodb spec: containers: - - env: - - name: JAVA_OPTS - value: -XX:MaxRAMPercentage=75.0 -Djava.security.egd=file:/dev/urandom - - name: SPRING_PROFILES_ACTIVE - value: dynamodb - envFrom: - - configMapRef: - name: carts - image: public.ecr.aws/aws-containers/retail-store-sample-cart:0.2.0 - imagePullPolicy: IfNotPresent - livenessProbe: - httpGet: - path: /actuator/health/liveness - port: 8080 - initialDelaySeconds: 45 - periodSeconds: 3 - name: carts - ports: - - containerPort: 8080 - name: http - protocol: TCP - resources: - limits: - memory: 512Mi - requests: - cpu: 128m - memory: 512Mi - securityContext: - capabilities: - drop: - - ALL - readOnlyRootFilesystem: true - runAsNonRoot: true - runAsUser: 1000 - volumeMounts: - - mountPath: /tmp - name: tmp-volume - securityContext: - fsGroup: 1000 - serviceAccountName: carts - volumes: - - emptyDir: - medium: Memory - name: tmp-volume + - name: dynamodb + image: "amazon/dynamodb-local:1.13.1" + imagePullPolicy: IfNotPresent + ports: + - name: dynamodb + containerPort: 8000 + protocol: TCP +--- +# Source: carts/templates/tests/test-connection.yaml +apiVersion: v1 +kind: Pod +metadata: + name: "carts-test-connection" + labels: + helm.sh/chart: carts-0.0.1 + app.kubernetes.io/name: carts + app.kubernetes.io/instance: carts + app.kubernetes.io/component: service + app.kubernetes.io/managed-by: Helm + annotations: + "helm.sh/hook": test-success +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['carts:80'] + restartPolicy: Never + +--- +# Source: orders/templates/serviceaccount.yaml +apiVersion: v1 +kind: ServiceAccount +metadata: + name: orders + labels: + helm.sh/chart: orders-0.0.1 + app.kubernetes.io/name: orders + app.kubernetes.io/instance: orders + app.kubernetes.io/component: service + app.kubernetes.io/managed-by: Helm +--- +# Source: orders/templates/mysql-secret.yaml +apiVersion: v1 +kind: Secret +metadata: + name: orders-db +data: + username: "b3JkZXJz" + password: "QjdwQkxUWXNFZHgxbFpCWg==" +--- +# Source: orders/templates/rabbitmq-secret.yaml +apiVersion: v1 +kind: Secret +metadata: + name: orders-rabbitmq +data: +--- +# Source: orders/templates/configmap.yml +apiVersion: v1 +kind: ConfigMap +metadata: + name: orders +data: + SPRING_PROFILES_ACTIVE: mysql,rabbitmq + SPRING_DATASOURCE_READER_URL: jdbc:mariadb://orders-mysql:3306/orders + SPRING_DATASOURCE_WRITER_URL: jdbc:mariadb://orders-mysql:3306/orders + SPRING_RABBITMQ_ADDRESSES: amqp://orders-rabbitmq:5672 +--- +# Source: orders/templates/mysql-service.yaml +apiVersion: v1 +kind: Service +metadata: + name: orders-mysql + labels: + helm.sh/chart: orders-0.0.1 + app.kubernetes.io/name: orders + app.kubernetes.io/instance: orders + app.kubernetes.io/component: mysql + app.kubernetes.io/managed-by: Helm +spec: + type: ClusterIP + ports: + - port: 3306 + targetPort: mysql + protocol: TCP + name: mysql + selector: + app.kubernetes.io/name: orders + app.kubernetes.io/instance: orders + app.kubernetes.io/component: mysql +--- +# Source: orders/templates/rabbitmq-service.yaml +apiVersion: v1 +kind: Service +metadata: + name: orders-rabbitmq + labels: + helm.sh/chart: orders-0.0.1 + app.kubernetes.io/name: orders + app.kubernetes.io/instance: orders + app.kubernetes.io/component: rabbitmq + app.kubernetes.io/managed-by: Helm +spec: + type: ClusterIP + ports: + - port: 5672 + targetPort: amqp + protocol: TCP + name: amqp + - port: 15672 + targetPort: http + protocol: TCP + name: http + selector: + app.kubernetes.io/name: orders + app.kubernetes.io/instance: orders + app.kubernetes.io/component: rabbitmq +--- +# Source: orders/templates/service.yaml +apiVersion: v1 +kind: Service +metadata: + name: orders + labels: + helm.sh/chart: orders-0.0.1 + app.kubernetes.io/name: orders + app.kubernetes.io/instance: orders + app.kubernetes.io/component: service + app.kubernetes.io/managed-by: Helm +spec: + type: ClusterIP + ports: + - port: 80 + targetPort: http + protocol: TCP + name: http + selector: + app.kubernetes.io/name: orders + app.kubernetes.io/instance: orders + app.kubernetes.io/component: service --- +# Source: orders/templates/deployment.yaml apiVersion: apps/v1 kind: Deployment metadata: + name: orders labels: - app.kubernetes.io/created-by: retail-store-sample - app.kubernetes.io/team: database - name: carts-dynamodb - namespace: carts + helm.sh/chart: orders-0.0.1 + app.kubernetes.io/name: orders + app.kubernetes.io/instance: orders + app.kubernetes.io/component: service + app.kubernetes.io/managed-by: Helm spec: replicas: 1 + strategy: + rollingUpdate: + maxUnavailable: 1 + type: RollingUpdate selector: matchLabels: - app.kubernetes.io/component: dynamodb - app.kubernetes.io/instance: carts - app.kubernetes.io/name: carts + app.kubernetes.io/name: orders + app.kubernetes.io/instance: orders + app.kubernetes.io/component: service template: metadata: + annotations: + prometheus.io/path: /actuator/prometheus + prometheus.io/port: "8080" + prometheus.io/scrape: "true" labels: - app.kubernetes.io/component: dynamodb - app.kubernetes.io/created-by: retail-store-sample - app.kubernetes.io/instance: carts - app.kubernetes.io/name: carts - app.kubernetes.io/team: database + app.kubernetes.io/name: orders + app.kubernetes.io/instance: orders + app.kubernetes.io/component: service spec: + serviceAccountName: orders + securityContext: + fsGroup: 1000 containers: - - image: amazon/dynamodb-local:1.13.1 - imagePullPolicy: IfNotPresent - name: dynamodb - ports: - - containerPort: 8000 - name: dynamodb - protocol: TCP + - name: orders + env: + - name: JAVA_OPTS + value: -XX:MaxRAMPercentage=75.0 -Djava.security.egd=file:/dev/urandom + - name: SPRING_DATASOURCE_WRITER_USERNAME + valueFrom: + secretKeyRef: + name: orders-db + key: username + - name: SPRING_DATASOURCE_WRITER_PASSWORD + valueFrom: + secretKeyRef: + name: orders-db + key: password + - name: SPRING_DATASOURCE_READER_USERNAME + valueFrom: + secretKeyRef: + name: orders-db + key: username + - name: SPRING_DATASOURCE_READER_PASSWORD + valueFrom: + secretKeyRef: + name: orders-db + key: password + envFrom: + - secretRef: + name: orders-rabbitmq + - configMapRef: + name: orders + securityContext: + capabilities: + drop: + - ALL + readOnlyRootFilesystem: true + runAsNonRoot: true + runAsUser: 1000 + image: "public.ecr.aws/aws-containers/retail-store-sample-orders:0.3.0" + imagePullPolicy: IfNotPresent + ports: + - name: http + containerPort: 8080 + protocol: TCP + livenessProbe: + httpGet: + path: /actuator/health/liveness + port: 8080 + initialDelaySeconds: 45 + periodSeconds: 3 + resources: + limits: + memory: 512Mi + requests: + cpu: 128m + memory: 512Mi + volumeMounts: + - mountPath: /tmp + name: tmp-volume + volumes: + - name: tmp-volume + emptyDir: + medium: Memory --- +# Source: orders/templates/mysql-statefulset.yaml apiVersion: apps/v1 -kind: Deployment +kind: StatefulSet metadata: + name: orders-mysql labels: - app.kubernetes.io/created-by: retail-store-sample - app.kubernetes.io/type: app - name: catalog - namespace: catalog + helm.sh/chart: orders-0.0.1 + app.kubernetes.io/name: orders + app.kubernetes.io/instance: orders + app.kubernetes.io/component: mysql + app.kubernetes.io/managed-by: Helm spec: replicas: 1 + serviceName: orders-mysql selector: matchLabels: - app.kubernetes.io/component: service - app.kubernetes.io/instance: catalog - app.kubernetes.io/name: catalog + app.kubernetes.io/name: orders + app.kubernetes.io/instance: orders + app.kubernetes.io/component: mysql template: metadata: - annotations: - prometheus.io/path: /metrics - prometheus.io/port: "8080" - prometheus.io/scrape: "true" labels: - app.kubernetes.io/component: service - app.kubernetes.io/created-by: retail-store-sample - app.kubernetes.io/instance: catalog - app.kubernetes.io/name: catalog + app.kubernetes.io/name: orders + app.kubernetes.io/instance: orders + app.kubernetes.io/component: mysql spec: containers: - - env: - - name: DB_ENDPOINT - valueFrom: - secretKeyRef: - key: endpoint - name: catalog-db - - name: DB_USER - valueFrom: - secretKeyRef: - key: username - name: catalog-db - - name: DB_PASSWORD - valueFrom: - secretKeyRef: - key: password - name: catalog-db - - name: DB_READ_ENDPOINT - valueFrom: - secretKeyRef: - key: endpoint - name: catalog-db - - name: DB_NAME - valueFrom: - secretKeyRef: - key: name - name: catalog-db - envFrom: - - configMapRef: - name: catalog - image: public.ecr.aws/aws-containers/retail-store-sample-catalog:0.2.0 - imagePullPolicy: IfNotPresent - livenessProbe: - httpGet: - path: /health - port: 8080 - initialDelaySeconds: 30 - periodSeconds: 3 - name: catalog - ports: - - containerPort: 8080 - name: http - protocol: TCP - readinessProbe: - httpGet: - path: /health - port: 8080 - periodSeconds: 5 - successThreshold: 3 + - name: mysql + image: "mysql:5.7" + imagePullPolicy: IfNotPresent + env: + - name: MYSQL_ROOT_PASSWORD + value: my-secret-pw + - name: MYSQL_DATABASE + value: orders + - name: MYSQL_USER + valueFrom: + secretKeyRef: + name: orders-db + key: username + - name: MYSQL_PASSWORD + valueFrom: + secretKeyRef: + name: orders-db + key: password + args: + - "--ignore-db-dir=lost+found" + volumeMounts: + - name: data + mountPath: /var/lib/mysql + ports: + - name: mysql + containerPort: 3306 + protocol: TCP + volumeClaimTemplates: + - metadata: + name: data + spec: + accessModes: + - ReadWriteOnce resources: - limits: - memory: 256Mi - requests: - cpu: 128m - memory: 256Mi - securityContext: - capabilities: - drop: - - ALL - readOnlyRootFilesystem: true - runAsNonRoot: true - runAsUser: 1000 - volumeMounts: - - mountPath: /tmp - name: tmp-volume - securityContext: - fsGroup: 1000 - serviceAccountName: catalog - volumes: - - emptyDir: - medium: Memory - name: tmp-volume + requests: + storage: "10Gi" --- +# Source: orders/templates/rabbitmq-statefulset.yaml apiVersion: apps/v1 -kind: Deployment +kind: StatefulSet metadata: + name: orders-rabbitmq labels: - app.kubernetes.io/created-by: retail-store-sample - app.kubernetes.io/team: database - name: catalog-mysql - namespace: catalog + helm.sh/chart: orders-0.0.1 + app.kubernetes.io/name: orders + app.kubernetes.io/instance: orders + app.kubernetes.io/component: rabbitmq + app.kubernetes.io/managed-by: Helm spec: replicas: 1 + serviceName: orders-rabbitmq selector: matchLabels: - app.kubernetes.io/component: mysql - app.kubernetes.io/instance: catalog - app.kubernetes.io/name: catalog + app.kubernetes.io/name: orders + app.kubernetes.io/instance: orders + app.kubernetes.io/component: rabbitmq template: metadata: labels: - app.kubernetes.io/component: mysql - app.kubernetes.io/created-by: retail-store-sample - app.kubernetes.io/instance: catalog - app.kubernetes.io/name: catalog - app.kubernetes.io/team: database + app.kubernetes.io/name: orders + app.kubernetes.io/instance: orders + app.kubernetes.io/component: rabbitmq spec: containers: - - env: - - name: MYSQL_ROOT_PASSWORD - value: my-secret-pw - - name: MYSQL_USER - valueFrom: - secretKeyRef: - key: username - name: catalog-db - - name: MYSQL_PASSWORD - valueFrom: - secretKeyRef: - key: password - name: catalog-db - - name: MYSQL_DATABASE - valueFrom: - secretKeyRef: - key: name - name: catalog-db - image: mysql:5.7 - imagePullPolicy: IfNotPresent - name: mysql - ports: - - containerPort: 3306 - name: mysql - protocol: TCP + - name: rabbitmq + image: "rabbitmq:3-management" + imagePullPolicy: IfNotPresent + ports: + - name: amqp + containerPort: 5672 + protocol: TCP + - name: http + containerPort: 15672 + protocol: TCP + volumeMounts: + - name: data + mountPath: "/var/lib/rabbitmq/mnesia" + volumeClaimTemplates: + - metadata: + name: data + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: "10Gi" +--- +# Source: orders/templates/tests/test-connection.yaml +apiVersion: v1 +kind: Pod +metadata: + name: "orders-test-connection" + labels: + helm.sh/chart: orders-0.0.1 + app.kubernetes.io/name: orders + app.kubernetes.io/instance: orders + app.kubernetes.io/component: service + app.kubernetes.io/managed-by: Helm + annotations: + "helm.sh/hook": test-success +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['orders:80'] + restartPolicy: Never + +--- +# Source: checkout/templates/serviceaccount.yaml +apiVersion: v1 +kind: ServiceAccount +metadata: + name: checkout + labels: + helm.sh/chart: checkout-0.0.1 + app.kubernetes.io/name: checkout + app.kubernetes.io/instance: checkout + app.kubernetes.io/component: service + app.kubernetes.io/managed-by: Helm +--- +# Source: checkout/templates/configmap.yml +apiVersion: v1 +kind: ConfigMap +metadata: + name: checkout +data: + REDIS_URL: redis://checkout-redis:6379 + ENDPOINTS_ORDERS: http://orders:80 +--- +# Source: checkout/templates/redis-service.yaml +apiVersion: v1 +kind: Service +metadata: + name: checkout-redis + labels: + helm.sh/chart: checkout-0.0.1 + app.kubernetes.io/name: checkout + app.kubernetes.io/instance: checkout + app.kubernetes.io/component: redis + app.kubernetes.io/managed-by: Helm +spec: + type: ClusterIP + ports: + - port: 6379 + targetPort: redis + protocol: TCP + name: redis + selector: + app.kubernetes.io/name: checkout + app.kubernetes.io/instance: checkout + app.kubernetes.io/component: redis +--- +# Source: checkout/templates/service.yaml +apiVersion: v1 +kind: Service +metadata: + name: checkout + labels: + helm.sh/chart: checkout-0.0.1 + app.kubernetes.io/name: checkout + app.kubernetes.io/instance: checkout + app.kubernetes.io/component: service + app.kubernetes.io/managed-by: Helm +spec: + type: ClusterIP + ports: + - port: 80 + targetPort: http + protocol: TCP + name: http + selector: + app.kubernetes.io/name: checkout + app.kubernetes.io/instance: checkout + app.kubernetes.io/component: service --- +# Source: checkout/templates/deployment.yaml apiVersion: apps/v1 kind: Deployment metadata: - labels: - app.kubernetes.io/created-by: retail-store-sample - app.kubernetes.io/type: app name: checkout - namespace: checkout + labels: + helm.sh/chart: checkout-0.0.1 + app.kubernetes.io/name: checkout + app.kubernetes.io/instance: checkout + app.kubernetes.io/component: service + app.kubernetes.io/managed-by: Helm spec: replicas: 1 + strategy: + rollingUpdate: + maxUnavailable: 1 + type: RollingUpdate selector: matchLabels: - app.kubernetes.io/component: service - app.kubernetes.io/instance: checkout app.kubernetes.io/name: checkout + app.kubernetes.io/instance: checkout + app.kubernetes.io/component: service template: metadata: annotations: @@ -734,283 +1288,314 @@ spec: prometheus.io/port: "8080" prometheus.io/scrape: "true" labels: - app.kubernetes.io/component: service - app.kubernetes.io/created-by: retail-store-sample - app.kubernetes.io/instance: checkout app.kubernetes.io/name: checkout + app.kubernetes.io/instance: checkout + app.kubernetes.io/component: service spec: - containers: - - envFrom: - - configMapRef: - name: checkout - image: public.ecr.aws/aws-containers/retail-store-sample-checkout:0.2.0 - imagePullPolicy: IfNotPresent - livenessProbe: - httpGet: - path: /health - port: 8080 - initialDelaySeconds: 30 - periodSeconds: 3 - name: checkout - ports: - - containerPort: 8080 - name: http - protocol: TCP - resources: - limits: - memory: 256Mi - requests: - cpu: 128m - memory: 256Mi - securityContext: - capabilities: - drop: - - ALL - readOnlyRootFilesystem: true - runAsNonRoot: true - runAsUser: 1000 - volumeMounts: - - mountPath: /tmp - name: tmp-volume + serviceAccountName: checkout securityContext: fsGroup: 1000 - serviceAccountName: checkout + containers: + - name: checkout + envFrom: + - configMapRef: + name: checkout + securityContext: + capabilities: + drop: + - ALL + readOnlyRootFilesystem: true + runAsNonRoot: true + runAsUser: 1000 + image: "public.ecr.aws/aws-containers/retail-store-sample-checkout:0.3.0" + imagePullPolicy: IfNotPresent + ports: + - name: http + containerPort: 8080 + protocol: TCP + livenessProbe: + httpGet: + path: /health + port: 8080 + initialDelaySeconds: 30 + periodSeconds: 3 + resources: + limits: + memory: 256Mi + requests: + cpu: 128m + memory: 256Mi + volumeMounts: + - mountPath: /tmp + name: tmp-volume volumes: - - emptyDir: - medium: Memory - name: tmp-volume + - name: tmp-volume + emptyDir: + medium: Memory --- +# Source: checkout/templates/redis-deployment.yaml apiVersion: apps/v1 kind: Deployment metadata: - labels: - app.kubernetes.io/created-by: retail-store-sample - app.kubernetes.io/team: database name: checkout-redis - namespace: checkout + labels: + helm.sh/chart: checkout-0.0.1 + app.kubernetes.io/name: checkout + app.kubernetes.io/instance: checkout + app.kubernetes.io/component: redis + app.kubernetes.io/managed-by: Helm spec: replicas: 1 selector: matchLabels: - app.kubernetes.io/component: redis - app.kubernetes.io/instance: checkout app.kubernetes.io/name: checkout + app.kubernetes.io/instance: checkout + app.kubernetes.io/component: redis template: metadata: labels: - app.kubernetes.io/component: redis - app.kubernetes.io/created-by: retail-store-sample - app.kubernetes.io/instance: checkout app.kubernetes.io/name: checkout - app.kubernetes.io/team: database + app.kubernetes.io/instance: checkout + app.kubernetes.io/component: redis spec: containers: - - image: redis:6.0-alpine - imagePullPolicy: IfNotPresent - name: redis - ports: - - containerPort: 6379 - name: redis - protocol: TCP + - name: redis + image: "redis:6.0-alpine" + imagePullPolicy: IfNotPresent + ports: + - name: redis + containerPort: 6379 + protocol: TCP +--- +# Source: checkout/templates/tests/test-connection.yaml +apiVersion: v1 +kind: Pod +metadata: + name: "checkout-test-connection" + labels: + helm.sh/chart: checkout-0.0.1 + app.kubernetes.io/name: checkout + app.kubernetes.io/instance: checkout + app.kubernetes.io/component: service + app.kubernetes.io/managed-by: Helm + annotations: + "helm.sh/hook": test-success +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['checkout:80'] + restartPolicy: Never + +--- +# Source: assets/templates/serviceaccount.yaml +apiVersion: v1 +kind: ServiceAccount +metadata: + name: assets + labels: + helm.sh/chart: assets-0.0.1 + app.kubernetes.io/name: assets + app.kubernetes.io/instance: assets + app.kubernetes.io/component: service + app.kubernetes.io/managed-by: Helm +--- +# Source: assets/templates/configmap.yml +apiVersion: v1 +kind: ConfigMap +metadata: + name: assets +data: + PORT: '8080' +--- +# Source: assets/templates/service.yaml +apiVersion: v1 +kind: Service +metadata: + name: assets + labels: + helm.sh/chart: assets-0.0.1 + app.kubernetes.io/name: assets + app.kubernetes.io/instance: assets + app.kubernetes.io/component: service + app.kubernetes.io/managed-by: Helm +spec: + type: ClusterIP + ports: + - port: 80 + targetPort: http + protocol: TCP + name: http + selector: + app.kubernetes.io/name: assets + app.kubernetes.io/instance: assets + app.kubernetes.io/component: service --- +# Source: assets/templates/deployment.yaml apiVersion: apps/v1 kind: Deployment metadata: + name: assets labels: - app.kubernetes.io/created-by: retail-store-sample - app.kubernetes.io/type: app - name: orders - namespace: orders + helm.sh/chart: assets-0.0.1 + app.kubernetes.io/name: assets + app.kubernetes.io/instance: assets + app.kubernetes.io/component: service + app.kubernetes.io/managed-by: Helm spec: replicas: 1 + strategy: + rollingUpdate: + maxUnavailable: 1 + type: RollingUpdate selector: matchLabels: + app.kubernetes.io/name: assets + app.kubernetes.io/instance: assets app.kubernetes.io/component: service - app.kubernetes.io/instance: orders - app.kubernetes.io/name: orders template: metadata: annotations: - prometheus.io/path: /actuator/prometheus + prometheus.io/path: /metrics prometheus.io/port: "8080" prometheus.io/scrape: "true" labels: + app.kubernetes.io/name: assets + app.kubernetes.io/instance: assets app.kubernetes.io/component: service - app.kubernetes.io/instance: orders - app.kubernetes.io/name: orders spec: - containers: - - env: - - name: JAVA_OPTS - value: -XX:MaxRAMPercentage=75.0 -Djava.security.egd=file:/dev/urandom - - name: SPRING_DATASOURCE_WRITER_URL - valueFrom: - secretKeyRef: - key: url - name: orders-db - - name: SPRING_DATASOURCE_WRITER_USERNAME - valueFrom: - secretKeyRef: - key: username - name: orders-db - - name: SPRING_DATASOURCE_WRITER_PASSWORD - valueFrom: - secretKeyRef: - key: password - name: orders-db - - name: SPRING_DATASOURCE_READER_URL - valueFrom: - secretKeyRef: - key: url - name: orders-db - - name: SPRING_DATASOURCE_READER_USERNAME - valueFrom: - secretKeyRef: - key: username - name: orders-db - - name: SPRING_DATASOURCE_READER_PASSWORD - valueFrom: - secretKeyRef: - key: password - name: orders-db - envFrom: - - configMapRef: - name: orders - image: public.ecr.aws/aws-containers/retail-store-sample-orders:0.2.0 - imagePullPolicy: IfNotPresent - livenessProbe: - httpGet: - path: /actuator/health/liveness - port: 8080 - initialDelaySeconds: 45 - periodSeconds: 3 - name: orders - ports: - - containerPort: 8080 - name: http - protocol: TCP - readinessProbe: - httpGet: - path: /actuator/health/liveness - port: 8080 - periodSeconds: 5 - successThreshold: 3 - resources: - limits: - memory: 512Mi - requests: - cpu: 128m - memory: 512Mi - securityContext: - capabilities: - drop: - - ALL - readOnlyRootFilesystem: true - runAsNonRoot: true - runAsUser: 1000 - volumeMounts: - - mountPath: /tmp - name: tmp-volume + serviceAccountName: assets securityContext: - fsGroup: 1000 - serviceAccountName: orders + {} + containers: + - name: assets + envFrom: + - configMapRef: + name: assets + securityContext: + capabilities: + drop: + - ALL + readOnlyRootFilesystem: false + image: "public.ecr.aws/aws-containers/retail-store-sample-assets:0.3.0" + imagePullPolicy: IfNotPresent + ports: + - name: http + containerPort: 8080 + protocol: TCP + livenessProbe: + httpGet: + path: /health.html + port: 8080 + initialDelaySeconds: 30 + periodSeconds: 3 + resources: + limits: + memory: 128Mi + requests: + cpu: 128m + memory: 128Mi + volumeMounts: + - mountPath: /tmp + name: tmp-volume volumes: - - emptyDir: - medium: Memory - name: tmp-volume + - name: tmp-volume + emptyDir: + medium: Memory --- -apiVersion: apps/v1 -kind: Deployment +# Source: assets/templates/tests/test-connection.yaml +apiVersion: v1 +kind: Pod metadata: - name: orders-mysql - namespace: orders + name: "assets-test-connection" + labels: + helm.sh/chart: assets-0.0.1 + app.kubernetes.io/name: assets + app.kubernetes.io/instance: assets + app.kubernetes.io/component: service + app.kubernetes.io/managed-by: Helm + annotations: + "helm.sh/hook": test-success spec: - replicas: 1 - selector: - matchLabels: - app.kubernetes.io/component: mysql - app.kubernetes.io/instance: orders - app.kubernetes.io/name: orders - template: - metadata: - labels: - app.kubernetes.io/component: mysql - app.kubernetes.io/instance: orders - app.kubernetes.io/name: orders - spec: - containers: - - env: - - name: MYSQL_ROOT_PASSWORD - value: my-secret-pw - - name: MYSQL_USER - valueFrom: - secretKeyRef: - key: username - name: orders-db - - name: MYSQL_PASSWORD - valueFrom: - secretKeyRef: - key: password - name: orders-db - - name: MYSQL_DATABASE - valueFrom: - secretKeyRef: - key: name - name: orders-db - image: mysql:5.7 - imagePullPolicy: IfNotPresent - name: mysql - ports: - - containerPort: 3306 - name: mysql - protocol: TCP + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['assets:80'] + restartPolicy: Never + --- -apiVersion: apps/v1 -kind: Deployment +# Source: ui/templates/serviceaccount.yaml +apiVersion: v1 +kind: ServiceAccount +metadata: + name: ui + labels: + helm.sh/chart: ui-0.0.1 + app.kubernetes.io/name: ui + app.kubernetes.io/instance: ui + app.kubernetes.io/component: service + app.kubernetes.io/managed-by: Helm +--- +# Source: ui/templates/configmap.yml +apiVersion: v1 +kind: ConfigMap +metadata: + name: ui +data: + + ENDPOINTS_CATALOG: http://catalog + ENDPOINTS_CARTS: http://carts + ENDPOINTS_CHECKOUT: http://checkout + ENDPOINTS_ORDERS: http://orders + ENDPOINTS_ASSETS: http://assets +--- +# Source: ui/templates/service.yaml +apiVersion: v1 +kind: Service metadata: - name: rabbitmq - namespace: rabbitmq + name: ui + labels: + helm.sh/chart: ui-0.0.1 + app.kubernetes.io/name: ui + app.kubernetes.io/instance: ui + app.kubernetes.io/component: service + app.kubernetes.io/managed-by: Helm spec: - replicas: 1 + type: ClusterIP + ports: + - port: 80 + targetPort: http + protocol: TCP + name: http selector: - matchLabels: - app.kubernetes.io/component: rabbitmq - app.kubernetes.io/instance: rabbitmq - app.kubernetes.io/name: rabbitmq - template: - metadata: - labels: - app.kubernetes.io/component: rabbitmq - app.kubernetes.io/instance: rabbitmq - app.kubernetes.io/name: rabbitmq - spec: - containers: - - image: rabbitmq:3-management - imagePullPolicy: IfNotPresent - name: rabbitmq - ports: - - containerPort: 5672 - name: amqp - protocol: TCP - - containerPort: 15672 - name: http - protocol: TCP + app.kubernetes.io/name: ui + app.kubernetes.io/instance: ui + app.kubernetes.io/component: service --- +# Source: ui/templates/deployment.yaml apiVersion: apps/v1 kind: Deployment metadata: - labels: - app.kubernetes.io/created-by: retail-store-sample - app.kubernetes.io/type: app name: ui - namespace: ui + labels: + helm.sh/chart: ui-0.0.1 + app.kubernetes.io/name: ui + app.kubernetes.io/instance: ui + app.kubernetes.io/component: service + app.kubernetes.io/managed-by: Helm spec: replicas: 1 + strategy: + rollingUpdate: + maxUnavailable: 1 + type: RollingUpdate selector: matchLabels: - app.kubernetes.io/component: service - app.kubernetes.io/instance: ui app.kubernetes.io/name: ui + app.kubernetes.io/instance: ui + app.kubernetes.io/component: service template: metadata: annotations: @@ -1018,53 +1603,74 @@ spec: prometheus.io/port: "8080" prometheus.io/scrape: "true" labels: - app.kubernetes.io/component: service - app.kubernetes.io/created-by: retail-store-sample - app.kubernetes.io/instance: ui app.kubernetes.io/name: ui + app.kubernetes.io/instance: ui + app.kubernetes.io/component: service spec: - containers: - - env: - - name: JAVA_OPTS - value: -XX:MaxRAMPercentage=75.0 -Djava.security.egd=file:/dev/urandom - envFrom: - - configMapRef: - name: ui - image: public.ecr.aws/aws-containers/retail-store-sample-ui:0.2.0 - imagePullPolicy: IfNotPresent - livenessProbe: - httpGet: - path: /actuator/health/liveness - port: 8080 - initialDelaySeconds: 45 - periodSeconds: 20 - name: ui - ports: - - containerPort: 8080 - name: http - protocol: TCP - resources: - limits: - memory: 512Mi - requests: - cpu: 128m - memory: 512Mi - securityContext: - capabilities: - add: - - NET_BIND_SERVICE - drop: - - ALL - readOnlyRootFilesystem: true - runAsNonRoot: true - runAsUser: 1000 - volumeMounts: - - mountPath: /tmp - name: tmp-volume + serviceAccountName: ui securityContext: fsGroup: 1000 - serviceAccountName: ui + containers: + - name: ui + env: + - name: JAVA_OPTS + value: -XX:MaxRAMPercentage=75.0 -Djava.security.egd=file:/dev/urandom + envFrom: + - configMapRef: + name: ui + securityContext: + capabilities: + add: + - NET_BIND_SERVICE + drop: + - ALL + readOnlyRootFilesystem: true + runAsNonRoot: true + runAsUser: 1000 + image: "public.ecr.aws/aws-containers/retail-store-sample-ui:0.3.0" + imagePullPolicy: IfNotPresent + ports: + - name: http + containerPort: 8080 + protocol: TCP + livenessProbe: + httpGet: + path: /actuator/health/liveness + port: 8080 + initialDelaySeconds: 45 + periodSeconds: 3 + resources: + limits: + memory: 512Mi + requests: + cpu: 128m + memory: 512Mi + volumeMounts: + - mountPath: /tmp + name: tmp-volume volumes: - - emptyDir: - medium: Memory - name: tmp-volume + - name: tmp-volume + emptyDir: + medium: Memory +--- +# Source: ui/templates/tests/test-connection.yaml +apiVersion: v1 +kind: Pod +metadata: + name: "ui-test-connection" + labels: + helm.sh/chart: ui-0.0.1 + app.kubernetes.io/name: ui + app.kubernetes.io/instance: ui + app.kubernetes.io/component: service + app.kubernetes.io/managed-by: Helm + annotations: + "helm.sh/hook": test-success +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['ui:80'] + restartPolicy: Never +