In certain ways, the difficulty you are experiencing in answering this question has to do with the way in which the question is formulated. Although Baudelaire is concerned with "modernity" and Kafka is called a "modernist", Kafka's work is much more closely linked with German Expressionism than with the early stages of French symbolism, and so the connections between the two authors are somewhat tenuous.
What they have in common is that they both respond to the same situation, that of an industrialized urban environment in which workers experience alienation from their labor. Baudelaire's theory of modernity argues that the artist must respond to this new environment rather than retreating into a nostalgia for the past, portraying the newly urbanized world and the crowds of the cities, but still remaining an outsider or detached observer, rebelling against bourgeois society while documenting it, and searching for strange elusive beauty within urban squalor.
Kafka's novel shares with Baudelaire's vision of modernity a setting in which the narrator, K., is alienated from his bourgeois job and endures the impersonal system of bureaucratic government both as a participant and a victim. Like Baudelaire, he finds no solace in Christianity, although they differ in that Baudelaire is rebelling against Roman Catholicism as one brought up in the Church, while Kafka was from a Jewish family laboring under antisemitism. In both writers, the rejection of God as an organizing principle, giving purpose to individual lives and the moral structure of the world, leaves them with a world which is inherently irrational, with no moral compass. Thus we never get a sense of why K. is being tried or what things are considered just or unjust in his society.
Another major similarity is in the portrayal of sexuality, and the way in which sexual practices serve as a locus of resistance to bourgeois society, with many of the poems of Baudelaire and the flogging episodes of The Trial invoking a homoerotic sadomasochism that subverts conventional notions of sexuality as linked to marriage and child rearing. The connection between sexuality and oppression is also apparent when the law books K. finds prove to be pornography.
Hello! Charles Baudelaire's definition of modernity can be summed up by one of his most famous quotes:
Modernity is the transient, the fleeting, the contingent; it is one half of art, the other being the eternal and the immovable.
"No," said the priest, "you don't need to accept everything as true, you only have to accept it as necessary." "Depressing view," said K. "The lie made into the rule of the world."
"Things like this don't come all of a sudden, they start developing a long time beforehand, there must have been warning signs of it, why didn't you write to me"
Everything is connected with everything else and will continue without any change or else, which is quite probable, even more closed, more attentive, more strict, more malevolent.These officials are in many ways just like children. Often, something quite harmless - although K.'s behaviour could unfortunately not be called harmless - will leave them feeling so offended that they will even stop talking with good friends of theirs, they turn away when they see them and do everything they can to oppose them. But then, with no particular reason, surprisingly enough, some little joke that was only ever attempted because everything seemed so hopeless will make them laugh and they'll be reconciled. It's both difficult and hard at the same time to deal with them, and there's hardly any reason for it.