Well, they have a similar purpose, but knights strive on protecting women and noble children while samurai would say that they have the capability to protect themselves. The samurai usually used a long sword (katana) and short sword (wakizashi). Together they are the daisho. The knight usually uses a sword and a shield. A knight would be allowed to surrender and be held for ransom while a samurai is supposed to commit suicide. However, a similarity for both classes will be the fact that few of their class will live to what they call "honor".
In principle they are very similiar. They however used very different weapons and fighting styles, there armour was also made differently. The Samurai sword was shorter and lighter with only one side sharpened were the nights sword was very heavy and double sided. There are many other cultural and religous differences.