github.com/cilium/cilium@v1.16.2/test/k8s/manifests/lrp-test.yaml (about)

     1  ---
     2  apiVersion: v1
     3  kind: Pod
     4  metadata:
     5    name: k8s1-backend
     6    labels:
     7      id: be1
     8      role: backend
     9  spec:
    10    containers:
    11    - name: web
    12      image: quay.io/cilium/echoserver:1.10.1
    13      imagePullPolicy: IfNotPresent
    14      ports:
    15      - name: http
    16        containerPort: 80
    17        protocol: TCP
    18      readinessProbe:
    19        httpGet:
    20          path: /
    21          port: 80
    22    - name: udp
    23      image: quay.io/cilium/echoserver-udp:v2020.01.30
    24      imagePullPolicy: IfNotPresent
    25      ports:
    26      - name: tftp
    27        containerPort: 69
    28        protocol: UDP
    29    terminationGracePeriodSeconds: 0
    30    nodeSelector:
    31      "cilium.io/ci-node": k8s1
    32  ---
    33  apiVersion: v1
    34  kind: Pod
    35  metadata:
    36    name: k8s2-backend
    37    labels:
    38      id: be2
    39      role: backend
    40  spec:
    41    containers:
    42    - name: web
    43      image: quay.io/cilium/echoserver:1.10.1
    44      imagePullPolicy: IfNotPresent
    45      ports:
    46      - name: http
    47        containerPort: 80
    48        protocol: TCP
    49      readinessProbe:
    50        httpGet:
    51          path: /
    52          port: 80
    53    - name: udp
    54      image: quay.io/cilium/echoserver-udp:v2020.01.30
    55      imagePullPolicy: IfNotPresent
    56      ports:
    57        - name: tftp
    58          containerPort: 69
    59          protocol: UDP
    60    terminationGracePeriodSeconds: 0
    61    nodeSelector:
    62      "cilium.io/ci-node": k8s2
    63  ---
    64  apiVersion: v1
    65  kind: Pod
    66  metadata:
    67    name: k8s1-client
    68    labels:
    69      id: app1
    70      role: frontend
    71  spec:
    72    containers:
    73    - name: web
    74      image: quay.io/cilium/demo-client:1.0
    75      imagePullPolicy: IfNotPresent
    76      command: [ "sleep" ]
    77      args:
    78        - "1000h"
    79    nodeSelector:
    80      "cilium.io/ci-node": k8s1
    81  ---
    82  apiVersion: v1
    83  kind: Pod
    84  metadata:
    85    name: k8s2-client
    86    labels:
    87      id: app2
    88      role: frontend
    89  spec:
    90    containers:
    91    - name: web
    92      image: quay.io/cilium/demo-client:1.0
    93      imagePullPolicy: IfNotPresent
    94      command: [ "sleep" ]
    95      args:
    96        - "1000h"
    97    nodeSelector:
    98      "cilium.io/ci-node": k8s2
    99  ---
   100  apiVersion: v1
   101  kind: Service
   102  metadata:
   103    name: lrp-demo-service
   104  spec:
   105    type: ClusterIP
   106    ports:
   107    - name: http
   108      port: 80
   109      targetPort: 80
   110      protocol: TCP
   111    - name: tftp
   112      port: 69
   113      targetPort: 69
   114      protocol: UDP
   115    selector:
   116      role: backend
   117  ---
   118  apiVersion: "cilium.io/v2"
   119  kind: CiliumLocalRedirectPolicy
   120  metadata:
   121    name: "lrp-svc"
   122  spec:
   123    redirectFrontend:
   124      serviceMatcher:
   125        serviceName: lrp-demo-service
   126        namespace: default
   127        toPorts:
   128          - name: http
   129            port: "80"
   130            protocol: TCP
   131          - name: tftp
   132            port: "69"
   133            protocol: UDP
   134    redirectBackend:
   135      localEndpointSelector:
   136        matchLabels:
   137          role: backend
   138      toPorts:
   139        - name: http
   140          port: "80"
   141          protocol: TCP
   142        - name: tftp
   143          port: "69"
   144          protocol: UDP
   145  ---
   146  apiVersion: v1
   147  kind: Pod
   148  metadata:
   149    name: k8s1-backend2
   150    labels:
   151      id: be3
   152      role: lrpAddrBackend
   153  spec:
   154    # Host networked backends test kiam like use cases.
   155    hostNetwork: true
   156    containers:
   157      - name: web
   158        image: quay.io/cilium/echoserver:1.10.1
   159        imagePullPolicy: IfNotPresent
   160        ports:
   161          - name: http
   162            containerPort: 80
   163            protocol: TCP
   164        readinessProbe:
   165          httpGet:
   166            path: /
   167            port: 80
   168      - name: udp
   169        image: quay.io/cilium/echoserver-udp:v2020.01.30
   170        imagePullPolicy: IfNotPresent
   171        ports:
   172          - name: tftp
   173            containerPort: 69
   174            protocol: UDP
   175    terminationGracePeriodSeconds: 0
   176    nodeSelector:
   177      "cilium.io/ci-node": k8s1
   178  ---
   179  apiVersion: v1
   180  kind: Pod
   181  metadata:
   182    name: k8s2-backend2
   183    labels:
   184      id: be4
   185      role: lrpAddrBackend
   186  spec:
   187    hostNetwork: true
   188    containers:
   189      - name: web
   190        image: quay.io/cilium/echoserver:1.10.1
   191        imagePullPolicy: IfNotPresent
   192        ports:
   193          - name: http
   194            containerPort: 80
   195            protocol: TCP
   196        readinessProbe:
   197          httpGet:
   198            path: /
   199            port: 80
   200      - name: udp
   201        image: quay.io/cilium/echoserver-udp:v2020.01.30
   202        imagePullPolicy: IfNotPresent
   203        ports:
   204          - name: tftp
   205            containerPort: 69
   206            protocol: UDP
   207    terminationGracePeriodSeconds: 0
   208    nodeSelector:
   209      "cilium.io/ci-node": k8s2
   210  ---
   211  apiVersion: "cilium.io/v2"
   212  kind: CiliumLocalRedirectPolicy
   213  metadata:
   214    name: "lrp-test-addr"
   215  spec:
   216    redirectFrontend:
   217      addressMatcher:
   218        ip: "169.254.169.254"
   219        toPorts:
   220          - name: http
   221            port: "80"
   222            protocol: TCP
   223          - name: tftp
   224            port: "69"
   225            protocol: UDP
   226    redirectBackend:
   227      localEndpointSelector:
   228        matchLabels:
   229          role: lrpAddrBackend
   230      toPorts:
   231        - name: http
   232          port: "80"
   233          protocol: TCP
   234        - name: tftp
   235          port: "69"
   236          protocol: UDP