github.com/cilium/cilium@v1.16.2/test/controlplane/services/graceful-termination/manifests/graceful-termination.yaml (about)

     1  apiVersion: v1
     2  kind: Service
     3  metadata:
     4    name: graceful-term-svc
     5    namespace: test
     6  spec:
     7    ports:
     8      - port: 8081
     9    selector:
    10      app: graceful-term-server
    11  ---
    12  apiVersion: v1
    13  kind: Pod
    14  metadata:
    15    name: graceful-term-server
    16    namespace: test
    17    labels:
    18      app: graceful-term-server
    19  spec:
    20    containers:
    21      - name: server
    22        image: docker.io/cilium/graceful-termination-test-apps:1.0.0
    23        imagePullPolicy: IfNotPresent
    24        ports:
    25          - containerPort: 8081
    26            protocol: TCP
    27        command: [ "/server", "8081" ]
    28    # The server signals shutdown to client upon receiving SIGTERM, waits for
    29    # the terminationGracePeriodSeconds duration, and then gracefully closes client connection.
    30    # The duration is configured such so that CI assertions can be made before exiting.
    31    terminationGracePeriodSeconds: 15
    32    tolerations:
    33      - effect: NoSchedule
    34        key: node-role.kubernetes.io/master
    35      - effect: NoSchedule
    36        key: node.cloudprovider.kubernetes.io/uninitialized
    37        value: "true"
    38  ---
    39  apiVersion: v1
    40  kind: Pod
    41  metadata:
    42    name: graceful-term-client
    43    namespace: test
    44    labels:
    45      app: graceful-term-client
    46  spec:
    47    # The client exits with status code 0 on graceful termination so no need to restart the pod on success.
    48    restartPolicy: OnFailure
    49    terminationGracePeriodSeconds: 0
    50    containers:
    51      - name: client
    52        image: docker.io/cilium/graceful-termination-test-apps:1.0.0
    53        imagePullPolicy: IfNotPresent
    54        command: [ "/client", "graceful-term-svc.default.svc.cluster.local.:8081" ]