Pablo Solar VilariƱo
2020-06-11 d4a550812d90f1f23e74ba6bae81b74d74bec907
Renamed adopt-a-pup- service names and changed kubefiles to use Red Hat Training images (#45)

1 files added
11 files modified
227 ■■■■■ changed files
adopt-a-pup/Readme.MD 1 ●●●● patch | view | raw | blame | history
adopt-a-pup/adoption-service/src/main/resources/application.properties 6 ●●●● patch | view | raw | blame | history
adopt-a-pup/animal-service/src/main/resources/application.properties 2 ●●● patch | view | raw | blame | history
adopt-a-pup/kubefiles/adoption-service.yaml 37 ●●●● patch | view | raw | blame | history
adopt-a-pup/kubefiles/animal-service.yaml 37 ●●●● patch | view | raw | blame | history
adopt-a-pup/kubefiles/email-service.yaml 18 ●●●● patch | view | raw | blame | history
adopt-a-pup/kubefiles/frontend-template.yaml 34 ●●●● patch | view | raw | blame | history
adopt-a-pup/kubefiles/notification-service.yaml 37 ●●●● patch | view | raw | blame | history
adopt-a-pup/kubefiles/service-mesh.yaml 14 ●●●●● patch | view | raw | blame | history
adopt-a-pup/kubefiles/shelter-service.yaml 37 ●●●● patch | view | raw | blame | history
adopt-a-pup/notification-service/src/main/resources/application.properties 2 ●●● patch | view | raw | blame | history
adopt-a-pup/scripts/deploy-frontend.sh 2 ●●●●● patch | view | raw | blame | history
adopt-a-pup/Readme.MD
@@ -60,6 +60,7 @@
7. Deploy the backend services.
    ```
    oc apply -f kubefiles/service-mesh.yaml
    oc apply -f kubefiles/adoption-service.yaml
    oc apply -f kubefiles/animal-service.yaml
    oc apply -f kubefiles/email-service.yaml
adopt-a-pup/adoption-service/src/main/resources/application.properties
@@ -1,3 +1,3 @@
notificationService.host=http://notification-service:8080
animalService.host=http://animal-service:8080
shelterService.host=http://shelter-service:8080
notificationService.host=http://notification:8080
animalService.host=http://animal:8080
shelterService.host=http://shelter:8080
adopt-a-pup/animal-service/src/main/resources/application.properties
@@ -1,4 +1,4 @@
notificationService.host=http://notification-service:8080
notificationService.host=http://notification:8080
spring.data.mongodb.host=mongodb
spring.data.mongodb.database=adopt-a-pup
spring.data.mongodb.password=developer
adopt-a-pup/kubefiles/adoption-service.yaml
@@ -1,22 +1,22 @@
apiVersion: apps/v1
kind: Deployment
metadata:
  name: adoption-service
  name: adoption
spec:
  selector:
    matchLabels:
      app: adoption-service
      app: adoption
  replicas: 1
  template:
    metadata:
      labels:
        app: adoption-service
        app: adoption
      annotations:
        sidecar.istio.io/inject: "true"
    spec:
      containers:
        - name: adoption-service
          image: quay.io/psolarvi/ossm-adoption-service:1.0
        - name: adoption
          image: quay.io/redhattraining/ossm-adoption-service:1.0
          imagePullPolicy: Always
          ports:
            - containerPort: 8080
@@ -25,46 +25,31 @@
kind: Service
metadata:
  labels:
    app: adoption-service
  name: adoption-service
    app: adoption
  name: adoption
spec:
  ports:
    - port: 8080
      protocol: TCP
      targetPort: 8080
  selector:
    app: adoption-service
---
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: adoption-service-gw
spec:
  selector:
    istio: ingressgateway
  servers:
    - port:
        number: 80
        name: http
        protocol: HTTP
      hosts:
        - "*"
    app: adoption
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: adoption-service-vs
  name: adoption
spec:
  hosts:
    - "*"
  gateways:
    - adoption-service-gw
    - adoptapup-gateway
  http:
    - match:
        - uri:
            prefix: /adoption
      route:
        - destination:
            host: adoption-service
            host: adoption
            port:
              number: 8080
adopt-a-pup/kubefiles/animal-service.yaml
@@ -1,22 +1,22 @@
apiVersion: apps/v1
kind: Deployment
metadata:
  name: animal-service
  name: animal
spec:
  selector:
    matchLabels:
      app: animal-service
      app: animal
  replicas: 1
  template:
    metadata:
      labels:
        app: animal-service
        app: animal
      annotations:
        sidecar.istio.io/inject: "true"
    spec:
      containers:
        - name: animal-service
          image: quay.io/psolarvi/ossm-animal-service:1.0
        - name: animal
          image: quay.io/redhattraining/ossm-animal-service:1.0
          imagePullPolicy: Always
          ports:
            - containerPort: 8080
@@ -25,46 +25,31 @@
kind: Service
metadata:
  labels:
    app: animal-service
  name: animal-service
    app: animal
  name: animal
spec:
  ports:
    - port: 8080
      protocol: TCP
      targetPort: 8080
  selector:
    app: animal-service
---
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: animal-service-gw
spec:
  selector:
    istio: ingressgateway
  servers:
    - port:
        number: 80
        name: http
        protocol: HTTP
      hosts:
        - "*"
    app: animal
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: animal-service-vs
  name: animal
spec:
  hosts:
    - "*"
  gateways:
    - animal-service-gw
    - adoptapup-gateway
  http:
    - match:
        - uri:
            prefix: /animals
      route:
        - destination:
            host: animal-service
            host: animal
            port:
              number: 8080
adopt-a-pup/kubefiles/email-service.yaml
@@ -1,19 +1,19 @@
apiVersion: apps/v1
kind: Deployment
metadata:
  name: email-service
  name: email
spec:
  selector:
    matchLabels:
      app: email-service
      app: email
  replicas: 1
  template:
    metadata:
      labels:
        app: email-service
        app: email
    spec:
      containers:
        - name: email-service
        - name: email
          image: maildev/maildev:latest
          imagePullPolicy: Always
          command: ["bin/maildev"]
@@ -28,8 +28,8 @@
kind: Service
metadata:
  labels:
    app: email-service
  name: email-service
    app: email
  name: email
spec:
  ports:
    - port: 8080
@@ -41,17 +41,17 @@
      protocol: TCP
      targetPort: 1025
  selector:
    app: email-service
    app: email
---
kind: Route
apiVersion: route.openshift.io/v1
metadata:
  name: email
  labels:
    app: email-service
    app: email
spec:
  to:
    kind: Service
    name: email-service
    name: email
  port:
    targetPort: 8080
adopt-a-pup/kubefiles/frontend-template.yaml
@@ -8,21 +8,21 @@
  - apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: frontend-service
      name: frontend
    spec:
      selector:
        matchLabels:
          app: frontend-service
          app: frontend
      replicas: 1
      template:
        metadata:
          labels:
            app: frontend-service
            app: frontend
          annotations:
            sidecar.istio.io/inject: "true"
        spec:
          containers:
            - name: frontend-service
            - name: frontend
              image: quay.io/redhattraining/ossm-adopt-a-pup-webapp:1.0
              imagePullPolicy: Always
              ports:
@@ -44,38 +44,24 @@
    kind: Service
    metadata:
      labels:
        app: frontend-service
      name: frontend-service
        app: frontend
      name: frontend
    spec:
      ports:
        - port: 3000
          protocol: TCP
          targetPort: 8080
      selector:
        app: frontend-service
  - apiVersion: networking.istio.io/v1alpha3
    kind: Gateway
    metadata:
      name: frontend-service-gw
    spec:
      selector:
        istio: ingressgateway
      servers:
        - port:
            number: 80
            name: http
            protocol: HTTP
          hosts:
            - "*"
        app: frontend
  - apiVersion: networking.istio.io/v1alpha3
    kind: VirtualService
    metadata:
      name: frontend-service-vs
      name: frontend
    spec:
      hosts:
        - "*"
      gateways:
        - frontend-service-gw
        - adoptapup-gateway
      http:
        - match:
            - uri:
@@ -84,7 +70,7 @@
            uri: /frontend
          route:
            - destination:
                host: frontend-service
                host: frontend
                port:
                  number: 3000
parameters:
adopt-a-pup/kubefiles/notification-service.yaml
@@ -1,22 +1,22 @@
apiVersion: apps/v1
kind: Deployment
metadata:
  name: notification-service
  name: notification
spec:
  selector:
    matchLabels:
      app: notification-service
      app: notification
  replicas: 1
  template:
    metadata:
      labels:
        app: notification-service
        app: notification
      annotations:
        sidecar.istio.io/inject: "true"
    spec:
      containers:
        - name: notification-service
          image: quay.io/psolarvi/ossm-notification-service:1.0
        - name: notification
          image: quay.io/redhattraining/ossm-notification-service:1.0
          imagePullPolicy: Always
          ports:
            - containerPort: 8080
@@ -25,46 +25,31 @@
kind: Service
metadata:
  labels:
    app: notification-service
  name: notification-service
    app: notification
  name: notification
spec:
  ports:
    - port: 8080
      protocol: TCP
      targetPort: 8080
  selector:
    app: notification-service
---
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: notification-service-gw
spec:
  selector:
    istio: ingressgateway
  servers:
    - port:
        number: 80
        name: http
        protocol: HTTP
      hosts:
        - "*"
    app: notification
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: notification-service-vs
  name: notification
spec:
  hosts:
    - "*"
  gateways:
    - notification-service-gw
    - adoptapup-gateway
  http:
    - match:
        - uri:
            prefix: /notifications
      route:
        - destination:
            host: notification-service
            host: notification
            port:
              number: 8080
adopt-a-pup/kubefiles/service-mesh.yaml
New file
@@ -0,0 +1,14 @@
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: adoptapup-gateway
spec:
  selector:
    istio: ingressgateway
  servers:
    - port:
        number: 80
        name: http
        protocol: HTTP
      hosts:
        - "*"
adopt-a-pup/kubefiles/shelter-service.yaml
@@ -1,22 +1,22 @@
apiVersion: apps/v1
kind: Deployment
metadata:
  name: shelter-service
  name: shelter
spec:
  selector:
    matchLabels:
      app: shelter-service
      app: shelter
  replicas: 1
  template:
    metadata:
      labels:
        app: shelter-service
        app: shelter
      annotations:
        sidecar.istio.io/inject: "true"
    spec:
      containers:
        - name: shelter-service
          image: quay.io/psolarvi/ossm-shelter-service:1.0
        - name: shelter
          image: quay.io/redhattraining/ossm-shelter-service:1.0
          imagePullPolicy: Always
          ports:
            - containerPort: 8080
@@ -25,46 +25,31 @@
kind: Service
metadata:
  labels:
    app: shelter-service
  name: shelter-service
    app: shelter
  name: shelter
spec:
  ports:
    - port: 8080
      protocol: TCP
      targetPort: 8080
  selector:
    app: shelter-service
---
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: shelter-service-gw
spec:
  selector:
    istio: ingressgateway
  servers:
    - port:
        number: 80
        name: http
        protocol: HTTP
      hosts:
        - "*"
    app: shelter
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: shelter-service-vs
  name: shelter
spec:
  hosts:
    - "*"
  gateways:
    - shelter-service-gw
    - adoptapup-gateway
  http:
    - match:
        - uri:
            prefix: /shelters
      route:
        - destination:
            host: shelter-service
            host: shelter
            port:
              number: 8080
adopt-a-pup/notification-service/src/main/resources/application.properties
@@ -1,3 +1,3 @@
spring.mail.host=email-service
spring.mail.host=email
spring.mail.port=25
spring.mail.properties.mail.transport.protocol=smtp
adopt-a-pup/scripts/deploy-frontend.sh
@@ -21,6 +21,7 @@
shelter_endpoint=${4:-${default_ingress_endpoint}}
news_enabled=${5:-1}
news_endpoint=${6:-"http://news-comprehensive-review-news.apps.ocp4.example.com"}
email_endpoint=${7:-"http://email-comprehensive-review.apps.ocp4.example.com/"}
oc process -n ${namespace} -f ./kubefiles/frontend-template.yaml \
  -p REACT_APP_ADOPTION_SERVICE_URL=${adoption_endpoint} \
@@ -28,4 +29,5 @@
  -p REACT_APP_SHELTER_SERVICE_URL=${shelter_endpoint} \
  -p REACT_APP_NEWS_ENABLED=${news_enabled} \
  -p REACT_APP_NEWS_SERVICE_URL=${news_endpoint} \
  -p REACT_APP_EMAIL_APP_URL=${email_endpoint} \
  | oc apply -n ${namespace} -f -