apiVersion: apps/v1 kind: StatefulSet metadata: name: fiesta namespace: nearle labels: app: fiesta spec: serviceName: "fiesta" replicas: 3 selector: matchLabels: app: fiesta template: metadata: labels: app: fiesta spec: tolerations: - key: dedicated operator: Equal value: apps effect: NoSchedule affinity: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: node-role.workolik/app operator: In values: - "true" podAntiAffinity: preferredDuringSchedulingIgnoredDuringExecution: - weight: 100 podAffinityTerm: labelSelector: matchLabels: app: fiesta topologyKey: kubernetes.io/hostname topologySpreadConstraints: - maxSkew: 1 topologyKey: kubernetes.io/hostname whenUnsatisfiable: ScheduleAnyway labelSelector: matchLabels: app: fiesta containers: - name: backend image: nearlecommerce/fiesta:v1.3.90 imagePullPolicy: Always securityContext: allowPrivilegeEscalation: false capabilities: drop: - ALL ports: - containerPort: 1122 envFrom: - configMapRef: name: nearle-config - secretRef: name: app-secrets env: - name: PORT value: "1122" - name: NATS_USER valueFrom: secretKeyRef: name: nats-credentials key: username - name: NATS_PASSWORD valueFrom: secretKeyRef: name: nats-credentials key: password - name: gateway image: workolik360/alaska:v1.2.0 imagePullPolicy: Always securityContext: allowPrivilegeEscalation: false capabilities: drop: - ALL ports: - containerPort: 8000 name: http volumeMounts: - name: gateway-script mountPath: /app/app.py subPath: app.py envFrom: - configMapRef: name: nearle-config env: - name: NATS_USER valueFrom: secretKeyRef: name: nats-credentials key: username - name: NATS_PASSWORD valueFrom: secretKeyRef: name: nats-credentials key: password volumes: - name: gateway-script configMap: name: fiesta-gateway-script --- apiVersion: v1 kind: Service metadata: name: fiesta namespace: nearle labels: app: fiesta spec: type: NodePort ports: - port: 80 targetPort: 1122 nodePort: 30823 protocol: TCP name: main - port: 8000 targetPort: 8000 name: gateway protocol: TCP selector: app: fiesta --- apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: name: fiesta-route namespace: nearle labels: app: fiesta spec: parentRefs: - name: gateway namespace: alaska hostnames: - "fiesta.nearle.app" rules: # mob/orders/createorder and web/products/create used to be routed to the # NATS gateway sidecar (port 8000, ConfigMap fiesta-gateway-script). That # sidecar publishes onto the shared "ORDERS"/"PRODUCTS" NATS subjects, # whose only consumer (worker-orders/worker-products in the core namespace) # has EXTERNAL_BASE_URL hardcoded to jupiter, not this backend. Fiesta has # no NATS consumer of its own, so every order/product submitted through # that path was silently created on jupiter (header-only, wrong schema) # instead of ever reaching CreateOrderv3 here. Both paths are already # registered directly on this backend (routes/orderroutes.go, # routes/productroutes.go), so route them straight through synchronously # via the catch-all rule below instead of overriding them to the sidecar. - matches: - path: type: PathPrefix value: / backendRefs: - name: fiesta port: 80