The best source of vitamin D is sunshine. Living things (even mushrooms) can make vitamin D on contact with sunshine. Vitamin D is important for many different functions in the body, especially bone health and the immune system.
Nutritionally, there are two main types of vitamin D - vitamin D3 and vitamin D2. It is generally thought the Vitamin D3 is superior to vitamin D2 but recent studies shown that higher doses of vitamin D2 for a slightly longer period can achieve the same results as D3 (citation needed).
Vitamin D3 is usually not vegan as it is made from sheep's wool although a major manufacturer (Roche) achieved UK's Vegetarian Society's approval by offering reassurances that the donor sheep would reared solely for wool and not meat.
Vegan vitamin D3 is however now being made from lichen and algae under the tradename Vitashine. It is being offered as a spray and also as part of a vegan omega-3 essential long chain fatty acid supplement with DHA and EPA.
Your primary, best source for vitamin D is the sun. The sun’s energy turns a chemical (7-dehydrocholesterol) in your skin into vitamin D3, which is carried to your liver and then your kidneys to transform it to active vitamin D. If you can get adequate exposure to the sun on your bare skin this should supply the body with the needed vitamin D. If you live in a tropical climate, then you are probably getting plenty of sunlight. 10 minutes in the noonday sun in shorts and a tank top will give you the the necessary vitamin D for a day. For most of us though, we undergo a winter of some duration during which time our access to sunlight on our bare skin is reduced. In addition the angle of the sun in winter affects the penetration of sunlight into the atmosphere. Many vegans choose to supplement with vitamin D during these times of sunlight scarcity. One way to supplement is with a light array with special bulbs indoor that is used to simulate the effects of the sun. But getting this to work at a reasonable cost may be tricky. The common approach is oral supplementation. There are two options namely D2 and D3. D2 is a vegan variation and D3 is non vegan. The problem here according to some is that the D2 will not meet the body's requirements. Consequently some vegans will break down and use the D3, which is a violation of their ethical perspective and yet good for their health. This is a personal decision. There is also simply the option to accept that for some parts of the year you will be deficient in vitamin D. One may not be having the optimal health they're capable of if they go this route but it can be an option for vegans who are not willing to bend their ethical principles.