instruction: Create a Kubernetes Deployment configuration with best practices
output: ```dockerfile
  from a pod (the same secret is being reused
  for simplicity, the pod only needs nginx.crt to access the Service):
  
  service/networking/curlpod.yaml
  
  apiVersion: apps/v1
  kind: Deployment
  metadata:
   name: curl-deployment
  spec:
   selector:
   matchLabels:
   app: curlpod
   replicas: 1
   template:
   metadata:
   labels:
   app: curlpod
   spec:
   volumes:
   - name: secret-volume
   secret:
   secretName: nginxsecret
   containers:
   - name: curlpod
   command:
   - sh
   - -c
   - while true; do sleep 1; done
   image: radial/busyboxplus:curl
   volumeMounts:
   - mountPath: /etc/nginx/ssl
   name: secret-volume
  
  kubectl apply -f ./curlpod.yaml
  kubectl get pods -l app=curlpod
  NAME READY STATUS RESTARTS AGE
  curl-deployment-1515033274-1410r 1/1 Running 0 1m
  kubectl exec curl-deployment-1515033274-1410r -- curl https://my-nginx --cacert /etc/nginx/ssl/tls.crt
  ...
  <title>Welcome to nginx!</title>
  ...
  Exposing the Service
  For some parts of your applications you may want to expose a Service onto an
  external IP address. Kubernetes supports two ways of doing this: NodePorts and
  LoadBalancers. The Service created in the last section already used NodePort,
  so your nginx HTTPS replica is ready to serve traffic on the internet if your
  node has a public IP.
  kubectl get svc my-nginx -o yaml | grep nodePort -C 5
   uid: 07191fb3-f61a-11e5-8ae5-42010af00002
  spec:
   clusterIP: 10.0.162.149
   ports:
   - name: http
   nodePort: 31704
   port: 8080
   protocol: TCP
   targetPort: 80
   - name: https
   nodePort: 32453
   port: 443
   protocol: TCP
   targetPort: 443
   selector:
   run: my-nginx
  kubectl get nodes -o yaml | grep ExternalIP -C 1
   - address: 104.197.41.11
   type: ExternalIP
   allocatable:
  --
   - address: 23.251.152.56
   type: ExternalIP
   allocatable:
  ...
  
  $ curl https://<EXTERNAL-IP>:<NODE-PORT> -k
  ...
  <h1>Welcome to nginx!</h1>
  Let's now recreate the Service to use a cloud load balancer.
  Change the Type of my-nginx Service
  ```
  
  ## Error Handling and Troubleshooting
  
  ### Common Issues and Solutions
  
  **Issue 1: Container startup failures**
  ```bash
  # Check container logs
  docker logs <container_id>
  
  # Debug with interactive shell
  docker run -it --entrypoint /bin/sh <image_name>
  ```
  
  **Issue 2: Resource constraints**
  ```bash
  # Check resource usage
  kubectl top pods
  kubectl describe pod <pod_name>
  
  # Scale resources if needed
  kubectl patch deployment <deployment_name> -p '{{"spec":{{"template":{{"spec":{{"containers":[{{"name":"<container_name>","resources":{{"requests":{{"memory":"256Mi","cpu":"200m"}},"limits":{{"memory":"512Mi","cpu":"400m"}}}}}}]}}}}}}}'
  ```
  
  **Issue 3: Network connectivity**
  ```bash
  # Test service connectivity
  kubectl exec -it <pod_name> -- wget -qO- <service_name>:<port>/health
  
  # Check service endpoints
  kubectl get endpoints <service_name>
  ```
  
  ### Monitoring and Alerts
  
  Set up proper monitoring to catch issues early:
  
  ```yaml
  # Example alert rule
  groups:
  - name: application.rules
    rules:
    - alert: HighErrorRate
      expr: rate(http_requests_total{{status=~"5.."}}}[5m]) > 0.1
      for: 5m
      annotations:
        summary: "High error rate detected"
        description: "Error rate is above 10% for 5 minutes"
  ```