k8s.io/kubernetes@v1.31.0-alpha.0.0.20240520171757-56147500dadc/test/e2e/testing-manifests/storage-csi/hostpath/hostpath/csi-hostpath-testing.yaml (about)

     1  # WARNING: this is only for testing purposes. Do not install in a production
     2  # cluster.
     3  #
     4  # This exposes the hostpath's Unix domain csi.sock as a TCP port to the
     5  # outside world. The mapping from Unix domain socket to TCP is done
     6  # by socat.
     7  #
     8  # This is useful for testing with csi-sanity or csc.
     9  
    10  apiVersion: v1
    11  kind: Service
    12  metadata:
    13    name: hostpath-service
    14    namespace: default
    15    labels:
    16      app.kubernetes.io/instance: hostpath.csi.k8s.io
    17      app.kubernetes.io/part-of: csi-driver-host-path
    18      app.kubernetes.io/name: csi-hostpath-socat
    19      app.kubernetes.io/component: socat
    20  spec:
    21    type: NodePort
    22    selector:
    23      app.kubernetes.io/instance: hostpath.csi.k8s.io
    24      app.kubernetes.io/part-of: csi-driver-host-path
    25      app.kubernetes.io/name: csi-hostpath-socat
    26      app.kubernetes.io/component: socat
    27    ports:
    28    - port: 10000 # fixed port inside the pod, dynamically allocated port outside
    29  ---
    30  kind: StatefulSet
    31  apiVersion: apps/v1
    32  metadata:
    33    name: csi-hostpath-socat
    34    namespace: default
    35    labels:
    36      app.kubernetes.io/instance: hostpath.csi.k8s.io
    37      app.kubernetes.io/part-of: csi-driver-host-path
    38      app.kubernetes.io/name: csi-hostpath-socat
    39      app.kubernetes.io/component: socat
    40  spec:
    41    serviceName: "csi-hostpath-socat"
    42    replicas: 1
    43    selector:
    44      matchLabels:
    45        app.kubernetes.io/instance: hostpath.csi.k8s.io
    46        app.kubernetes.io/part-of: csi-driver-host-path
    47        app.kubernetes.io/name: csi-hostpath-socat
    48        app.kubernetes.io/component: socat
    49    template:
    50      metadata:
    51        labels:
    52          app.kubernetes.io/instance: hostpath.csi.k8s.io
    53          app.kubernetes.io/part-of: csi-driver-host-path
    54          app.kubernetes.io/name: csi-hostpath-socat
    55          app.kubernetes.io/component: socat
    56      spec:
    57        affinity:
    58          podAffinity:
    59            requiredDuringSchedulingIgnoredDuringExecution:
    60            - labelSelector:
    61                matchExpressions:
    62                - key: app.kubernetes.io/instance
    63                  operator: In
    64                  values:
    65                    - hostpath.csi.k8s.io
    66              topologyKey: kubernetes.io/hostname
    67        containers:
    68          - name: socat
    69            image: registry.k8s.io/sig-storage/hostpathplugin:v1.13.0
    70            command:
    71            - socat
    72            args:
    73              - tcp-listen:10000,fork,reuseaddr
    74              - unix-connect:/csi/csi.sock
    75            securityContext:
    76              # This is necessary only for systems with SELinux, where
    77              # non-privileged sidecar containers cannot access unix domain socket
    78              # created by privileged CSI driver container.
    79              privileged: true
    80            volumeMounts:
    81            - mountPath: /csi
    82              name: socket-dir
    83        volumes:
    84          - hostPath:
    85              path: /var/lib/kubelet/plugins/csi-hostpath
    86              type: DirectoryOrCreate
    87            name: socket-dir