Medical privacy can be a knotty issue. As long as it doesn't impact work, you can and likely should keep it private.
If you need an accommodation (such as the ability to go chemotherapy or dialysis on a particular schedule or special equipment), then you must tell your employer in order to get the accommodation. In general, they do not need to know the details but have something in writing from the doctor explaining the necessary accommodation.
In practice, I have found it is easier for everybody if you are up front about the illness unless it is something that might cause people to shun you like AIDS. That still doesn't mean you have to disclose all the details. But knowing you have arthritis or cancer of depression might make them think about things they ask you to do without having to make a formal accommodation every time. Illnesses viewed as more serious tend to get more sympathy and people go out of their way to make sure you can continue to work as long as possible.
However, I have also twice seen people who got fired for having a serious illness - once when she was no longer able to work at all and had run out of disability and once where the managers deliberately assigned work to her that they knew she could not do and then fired her for performance reasons. The first was unfortunate but at least understandable, they needed to hire a replacement and it was clear she was not going to be able to go back to work (she died a couple of months later). The second was inexcusable.
I have seen far more people successfully get accommodations though, but it is a risk to disclose. It is just that the risk of not disclosing is often far greater than the risk of disclosing.
Many people make the disclosure directly to HR and their boss is only told that there is an accommodation being made. Whoever you tell about the illness is generally obligated not to pass around your personal medical history to people who do not need to know without your written consent. However, if you know you boss is a gossip, it might be best to deal directly with HR.
The grey area is an illness that might at some point affect work, but currently does not. Most people prefer to keep this private, but be aware that you are likely to have more trouble for not disclosing if it causes a work problem and they didn't know about it in advance. It is harder to get people to retroactively accommodate after something serious has happened and you could get fired in many places before you could bring up that you need an accommodation. It might be harder to get time off for necessary medical treatments if you don't tell them you are going to the doctor. So it is a judgement call. If you feel like things are getting worse, it might be worth it to bring up the issue proactively.
And of course some things are noticeable whether you disclose or not. It is hard not to notice that someone is deaf for instance. If people are going to know anyway, disclosing is generally to your advantage.
As far as being ashamed, there is no reason for shame in having an illness. Pretty much every person will get an illness at some point in their life unless they die young from a non-illness related death.