45 - CKA exam Q45 with Solution... insert a sidecar container in a running pod

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 พ.ย. 2024

ความคิดเห็น • 13

  • @shashikantdivekar7839
    @shashikantdivekar7839 ปีที่แล้ว +2

    Thank you Sir for this video. You explained it well and it's very useful.

  • @mohiniupasani1909
    @mohiniupasani1909 2 ปีที่แล้ว +2

    thank you , one small suggestion you can use set paste option in vi for better indentation

  • @pankaj7121
    @pankaj7121 ปีที่แล้ว

    But if they have specified not to delete existing pod , how can you do it.

    • @great2be
      @great2be  ปีที่แล้ว

      I think you can do whatever makes sense, end goal is important

  • @great2be
    @great2be  2 ปีที่แล้ว +3

    --------example-pod.yaml-------------------
    apiVersion: v1
    kind: Pod
    metadata:
    name: example-pod
    spec:
    containers:
    - image: nginx
    name: main-container
    resources: {}
    ports:
    - containerPort: 80
    volumeMounts:
    - name: var-logs
    mountPath: /usr/share/nginx/html
    dnsPolicy: Default
    volumes:
    - name: var-logs
    emptyDir: {}
    ------- Sidecar Container info---------
    - image: busybox
    command: ["/bin/sh"]
    args: ["-c", "while true; do echo echo $(date -u) 'Hi I am from Sidec container' >> /var/log/index.html; sleep 5;done"]
    name: sidec-container
    volumeMounts:
    - name: var-logs
    mountPath: /var/log

    • @great2be
      @great2be  2 ปีที่แล้ว

      @@sivap2936, what is the exact ask.. can you pls provide it in detail?

    • @great2be
      @great2be  2 ปีที่แล้ว

      @@sivap2936 check Q 15 - Expose a pod by creating a service on port 30002

    • @sivap2936
      @sivap2936 2 ปีที่แล้ว

      apiVersion: networking.k8s.io/v1
      kind: Ingress
      metadata:
      name: minimal-ingress
      namespace: (provided namespace)
      annotations:
      nginx.ingress.kubernetes.io/rewrite-target: /
      spec:
      rules:
      - http:
      paths:
      - path: /testpath
      pathType: Prefix
      backend:
      service:
      name: test
      port:
      number: 80

    • @sivap2936
      @sivap2936 2 ปีที่แล้ว

      apiVersion: networking.k8s.io/v1
      kind: Ingress
      metadata:
      name: minimal-ingress
      namespace: (provided namespace)
      annotations:
      nginx.ingress.kubernetes.io/rewrite-target: /
      spec:
      rules:
      - http:
      paths:
      - path: /testpath
      pathType: Prefix
      backend:
      service:
      name: test
      port:
      number: 80