Upwelling occurs where surface waters diverge, mostly due to wind, and deeper water is brought up to replace the surface waters. In the diagram above, the wind is blowing along the coast and Ekman transport is causing the surface layer of water to move 90 degrees away from the direction of the wind. This movement creates a void that brings deep water from below the Pycnocline to the surface.
Ekman transport is a result of the Coriolois Effect (the effect of the Rotation of the Earth) and Wind-Driven surface currents. These two forces creates the Ekman Spiral which moves each of the layers of water in the ocean in a different direction, the result is a net movement 90 degrees away from the direction of wind, shown in the diagram below.