Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-65803

there is no tailer log in squid deployment tailer container

XMLWordPrintable

    • None
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      I evenDescription of problem:

          there is no tailer log in squid deployment tailer container

      Version-Release number of selected component (if applicable):

          

      How reproducible:

          OCP-74596 which was created and automated as a result of RCA of https://issues.redhat.com/browse/OCPBUGS-33526, and the test case failed in CI due to image path.  However, after fixing image path in proxy-deployment.yaml when manually testing OCP-74596, it was found tailer container of squid deployment pod has no log at all, detailed reproducing steps are in https://docs.google.com/document/d/1qqidJBgXdZ9Gvab_YoY5GIauimIo_ien5k6MchiuN7k/edit?tab=t.0
      
      

      Steps to Reproduce:

          1.
          2.
          3.
          

      Actual results:

          

      Expected results:

          

      Additional info:

          I asked cursorAI to help me correct the proxy_deployment.yaml, here is my updated-proxy_deployment.yaml
      
      $ cat updated_proxy_deployment.yaml 
      apiVersion: apps/v1
      kind: Deployment
      metadata:
        labels:
          app: squid
        name: squid-deployment
      spec:
        progressDeadlineSeconds: 600
        replicas: 1
        revisionHistoryLimit: 10
        selector:
          matchLabels:
            app: squid
        strategy:
          rollingUpdate:
            maxSurge: 25%
            maxUnavailable: 25%
          type: RollingUpdate
        template:
          metadata:
            creationTimestamp: null
            labels:
              app: squid
          spec:
            containers:
            - command:
              - /bin/bash
              - -c
              - |
                #!/bin/bash
                set -e
       
                # allow arguments to be passed to squid
                if [[ ${1:0:1} = '-' ]]; then
                  EXTRA_ARGS="$@"
                  set --
                elif [[ ${1} == squid || ${1} == $(which squid) ]]; then
                  EXTRA_ARGS="${@:2}"
                  set --
                fi
                cat << EOF > /etc/squid/squid.conf
                acl SSL_ports port 443
                acl SSL_ports port 6443
                acl Safe_ports port 80
                acl Safe_ports port 21
                acl Safe_ports port 443
                acl Safe_ports port 6443
                acl Safe_ports port 70
                acl Safe_ports port 210
                acl Safe_ports port 1025-65535
                acl Safe_ports port 280
                acl Safe_ports port 488
                acl Safe_ports port 591
                acl Safe_ports port 777
                acl CONNECT method CONNECT
                http_access deny !Safe_ports
                http_access deny CONNECT !SSL_ports
                # http_access allow localhost manager
                # http_access deny manager
                http_access allow all
                # http_access deny all
                http_port 3128
                access_log /var/log/squid/access.log squid
                coredump_dir /var/spool/squid3
                refresh_pattern ^ftp:           1440    20%     10080
                refresh_pattern ^gopher:        1440    0%      1440
                refresh_pattern -i (/cgi-bin/|\?) 0     0%      0
                refresh_pattern .               0       20%     4320
                EOF          # ensure log directory exists
                mkdir -p /var/log/squid
                chown -R squid:squid /var/log/squid || true          # default behaviour is to launch squid
                if [[ -z ${1} ]]; then
                  echo "Starting squid..."
                  exec $(which squid) -f /etc/squid/squid.conf -NYCd 1 ${EXTRA_ARGS}
                else
                  exec "$@"
                fi
              image: docker.io/sameersbn/squid:3.5.27-2
              imagePullPolicy: IfNotPresent
              name: squid
              ports:
              - containerPort: 3128
                protocol: TCP
              resources: {}
              terminationMessagePath: /dev/termination-log
              terminationMessagePolicy: File
              volumeMounts:
              - mountPath: /var/log/squid
                name: log-dir
            - args:
              - |
                echo "Waiting for squid to start and create log file..."
                sleep 5
                while [ ! -f /var/log/squid/access.log ]; do
                  echo "Log file not found, waiting..."
                  sleep 2
                done
                echo "Log file found, starting to tail..."
                exec tail -F /var/log/squid/access.log
              command:
              - /bin/sh
              - -c
              image: busybox
              imagePullPolicy: Always
              name: tailer
              resources: {}
              terminationMessagePath: /dev/termination-log
              terminationMessagePolicy: File
              volumeMounts:
              - mountPath: /var/log/squid
                name: log-dir
            dnsPolicy: ClusterFirst
            restartPolicy: Always
            schedulerName: default-scheduler
            securityContext: {}
            terminationGracePeriodSeconds: 30
            volumes:
            - emptyDir: {}
              name: log-dir
      
      
      oc replaced the proxy deployment yaml, waited till squid pod re-created, deleted previous deployment SVC, re-exposed the updated deployment as LoadBalancer service, after all, checking tailer log again:
      
      $ oc logs squid-deployment-764867db48-9clpb -c tailer 
      Waiting for squid to start and create log file...
      Log file found, starting to tail...
      

              pdiak@redhat.com Patryk Diak
              jechen@redhat.com Jean Chen
              None
              None
              Anurag Saxena Anurag Saxena
              None
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: