apiVersion: v1
kind: ConfigMap
metadata:
  name: hello-api-html
  namespace: geocrop
data:
  index.html: |
    <h1>GeoCrop API is live ✅</h1>
    <p>Host: api.portfolio.techarvest.co.zw</p>
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: hello-api
  namespace: geocrop
spec:
  replicas: 1
  selector:
    matchLabels:
      app: hello-api
  template:
    metadata:
      labels:
        app: hello-api
    spec:
      containers:
        - name: nginx
          image: nginx:alpine
          ports:
            - containerPort: 80
          volumeMounts:
            - name: html
              mountPath: /usr/share/nginx/html
      volumes:
        - name: html
          configMap:
            name: hello-api-html
---
apiVersion: v1
kind: Service
metadata:
  name: geocrop-api
  namespace: geocrop
spec:
  selector:
    app: hello-api
  ports:
    - port: 80
      targetPort: 80
