Their lives seem glamorous, but no one really knows what may be happening behind the scenes in the lives of actors and actresses.

Emilia Clarke, the actress who portrays Daenerys Targaryen on the epic HBO show “Game of Thrones,” announced that she had two major health scares as she was filming the show.

Clarke, in a piece for The New Yorker magazine, wrote she had to undergo surgery for brain aneurysms.

It all started on Feb. 11, 2011.

“I was getting dressed in the locker room of a gym in Crouch End, North London, when I started to feel a bad headache coming on. I was so fatigued that I could barely put on my sneakers. When I started my workout, I had to force myself through the first few exercises.

“Then my trainer had me get into the plank position, and I immediately felt as though an elastic band were squeezing my brain. I tried to ignore the pain and push through it, but I just couldn’t.”

Clarke told her trainer she needed to take a break and retreated to the locker room, where she got sick. She called the pain, which was getting worse, “shooting, stabbing, constricting.”

A woman helped her get on her side, in a recovery position. Then all she remembers was someone saying she had a weak pulse and she was being taken to a hospital, where after an MRI, doctors found a subarachnoid hemorrhage (SAH). SAH is a stroke where there is bleeding into the space around the brain. Clarke said she learned later that a third of patients with the condition die from it and there's a high risk of a second aneurysm, often those are fatal, she said in The New Yorker column.

At 24 years old she was undergoing her first brain surgery to repair the aneurysm. Doctors did what they considered "minimally invasive." They did not open her skull that time. Instead they used endovascular coiling and used a wire fished through the femoral artery in the groin, all the way to her brain, to close the aneurysm.

>> Read more trending news

But the surgery was only the first hurdle. She explains in the column, the pain of healing and the terror of not remembering her own name once she had passed the two-week-mark after surgery. She had a condition called aphasia, and was not able to speak words, only what she called nonsense. Eventually her words came back to her and she was released after a month in the hospital, weeks before a press tour and filming began on another season of "Game of Thrones."

But she wasn’t fully out of the woods. Doctors said they had found a smaller aneurysm on the other side of her brain and it could go at any moment. But she powered on with doctors monitoring her condition. She told the showrunners at “Game of Thrones,” and reported to set for season 2, despite pain and fatigue.

Flash forward to 2013, after filming was done on season 3. She was in New York, playing Holly Golightly in "Breakfast at Tiffany's" on Broadway. She had a brain scan, and doctors said the small aneurysm had doubled in size. She planned on a surgery similar to the first, two hours and done. But there was a problem during the procedure and she had to have immediate brain surgery, but the traditional way, by cutting her skull, she explained in The New Yorker.

At the end of the surgery, parts of her skull were replaced by titanium and she was left with an incision from her scalp to her ear. She spent another month in the hospital recovering from the surgery, as well as, combating other fallout, anxiety, panic attacks and pain. She was afraid the news of her condition would be leaked to tabloids, and worse, that she was going to die.

But she rebounded. Weeks after the surgery, she attended ComicCon in San Diego. And again she came down with a horrible headache that caused her to think, “This is it. My time is up; I’ve cheated death twice and now he’s coming to claim me.” She told her publicist what was happening as she came off the stage who told Clarke, MTV was waiting to interview her. Clarke went through with the Q&A. “I figured, if I’m going to go, it might as well be on live television.”

Actors Richard Madden, Emilia Clarke, and writer George R.R. Martin speak onstage during the 'Game Of Thrones' panel during Comic-Con International 2013 at San Diego Convention Center on July 19, 2013 in San Diego, California.

Credit: Kevin Winter/Getty Images

icon to expand image

Credit: Kevin Winter/Getty Images

Clarke has since healed fully and says she is “at a hundred percent.”

She has also started a charity, SameYou, that provides treatment for people with brain injuries and stroke.

Looking back, she thinks the warning signs of the brain bleed were there: lightheadedness and dizziness because of low blood pressure and low heart rate, a migraine that kept her in bed for days when she was 14, collapsing during drama school, but all of that she attributed to stress, she explained in The New Yorker.

7 Things You Didn't Know about Game of Thrones