Direct observation of the ice rule in an artificial kagome spin ice