一か八か literally means ‘1 or 8’. It is used when you take a bold risk, wishing good luck. Its tone is similar to “go for broke”, like pushing yourself to make an action/decision without being certain of the success. (e.g) aiming at a last-minute goal from a long distance in a football match.
(Adverb) 一か八か or 一か八かで; (e.g.) 一か八かで ~ する
(Adjective) 一か八かの + Noun; (e.g.) 一か八かの賭(か)け (“bet”)
About its origin, one of the theories says that this idiom comes from a Japanese gambling game called 丁半 (ちょうはん), where you roll two dice and guess whether the total sum of numbers is even (丁; ちょう) or odd (半; はん). By taking a closer look at the two kanji characters, you can see that “丁” contains “一” (one) and “半” contains “八 ” (eight) turned upside-down on its top.
Taking a bold risk/going for broke, I may confess my feelings to her.
バスケットの試合（しあい）で (In a basketball game) 一か八かで３ポイントシュートを打(う)った
Taking a bold risk/going for broke, I took a 3-point shot.