apiVersion: apps/v1
kind: Deployment
metadata:
  name: metrics-service
  namespace: system
  labels:
    app.kubernetes.io/name: metrics-service
    app.kubernetes.io/part-of: container-mom-operator
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: metrics-service
  template:
    metadata:
      labels:
        app.kubernetes.io/name: metrics-service
    spec:
      serviceAccountName: controller-manager
      containers:
      - name: metrics-service
        image: ghcr.io/${GITHUB_REPOSITORY_OWNER}/container-mom-metrics-service:latest
        resources:
          requests:
            cpu: "200m"
            memory: "256Mi"
          limits:
            cpu: "500m"
            memory: "512Mi"
        ports:
        - containerPort: 8080
          name: http
        env:
        - name: OTEL_EXPORTER_OTLP_ENDPOINT
          value: "http://otel-collector.monitoring:4317"
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: dns-service
  namespace: system
  labels:
    app.kubernetes.io/name: dns-service
    app.kubernetes.io/part-of: container-mom-operator
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: dns-service
  template:
    metadata:
      labels:
        app.kubernetes.io/name: dns-service
    spec:
      serviceAccountName: controller-manager
      containers:
      - name: dns-service
        image: ghcr.io/${GITHUB_REPOSITORY_OWNER}/container-mom-dns-manager:latest
        resources:
          requests:
            cpu: "100m"
            memory: "128Mi"
          limits:
            cpu: "300m"
            memory: "256Mi"
        ports:
        - containerPort: 8081
          name: http
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: billing-service
  namespace: system
  labels:
    app.kubernetes.io/name: billing-service
    app.kubernetes.io/part-of: container-mom-operator
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: billing-service
  template:
    metadata:
      labels:
        app.kubernetes.io/name: billing-service
    spec:
      serviceAccountName: controller-manager
      containers:
      - name: billing-service
        image: ghcr.io/${GITHUB_REPOSITORY_OWNER}/container-mom-billing-service:latest
        resources:
          requests:
            cpu: "100m"
            memory: "128Mi"
          limits:
            cpu: "200m"
            memory: "256Mi"
        ports:
        - containerPort: 8082
          name: http
        env:
        - name: STRIPE_API_KEY
          valueFrom:
            secretKeyRef:
              name: billing-secrets
              key: stripe-api-key
---
apiVersion: v1
kind: Service
metadata:
  name: metrics-service
  namespace: system
  labels:
    app.kubernetes.io/name: metrics-service
    app.kubernetes.io/part-of: container-mom-operator
spec:
  selector:
    app.kubernetes.io/name: metrics-service
  ports:
  - port: 8080
    targetPort: http
    name: http
---
apiVersion: v1
kind: Service
metadata:
  name: dns-service
  namespace: system
  labels:
    app.kubernetes.io/name: dns-service
    app.kubernetes.io/part-of: container-mom-operator
spec:
  selector:
    app.kubernetes.io/name: dns-service
  ports:
  - port: 8081
    targetPort: http
    name: http
---
apiVersion: v1
kind: Service
metadata:
  name: billing-service
  namespace: system
  labels:
    app.kubernetes.io/name: billing-service
    app.kubernetes.io/part-of: container-mom-operator
spec:
  selector:
    app.kubernetes.io/name: billing-service
  ports:
  - port: 8082
    targetPort: http
    name: http
