# Namespace
apiVersion: v1
kind: Namespace
metadata:
  name: dubbo-boutique-demo
---
apiVersion: v1
kind: Namespace
metadata:
  name: dubbo-system
---

# Nacos
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nacos
  namespace: dubbo-system
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nacos
  template:
    metadata:
      labels:
        app: nacos
    spec:
      containers:
        - name: consumer
          image: nacos-registry.cn-hangzhou.cr.aliyuncs.com/nacos/nacos-server:v2.1.2
          imagePullPolicy: Always
          resources:
            requests:
              memory: "2Gi"
              cpu: "500m"
          ports:
            - containerPort: 8848
              name: client
            - containerPort: 9848
              name: client-rpc
          env:
            - name: NACOS_SERVER_PORT
              value: "8848"
            - name: NACOS_APPLICATION_PORT
              value: "8848"
            - name: PREFER_HOST_MODE
              value: "hostname"
            - name: MODE
              value: "standalone"
            - name: NACOS_AUTH_ENABLE
              value: "true"
---
apiVersion: v1
kind: Service
metadata:
  name: nacos
  namespace: dubbo-system
spec:
  type: ClusterIP
  sessionAffinity: None
  selector:
    app: nacos
  ports:
    - port: 8848
      name: server
      targetPort: 8848
    - port: 9848
      name: client-rpc
      targetPort: 9848
---

# App frontend
apiVersion: apps/v1
kind: Deployment
metadata:
  name: frontend
  namespace: dubbo-boutique-demo
spec:
  replicas: 1
  selector:
    matchLabels:
      app: frontend
  template:
    metadata:
      labels:
        app: frontend
    spec:
      containers:
        - name: frontend
          image: sca-registry.cn-hangzhou.cr.aliyuncs.com/dubbo/online-boutique-frontend-service:1.0
          imagePullPolicy: Always
          ports:
            - name: dubbo
              containerPort: 20889
              protocol: TCP
            - name: dubbo
              containerPort: 9000
              protocol: TCP
          env:
            - name: JAVA_TOOL_OPTIONS
              value: "-Dnacos.address=nacos.dubbo-system.svc"
---

apiVersion: v1
kind: Service
metadata:
  name: frontend
  namespace: dubbo-boutique-demo
spec:
  type: ClusterIP
  selector:
    app: frontend
  ports:
    - protocol: tcp
      port: 20889
      targetPort: 20889
    - protocol: http
      port: 9000
      targetPort: 9000
---

# App ad-service
apiVersion: apps/v1
kind: Deployment
metadata:
  name: ad-service
  namespace: dubbo-boutique-demo
spec:
  replicas: 1
  selector:
    matchLabels:
      app: ad-service
  template:
    metadata:
      labels:
        app: ad-service
    spec:
      containers:
        - name: ad-service
          image: sca-registry.cn-hangzhou.cr.aliyuncs.com/dubbo/online-boutique-ad-service:1.0
          imagePullPolicy: Always
          ports:
            - name: dubbo
              containerPort: 20880
              protocol: TCP
          env:
            - name: JAVA_TOOL_OPTIONS
              value: "-Dnacos.address=nacos.dubbo-system.svc"
---

# App cart-service
apiVersion: apps/v1
kind: Deployment
metadata:
  name: cart-service
  namespace: dubbo-boutique-demo
spec:
  replicas: 1
  selector:
    matchLabels:
      app: cart-service
  template:
    metadata:
      labels:
        app: cart-service
    spec:
      containers:
        - name: cart-service
          image: sca-registry.cn-hangzhou.cr.aliyuncs.com/dubbo/online-boutique-cart-service:1.0
          imagePullPolicy: Always
          ports:
            - name: dubbo
              containerPort: 20881
              protocol: TCP
          env:
            - name: JAVA_TOOL_OPTIONS
              value: "-Dnacos.address=nacos.dubbo-system.svc"
---

# App checkout-service
apiVersion: apps/v1
kind: Deployment
metadata:
  name: checkout-service
  namespace: dubbo-boutique-demo
spec:
  replicas: 1
  selector:
    matchLabels:
      app: checkout-service
  template:
    metadata:
      labels:
        app: checkout-service
    spec:
      containers:
        - name: checkout-service
          image: sca-registry.cn-hangzhou.cr.aliyuncs.com/dubbo/online-boutique-checkout-service:1.0
          imagePullPolicy: Always
          ports:
            - name: dubbo
              containerPort: 20882
              protocol: TCP
          env:
            - name: JAVA_TOOL_OPTIONS
              value: "-Dnacos.address=nacos.dubbo-system.svc"
---

# App currency-service
apiVersion: apps/v1
kind: Deployment
metadata:
  name: currency-service
  namespace: dubbo-boutique-demo
spec:
  replicas: 1
  selector:
    matchLabels:
      app: currency-service
  template:
    metadata:
      labels:
        app: currency-service
    spec:
      containers:
        - name: currency-service
          image: sca-registry.cn-hangzhou.cr.aliyuncs.com/dubbo/online-boutique-currency-service:1.0
          imagePullPolicy: Always
          ports:
            - name: dubbo
              containerPort: 20883
              protocol: TCP
          env:
            - name: JAVA_TOOL_OPTIONS
              value: "-Dnacos.address=nacos.dubbo-system.svc"
---

# App email-service
apiVersion: apps/v1
kind: Deployment
metadata:
  name: email-service
  namespace: dubbo-boutique-demo
spec:
  replicas: 1
  selector:
    matchLabels:
      app: email-service
  template:
    metadata:
      labels:
        app: email-service
    spec:
      containers:
        - name: email-service
          image: sca-registry.cn-hangzhou.cr.aliyuncs.com/dubbo/online-boutique-email-service:1.0
          imagePullPolicy: Always
          ports:
            - name: dubbo
              containerPort: 20884
              protocol: TCP
          env:
            - name: JAVA_TOOL_OPTIONS
              value: "-Dnacos.address=nacos.dubbo-system.svc"
---

# App payment-service
apiVersion: apps/v1
kind: Deployment
metadata:
  name: payment-service
  namespace: dubbo-boutique-demo
spec:
  replicas: 1
  selector:
    matchLabels:
      app: payment-service
  template:
    metadata:
      labels:
        app: payment-service
    spec:
      containers:
        - name: payment-service
          image: sca-registry.cn-hangzhou.cr.aliyuncs.com/dubbo/online-boutique-payment-service:1.0
          imagePullPolicy: Always
          ports:
            - name: dubbo
              containerPort: 20885
              protocol: TCP
          env:
            - name: JAVA_TOOL_OPTIONS
              value: "-Dnacos.address=nacos.dubbo-system.svc"
---

# App product-catalogs-service
apiVersion: apps/v1
kind: Deployment
metadata:
  name: product-catalogs-service
  namespace: dubbo-boutique-demo
spec:
  replicas: 1
  selector:
    matchLabels:
      app: product-catalogs-service
  template:
    metadata:
      labels:
        app: product-catalogs-service
    spec:
      containers:
        - name: product-catalogs-service
          image: sca-registry.cn-hangzhou.cr.aliyuncs.com/dubbo/online-boutique-productcatalog-service:1.0
          imagePullPolicy: Always
          ports:
            - name: dubbo
              containerPort: 20886
              protocol: TCP
          env:
            - name: JAVA_TOOL_OPTIONS
              value: "-Dnacos.address=nacos.dubbo-system.svc"
---

# App recommendation-service
apiVersion: apps/v1
kind: Deployment
metadata:
  name: recommendation-service
  namespace: dubbo-boutique-demo
spec:
  replicas: 1
  selector:
    matchLabels:
      app: recommendation-service
  template:
    metadata:
      labels:
        app: recommendation-service
    spec:
      containers:
        - name: recommendation-service
          image: sca-registry.cn-hangzhou.cr.aliyuncs.com/dubbo/online-boutique-recommendation-service:1.0
          imagePullPolicy: Always
          ports:
            - name: dubbo
              containerPort: 20887
              protocol: TCP
          env:
            - name: JAVA_TOOL_OPTIONS
              value: "-Dnacos.address=nacos.dubbo-system.svc"
---

# App shipping-service
apiVersion: apps/v1
kind: Deployment
metadata:
  name: shipping-service
  namespace: dubbo-boutique-demo
spec:
  replicas: 1
  selector:
    matchLabels:
      app: shipping-service
  template:
    metadata:
      labels:
        app: shipping-service
    spec:
      containers:
        - name: shipping-service
          image: sca-registry.cn-hangzhou.cr.aliyuncs.com/dubbo/online-boutique-shipping-service:1.0
          imagePullPolicy: Always
          ports:
            - name: dubbo
              containerPort: 20888
              protocol: TCP
          env:
            - name: JAVA_TOOL_OPTIONS
              value: "-Dnacos.address=nacos.dubbo-system.svc"
---
