apiVersion: v1
kind: Service
metadata:
  name: router
  namespace: federation-example
spec:
  selector:
    app: router
  ports:
    - port: 4000
      targetPort: 4000
  type: LoadBalancer

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: router
  namespace: federation-example
spec:
  replicas: 1
  selector:
    matchLabels:
      app: router
  template:
    metadata:
      labels:
        app: router
    spec:
      containers:
        - name: router
          image: ghcr.io/apollographql/router:v1.34.0
          args:
            - --config
            - /dist/config/router.yaml
            - --supergraph
            - /dist/schema/supergraph.graphql
          ports:
            - containerPort: 4000
          volumeMounts:
            - name: schema
              mountPath: /dist/schema
            - name: config
              mountPath: /dist/config
      volumes:
        - name: schema
          configMap:
            name: router-schema
        - name: config
          configMap:
            name: router-config
