I noticed in a deployment file there are two fields for containers like
containers and looks confusing to me and I search through the internet but can't understand. Could anyone please tell me the difference between
containers and how we use them together?
containers: - name: php image: php:7-fpm volumeMounts: - name: dir mountPath: /dir initContainers: - name: install image: busybox volumeMounts: - name: dir mountPath: /dir command: - wget - "-O" - "/dir/index.php" - https://raw.githubusercontent.com/videofalls/demo/master/index.php
Init Containersrun before the main container runs. Normally init containers are used to ensure the server environment is ready for your application to start to run.
Go through the detailed official document for better understanding