Logistic regression analysis, adjusted by sex, age, BMI, residence, employment, smoking, alcohol consumption, and diabetes, showed that T/T polymorphism of the VDR gene (rs1544410, OR = 1.97, 95% CI: 1.04–3.72, p = 0.03) and A/A polymorphism of the TLR8 gene (rs3764880, OR = 2.44, 95% CI: 1.20–4.98, p = 0.01) were associated with a high risk of developing pulmonary tuberculosis. This evidence concerns the gene TLR8 and diabetes mellitus.