whoami.yaml 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. ---
  2. apiVersion: v1
  3. kind: Namespace
  4. metadata:
  5. name: whoami
  6. ---
  7. apiVersion: apps/v1
  8. kind: Deployment
  9. metadata:
  10. name: whoami
  11. namespace: whoami
  12. spec:
  13. selector:
  14. matchLabels:
  15. app: whoami
  16. replicas: 2
  17. template:
  18. metadata:
  19. labels:
  20. app: whoami
  21. spec:
  22. containers:
  23. - name: whoami
  24. image: traefik/whoami:v1.8
  25. ports:
  26. - containerPort: 80
  27. name: http-web-svc
  28. ---
  29. apiVersion: v1
  30. kind: Service
  31. metadata:
  32. name: whoami-service
  33. namespace: whoami
  34. spec:
  35. selector:
  36. app: whoami
  37. type: ClusterIP
  38. ports:
  39. - name: whoami-port
  40. protocol: TCP
  41. port: 80
  42. targetPort: http-web-svc
  43. ---
  44. apiVersion: traefik.containo.us/v1alpha1
  45. kind: IngressRoute
  46. metadata:
  47. name: whoami
  48. namespace: whoami
  49. spec:
  50. entryPoints:
  51. - websecure
  52. routes:
  53. - kind: Rule
  54. match: Host(`whoami.jibby.org`)
  55. services:
  56. - kind: Service
  57. name: whoami-service
  58. port: 80
  59. - kind: Rule
  60. match: Host(`whoami.lan.jibby.org`)
  61. services:
  62. - kind: Service
  63. name: whoami-service
  64. port: 80
  65. middlewares:
  66. - name: lanonly
  67. namespace: kube-system