apiVersion: apps/v1
kind: Deployment
metadata:
  name: weatherservice
spec:
  replicas: 1
  selector:
    matchLabels:
      name: weatherservice
  template:
    metadata:
      labels:
        name: weatherservice
    spec:
      serviceAccountName: weatherservice
      containers:
        - name: weatherservice
          image: embano1/weatheropator:latest
          ports:
          - containerPort: 60000
            name: metrics
          command:
          - weatherservice
          args:
            - "-c"
            - "/etc/openweatherapi/appid"
          imagePullPolicy: Always
          env:
            - name: WATCH_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: OPERATOR_NAME
              value: "weatherservice"
          volumeMounts:
          - name: appid
            mountPath: /etc/openweatherapi
      volumes:
      - name: appid
        secret:
          secretName: appid
