ingress.yaml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. ---
  2. apiVersion: networking.k8s.io/v1
  3. kind: Ingress
  4. metadata:
  5. name: service-ingress
  6. annotations:
  7. nginx.ingress.kubernetes.io/rewrite-target: /
  8. spec:
  9. rules:
  10. - http:
  11. paths:
  12. - path: /testpath
  13. pathType: Prefix
  14. backend:
  15. service:
  16. name: test
  17. port:
  18. number: 80
  19. ---
  20. apiVersion: v1
  21. kind: Service
  22. metadata:
  23. name: test
  24. spec:
  25. type: NodePort
  26. selector:
  27. app: foo
  28. ports:
  29. - protocol: TCP
  30. port: 80
  31. targetPort: 80
  32. ---
  33. apiVersion: v1
  34. kind: Service
  35. metadata:
  36. name: nginx
  37. spec:
  38. type: NodePort
  39. selector:
  40. app: foo
  41. ports:
  42. - protocol: TCP
  43. port: 80
  44. targetPort: 80
  45. ---
  46. apiVersion: networking.k8s.io/v1
  47. kind: Ingress
  48. metadata:
  49. name: resource-ingress
  50. annotations:
  51. nginx.ingress.kubernetes.io/rewrite-target: /
  52. spec:
  53. rules:
  54. - http:
  55. paths:
  56. - path: /testpath
  57. pathType: Prefix
  58. backend:
  59. resource:
  60. name: resource-test
  61. kind: StatefulSet
  62. port:
  63. number: 80
  64. ---
  65. apiVersion: apps/v1
  66. kind: StatefulSet
  67. metadata:
  68. name: resource-test
  69. spec:
  70. serviceName: "nginx"
  71. replicas: 2
  72. selector:
  73. matchLabels:
  74. app: nginx
  75. template:
  76. metadata:
  77. labels:
  78. app: nginx
  79. spec:
  80. volumes:
  81. - name: config-vol
  82. configMap:
  83. name: log-config
  84. items:
  85. - key: log_level
  86. path: log_level
  87. containers:
  88. - name: nginx
  89. image: k8s.gcr.io/nginx-slim:0.8
  90. ports:
  91. - containerPort: 80
  92. name: web
  93. volumeMounts:
  94. - name: www
  95. mountPath: /usr/share/nginx/html
  96. volumeClaimTemplates:
  97. - metadata:
  98. name: www
  99. spec:
  100. accessModes: ["ReadWriteOnce"]
  101. resources:
  102. requests:
  103. storage: 1Gi
  104. ---
  105. apiVersion: v1
  106. kind: ConfigMap
  107. metadata:
  108. creationTimestamp: 2016-02-18T18:52:05Z
  109. name: log-config
  110. namespace: default
  111. resourceVersion: "516"
  112. uid: b4952dc3-d670-11e5-8cd0-68f728db1985
  113. data:
  114. game.properties: |
  115. enemies=aliens
  116. lives=3
  117. secret.code.lives=30
  118. ui.properties: |
  119. color.good=purple