We have all seen it, be in period pieces or fantasy inspired in the medieval era about knights posessing a sort of "chivalry rules of conduct", that may include "help the ones in need", "be pious", that sort of thing.
We also have seen various pieces of japanese media (movies, manga and anime) portraying samurai bound by codes of honor, where if broken they would even come to commit suicide (seppuku) over it, or otherwise becoming renegades (Ronin)
All in all, was that something that was followed? Was it something created recently to add a flair of "nobility" to what only amounted as soldiers/mercenaries? Or was something that in theory existed, but in practice it was only window dressing?
Hi there, questions like this have come up a few times in the past, fortunately the FAQ has quite a few answers on Samurai and "Bushido." All of these answers are from /u/bigbluepanda it might not answer the question about knights, but it certainly does touch on one of those big "warrior codes" that people often bring up.
https://www.reddit.com/r/AskHistorians/comments/4rte1l/were_samurai_generally_honorable/d54202b/
This answer focuses on how much samurai followed a "warrior code" during the Sengoku and Edo periods.
https://www.reddit.com/r/AskHistorians/comments/3mq5p2/how_much_influence_did_bushido_have_outside_of/
This answer talks about how the idea of "bushido" as a formalized "code" was a much later invention though the idea had been talked about during the 14th and 16th centuries.
Finally this answer touches further on the idea of "bushido" as a "code of honor" wasn't really a formalized thing and came about later in Japanese history. This answer also has a link to a JSTOR article by historian Karl Friday on the matter that might be of some interest to you.
A little further down /u/ParallelPain also gives a good response here as well, touching more on specific contemporary literature about "bushido" literature that doesn't leave us with a clear answer as many of the authors of those writings may disagree with one another or have other contemporaries who disagree.