In 1918 a naval mutiny at Kiel in North Germany triggered uprisings by workers and soldiers in other German ports, led by the Socialists.
An independent Socialist Republic was declared in Bavaria. In November 1918, the Kaiser abdicated and left Germany (for the Netherlands).
What happened in 1918?
After the Kaiser abdicated, Friedrich Ebert, the leader of the Socialists, became the new leader of the Republic, and he immediately signed an Armistice with the Allies and made plans to draw up a new constitution.
Weimar Republic was set up in 1919 and collapsed in 1933