A Baptismal Flood (1 Peter 3:18-22)

Peter presents Noah’s flood as precedent that shows God’s deliverance and judgment. However, Peter also appeals to the flood story as a baptism. What does the flood teach us about baptism? How does this ultimately encourage us in our Christian walk? What does this teach us about covenant theology?