whoami.yaml 813 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. ---
  2. apiVersion: v1
  3. kind: Service
  4. metadata:
  5. name: whoami
  6. labels:
  7. run: whoami
  8. spec:
  9. ports:
  10. - port: 80
  11. protocol: TCP
  12. selector:
  13. run: whoami
  14. type: LoadBalancer
  15. ---
  16. apiVersion: apps/v1
  17. kind: Deployment
  18. metadata:
  19. name: whoami
  20. spec:
  21. selector:
  22. matchLabels:
  23. run: whoami
  24. replicas: 2
  25. template:
  26. metadata:
  27. labels:
  28. run: whoami
  29. spec:
  30. # affinity:
  31. # podAntiAffinity:
  32. # requiredDuringSchedulingIgnoredDuringExecution:
  33. # - labelSelector:
  34. # matchExpressions:
  35. # - key: app
  36. # operator: In
  37. # values:
  38. # - whoami
  39. # topologyKey: kubernetes.io/hostname
  40. containers:
  41. - name: whoami
  42. image: traefik/whoami
  43. ports:
  44. - containerPort: 80