apiVersion: v1
kind: Service
metadata:
  name: community-detection
spec:
  type: LoadBalancer
  selector:
      app: community-detection
  ports:
    - name: http
      port: 80
      targetPort: 5000
      nodePort: 30109
      protocol: TCP
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: community-detection
spec:
  replicas: 1
  selector:
    matchLabels:
      app: community-detection
  template:
    metadata:
      labels:
        app: community-detection
    spec:
      containers:
      - name: community-detection
        image: alexx882/community-detection-microservice
        ports:
        - containerPort: 5000
---
apiVersion: v1
kind: Service
metadata:
  name: community-detection-db
spec:
  type: LoadBalancer
  selector:
      app: community-detection-db
  ports:
    - name: http
      port: 27017
      targetPort: 27017
      nodePort: 30110
      protocol: TCP
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: community-detection-db
spec:
  replicas: 1
  selector:
    matchLabels:
      app: community-detection-db
  template:
    metadata:
      labels:
        app: community-detection-db
    spec:
      containers:
      - name: community-detection-db
        image: mongo
        env:
        - name: MONGO_INITDB_ROOT_USERNAME
          value: root
        - name: MONGO_INITDB_ROOT_PASSWORD
          value: root
        ports:
        - containerPort: 27017