apiVersion: v1
kind: Namespace
metadata:
  name: imagesever
  
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: image-sever-deployment
  namespace: imagesever
spec:
  selector:
    matchLabels:
      app: image-sever
      tier: service
      track: stable
  replicas: 1
  template:
    metadata:
      labels:
        app: image-sever
        tier: service
        track: stable
    spec:
      containers:
        - name: image-sever
          image: "itaffixdocker/image-sever:1.0"
          resources:
            requests:
              memory: "256Mi"
              cpu: "250m"
            limits:
              memory: "1000Mi"
              cpu: "500m"
          imagePullPolicy: Always
          ports:
            - containerPort: 80
          env:
            - name: EUREKA_ENDPOINT
              value: gateway-service
            - name: EUREKA_SERVICE
              value: gateway-service.default.svc.cluster.local
      imagePullSecrets:
        - name: jencred

---
apiVersion: v1
kind: Service
metadata:
  name: image-sever-service
  namespace: imagesever
spec:
  selector:
    app: image-sever
    tier: service
  ports:
    - protocol: TCP
      port: 80
      targetPort: 80
      nodePort: 31419
  type: NodePort
