Provided are an optical unit and an endoscope that can enhance the airtightness between a holding tube and a cover glass without a joining member flowing into a distal end surface of an optical lens while maintaining the attachment accuracy of the cover glass. A spacer is disposed between a cover glass position restricting part of a holding tube of an optical unit and a cover glass. The position of the cover glass in an optical axis is restricted by the cover glass position restricting part via a spacer. An external diameter of a first end surface of the spacer is smaller than an internal diameter of a cover glass fixing part of the holding tube. A solder pool part is provided in a region, which is surrounded by a side surface of the spacer, the cover glass fixing part, and the cover glass position restricting part.