Uploaded image for project: 'Product Technical Learning'
  1. Product Technical Learning
  2. PTL-3211

DO180-616: Ch04s06 : step 9.1 --command option is used without explanation

XMLWordPrintable

    • en-US (English)

      URL: https://rol.redhat.com/rol/app/courses/do180-4.12/pages/ch04s06
      Reporter RHNID: ctiwary@redhat.com
      Section: 6 - Guided Exercise: Kubernetes Pod and Service Networks
      Language: en-US (English)||||||||
      Workaround:

      Description: In ch04s06: step 9.1 you can see --command option is used :

      [student@workstation ~]$ oc run query-db -it --rm \
      --image registry.ocp4.example.com:8443/redhattraining/do180-dbinit \
      --restart Never \
      --command – /bin/bash -c "mysql -uuser1 -pmypa55w0rd --protocol tcp \
      -h db-pod -P3306 items -e 'select * from Item;'"

      However, in ch04s04 : step 2.4 : --command is not used :

      [student@workstation ~]$ oc run -it db-test --restart=Never \
      --image registry.ocp4.example.com:8443/rhel9/mysql-80:1 \
      – mysql sampledb -h 10.8.0.91 -u developer --password=developer \
      -e "select 1;"

      I think it might be due to the fact that in ch04s04 - we donot need --command as it is not a shell command to execute but a mysql binary ( already installed in the container image ) used to check connectivity to a database server , whereas in ch04s06 : --command option is required as command uses the MySQL client to execute a query against the database service.

      or if I can say one is using the MySQL client binary to execute queries against a separate MySQL database service, while the other is using the MySQL client binary as part of a container image that contains the MySQL server and runs a query directly against the MySQL server running within the container.

      In the first command, the mysql binary is executed directly. In the second command, the mysql client is used to execute the mysql command.

      Please correct me if I am wrong and learners are facing difficulty in understanding this. It will be really helpful if an explanation is added here as to why we need --command option in ch04s06 and not in ch04s04.

        1. Ch04s04.png
          Ch04s04.png
          75 kB
        2. CH04s06.png
          CH04s06.png
          177 kB

            althomas@redhat.com Allen Thomas
            chetan-rhls Chetan Tiwary
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: