istio.io/istio@v0.0.0-20240520182934-d79c90f27776/pkg/config/analysis/analyzers/testdata/image-auto.yaml (about)

     1  # Injected namespace.
     2  apiVersion: v1
     3  kind: Namespace
     4  metadata:
     5    name: injected
     6    labels:
     7      istio-injection: enabled
     8  ---
     9  # Non-injected namespace.
    10  apiVersion: v1
    11  kind: Namespace
    12  metadata:
    13    name: non-injected
    14  ---
    15  apiVersion: admissionregistration.k8s.io/v1
    16  kind: MutatingWebhookConfiguration
    17  metadata:
    18    name: istio-sidecar-injector
    19  webhooks:
    20    - admissionReviewVersions:
    21        - v1beta1
    22      clientConfig:
    23        service:
    24          name: fake
    25          namespace: istio-system
    26      name: namespace.sidecar-injector.istio.io
    27      namespaceSelector:
    28        matchLabels:
    29          istio-injection: enabled
    30    - admissionReviewVersions:
    31        - v1beta1
    32      clientConfig:
    33        service:
    34          name: fake
    35          namespace: istio-system
    36      name: object.sidecar-injector.istio.io
    37      objectSelector:
    38        matchLabels:
    39          sidecar.istio.io/inject: "true"
    40  ---
    41  # Should produce error!
    42  apiVersion: v1
    43  kind: Pod
    44  metadata:
    45    name: injected-pod
    46    namespace: default
    47  spec:
    48    containers:
    49      - image: auto
    50        name: istio-proxy
    51  ---
    52  # Not injected, should produce error!
    53  apiVersion: apps/v1
    54  kind: Deployment
    55  metadata:
    56    name: non-injected-gateway-deployment
    57    namespace: not-injected
    58  spec:
    59    selector:
    60      matchLabels:
    61        istio: ingressgateway
    62    template:
    63      metadata:
    64        annotations:
    65          inject.istio.io/templates: gateway
    66        labels:
    67          istio: ingressgateway
    68      spec:
    69        containers:
    70          - name: istio-proxy
    71            image: auto
    72  ---
    73  # No image auto, should not produce error!
    74  apiVersion: v1
    75  kind: Pod
    76  metadata:
    77    name: istiod-canary-1234567890-12345
    78    namespace: istio-system
    79    labels:
    80      app: istiod
    81      istio: pilot
    82      sidecar.istio.io/inject: "true"
    83  spec:
    84    containers:
    85      - image: ubuntu
    86        name: ubuntu