The task that Zen Master Dogen set for himself was to practice and maintain the buddha-way. For Dogen, practicing and maintaining the buddha-way was to abandon ego-attachment and to follow the instructions of his teacher.
To abandon ego-attachment, he found he needed to put an end to greed. To put an end to greed, he had to abandon egocentric self. Dogen taught that seeing the impermanence of all existence was the primary necessity for abandoning egocentric self. "Truly," he once wrote, "when you see impermanence, egocentric mind does not arise."
Egocentricity is assuming that there is some sort of substantial or even eternal ego or soul existing in the body, which itself is a temporal composite of various elements. Thinking it to be substantial or even eternal, we attach to and identify with that ego or soul. Dogen considered this to be the fundamental delusion. His practice was to see egolessness and the impermanence of all existence, and to live on that basis without greedy desires.
Those greedy desires manifest themselves in the concrete world by seeking fame and profit. This is why Dogen put such an emphasis on practicing the buddha-way without expecting any reward, especially fame and profit.
For Dogen, one should practiced the buddha-way only for the sake of the buddha-way.