Pablo Solar VilariƱo
2020-06-11 d4a550812d90f1f23e74ba6bae81b74d74bec907
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
apiVersion: v1
kind: Template
metadata:
  name: frontend-template
  annotations:
    description: "Front end template"
objects:
  - apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: frontend
    spec:
      selector:
        matchLabels:
          app: frontend
      replicas: 1
      template:
        metadata:
          labels:
            app: frontend
          annotations:
            sidecar.istio.io/inject: "true"
        spec:
          containers:
            - name: frontend
              image: quay.io/redhattraining/ossm-adopt-a-pup-webapp:1.0
              imagePullPolicy: Always
              ports:
                - containerPort: 8080
              env:
                - name: REACT_APP_ADOPTION_SERVICE_URL
                  value: ${REACT_APP_ADOPTION_SERVICE_URL}
                - name: REACT_APP_ANIMAL_SERVICE_URL
                  value: ${REACT_APP_ANIMAL_SERVICE_URL}
                - name: REACT_APP_SHELTER_SERVICE_URL
                  value: ${REACT_APP_SHELTER_SERVICE_URL}
                - name: REACT_APP_NEWS_ENABLED
                  value: ${REACT_APP_NEWS_ENABLED}
                - name: REACT_APP_NEWS_SERVICE_URL
                  value: ${REACT_APP_NEWS_SERVICE_URL}
                - name: REACT_APP_EMAIL_APP_URL
                  value: ${REACT_APP_EMAIL_APP_URL}
  - apiVersion: v1
    kind: Service
    metadata:
      labels:
        app: frontend
      name: frontend
    spec:
      ports:
        - port: 3000
          protocol: TCP
          targetPort: 8080
      selector:
        app: frontend
  - apiVersion: networking.istio.io/v1alpha3
    kind: VirtualService
    metadata:
      name: frontend
    spec:
      hosts:
        - "*"
      gateways:
        - adoptapup-gateway
      http:
        - match:
            - uri:
                prefix: /frontend
          rewrite:
            uri: /frontend
          route:
            - destination:
                host: frontend
                port:
                  number: 3000
parameters:
  - name: REACT_APP_ADOPTION_SERVICE_URL
    description: "Adoption service endpoint"
    required: false
    value: "http://istio-ingressgateway-istio-system.apps.ocp4.example.com/"
  - name: REACT_APP_ANIMAL_SERVICE_URL
    description: "Animal service endpoint"
    required: false
    value: "http://istio-ingressgateway-istio-system.apps.ocp4.example.com/"
  - name: REACT_APP_SHELTER_SERVICE_URL
    description: "Shelter service endpoint"
    required: false
    value: "http://istio-ingressgateway-istio-system.apps.ocp4.example.com/"
  - name: REACT_APP_NEWS_ENABLED
    description: "Flag to enable the news section"
    required: false
    value: "1"
  - name: REACT_APP_NEWS_SERVICE_URL
    description: "News endpoint"
    required: false
    value: "http://news-comprehensive-review-news.apps.ocp4.example.com"
  - name: REACT_APP_EMAIL_APP_URL
    description: "Email dashboard URL"
    required: false
    value: "http://email-comprehensive-review.apps.ocp4.example.com/"