040-app.yaml 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. kind: Deployment
  2. apiVersion: apps/v1
  3. metadata:
  4. name: whoami
  5. labels:
  6. app: containous
  7. name: whoami
  8. spec:
  9. replicas: 2
  10. selector:
  11. matchLabels:
  12. app: containous
  13. task: whoami
  14. template:
  15. metadata:
  16. labels:
  17. app: containous
  18. task: whoami
  19. spec:
  20. containers:
  21. - name: containouswhoami
  22. image: eugeniucarvalho1/teste:0.0.1
  23. ports:
  24. - containerPort: 8000
  25. ---
  26. apiVersion: v1
  27. kind: Service
  28. metadata:
  29. name: whoami
  30. spec:
  31. ports:
  32. - name: http
  33. port: 80
  34. targetPort: 8000
  35. selector:
  36. app: containous
  37. task: whoami
  38. ---
  39. kind: Ingress
  40. apiVersion: networking.k8s.io/v1beta1
  41. metadata:
  42. name: myingress
  43. annotations:
  44. traefik.ingress.kubernetes.io/router.entrypoints: web, websecure
  45. # traefik.ingress.kubernetes.io/router.tls.certresolver: letse
  46. spec:
  47. rules:
  48. - host: k8s.eugeniocarvalho.dev
  49. http:
  50. paths:
  51. - path: ""
  52. backend:
  53. serviceName: whoami
  54. servicePort: 80