github.com/form3tech-oss/cilium@v1.6.3/examples/kubernetes-istio/kafka-v1.yaml (about)

     1  apiVersion: v1
     2  kind: Service
     3  metadata:
     4    name: kafka
     5  spec:
     6    ports:
     7    - port: 9092
     8      name: client
     9    clusterIP: None
    10    selector:
    11      app: kafka
    12  ---
    13  apiVersion: "cilium.io/v2"
    14  kind: CiliumNetworkPolicy
    15  metadata:
    16    name: kafka-authaudit
    17  specs:
    18    - endpointSelector:
    19        matchLabels:
    20          "k8s:app": kafka
    21      ingress:
    22      - fromEndpoints:
    23        - matchLabels:
    24            "k8s:app": productpage
    25            "k8s:version": v2
    26        toPorts:
    27        - ports:
    28          - port: "9092"
    29            protocol: TCP
    30          rules:
    31            kafka:
    32            - apiKey: "produce"
    33              topic: "authaudit"
    34            - apiKey: "apiversions"
    35            - apiKey: "metadata"
    36            - apiKey: "heartbeat"
    37      - fromEndpoints:
    38        - matchLabels:
    39            app: kafka
    40      - fromEndpoints:
    41        - matchLabels:
    42            "k8s:app": authaudit-logger
    43        toPorts:
    44        - ports:
    45          - port: "9092"
    46            protocol: TCP
    47          rules:
    48            kafka:
    49            - apiKey: "fetch"
    50              topic: "authaudit"
    51            - apiKey: "apiversions"
    52            - apiKey: "metadata"
    53            - apiKey: "findcoordinator"
    54            - apiKey: "joingroup"
    55            - apiKey: "leavegroup"
    56            - apiKey: "syncgroup"
    57            - apiKey: "offsets"
    58            - apiKey: "offsetcommit"
    59            - apiKey: "offsetfetch"
    60            - apiKey: "heartbeat"
    61  ---
    62  apiVersion: apps/v1beta1
    63  kind: StatefulSet
    64  metadata:
    65    name: kafka-v1
    66  spec:
    67    serviceName: kafka
    68    replicas: 1
    69    template:
    70      metadata:
    71        annotations:
    72          sidecar.istio.io/inject: "false"
    73        labels:
    74          app: kafka
    75          version: v1
    76      spec:
    77        containers:
    78        - name:  kafka
    79          image: docker.io/spotify/kafka:latest
    80          ports:
    81          - containerPort: 9092
    82            name: kafka
    83          env:
    84          - name: ADVERTISED_HOST
    85            value: kafka.default.svc.cluster.local
    86          - name: ADVERTISED_PORT
    87            value: "9092"
    88          - name: ZK_CHROOT
    89            value: kafka
    90          - name: LOG_RETENTION_HOURS
    91            value: "2"
    92          - name: LOG_RETENTION_BYTES
    93            value: "1073741824"
    94          - name: NUM_PARTITIONS
    95            value: "1"
    96          - name: AUTO_CREATE_TOPICS
    97            value: "true"