{"id":307199,"date":"2020-07-20T15:00:30","date_gmt":"2020-07-20T15:00:30","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=307199"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=307199","title":{"rendered":"\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c Apache Spark \u043d\u0430 Kubernetes"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/neoflex\/blog\/511734\/\">\u0414\u043e\u0440\u043e\u0433\u0438\u0435 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0438, \u0434\u043e\u0431\u0440\u043e\u0433\u043e \u0434\u043d\u044f. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e Apache Spark \u0438 \u0435\u0433\u043e \u043f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u044b \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/bl\/re\/sk\/blreskwzxt52vlomhwaikqojieg.jpeg\"><\/p>\n<p>  \u0412 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u043c \u043c\u0438\u0440\u0435 Big Data Apache Spark \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u0435 \u0444\u0430\u043a\u0442\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u043c \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0437\u0430\u0434\u0430\u0447 \u043f\u0430\u043a\u0435\u0442\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u041f\u043e\u043c\u0438\u043c\u043e \u044d\u0442\u043e\u0433\u043e, \u043e\u043d \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433\u043e\u0432\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0445 \u0432 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438 micro batch, \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0449\u0438\u0445 \u0438 \u043e\u0442\u0433\u0440\u0443\u0436\u0430\u044e\u0449\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u043c\u0438 \u043f\u043e\u0440\u0446\u0438\u044f\u043c\u0438 (Spark Structured Streaming). \u0418 \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u043e \u043e\u043d \u044f\u0432\u043b\u044f\u043b\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e \u043e\u0431\u0449\u0435\u0433\u043e \u0441\u0442\u0435\u043a\u0430 Hadoop, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 YARN (\u0438\u043b\u0438, \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445, Apache Mesos). \u041a 2020 \u0433\u043e\u0434\u0443 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u043e\u043c \u0432\u0438\u0434\u0435 \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0439 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e\u0434 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u043c \u0432 \u0432\u0438\u0434\u0443 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u043f\u0440\u0438\u043b\u0438\u0447\u043d\u044b\u0445 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u043e\u0432 Hadoop \u2014 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435 HDP \u0438 CDH \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e, CDH \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u043d \u0438 \u0438\u043c\u0435\u0435\u0442 \u0432\u044b\u0441\u043e\u043a\u0443\u044e \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c, \u0430 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u0441\u0442\u0430\u0432\u0449\u0438\u043a\u0438 Hadoop \u043b\u0438\u0431\u043e \u043f\u0440\u0435\u043a\u0440\u0430\u0442\u0438\u043b\u0438 \u0441\u0432\u043e\u0451 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435, \u043b\u0438\u0431\u043e \u0438\u043c\u0435\u044e\u0442 \u0442\u0443\u043c\u0430\u043d\u043d\u043e\u0435 \u0431\u0443\u0434\u0443\u0449\u0435\u0435. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0441\u0451 \u0431\u043e\u043b\u044c\u0448\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0435\u0441 \u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0430 \u0438 \u043a\u0440\u0443\u043f\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0439 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a Apache Spark \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Kubernetes \u2014 \u0441\u0442\u0430\u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u043c \u0432 \u043e\u0440\u043a\u0435\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438 \u0432 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0445 \u0438 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0445 \u043e\u0431\u043b\u0430\u043a\u0430\u0445, \u043e\u043d \u0440\u0435\u0448\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0441 \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u044b\u043c \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0437\u0430\u0434\u0430\u0447 Spark \u043d\u0430 YARN \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u044e\u0449\u0443\u044e\u0441\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443 \u0441 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c \u043a\u043e\u043c\u043c\u0435\u0440\u0447\u0435\u0441\u043a\u0438\u0445 \u0438 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0445 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u043e\u0432 \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0439 \u0432\u0441\u0435\u0445 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432 \u0438 \u043c\u0430\u0441\u0442\u0435\u0439. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435 \u043d\u0430 \u0432\u043e\u043b\u043d\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u0438 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0443\u0436\u0435 \u0443\u0441\u043f\u0435\u043b\u043e \u043e\u0431\u0437\u0430\u0432\u0435\u0441\u0442\u0438\u0441\u044c \u043f\u0430\u0440\u043e\u0439-\u0442\u0440\u043e\u0439\u043a\u043e\u0439 \u0441\u0432\u043e\u0438\u0445 \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0446\u0438\u0439 \u0438 \u043d\u0430\u0440\u0430\u0441\u0442\u0438\u0442\u044c \u044d\u043a\u0441\u043f\u0435\u0440\u0442\u0438\u0437\u0443 \u0432 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438, \u0447\u0442\u043e \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u043f\u0435\u0440\u0435\u0435\u0437\u0434.<\/p>\n<p>  \u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 2.3.0 Apache Spark \u043e\u0431\u0437\u0430\u0432\u0451\u043b\u0441\u044f \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0437\u0430\u0434\u0430\u0447 \u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 Kubernetes \u0438 \u0441\u0435\u0433\u043e\u0434\u043d\u044f, \u043c\u044b \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0437\u0440\u0435\u043b\u043e\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430, \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u0445 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043f\u043e\u0434\u0432\u043e\u0434\u043d\u044b\u0445 \u043a\u0430\u043c\u043d\u044f\u0445, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u0438\u0442 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0438.<br \/>  <a name=\"habracut\"><\/a><br \/>   \u041f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0437\u0430\u0434\u0430\u0447 \u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u043d\u0430 \u0431\u0430\u0437\u0435 Apache Spark \u0438 \u0432\u044b\u0434\u0435\u043b\u0438\u043c \u0442\u0438\u043f\u043e\u0432\u044b\u0435 \u0441\u043b\u0443\u0447\u0430\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0443 \u043d\u0430 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 Kubernetes. \u041f\u0440\u0438 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0435 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u0441\u0442\u0430 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f OpenShift \u0438 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u043b\u044f \u0435\u0433\u043e \u0443\u0442\u0438\u043b\u0438\u0442\u044b \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 (oc). \u0414\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u043e\u0432 Kubernetes \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0443\u0442\u0438\u043b\u0438\u0442\u044b \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 Kubernetes (kubectl) \u043b\u0438\u0431\u043e \u0438\u0445 \u0430\u043d\u0430\u043b\u043e\u0433\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f oc adm policy).<\/p>\n<h3> \u041f\u0435\u0440\u0432\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u2014 spark-submit <\/h3>\n<p>   \u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0437\u0430\u0434\u0430\u0447 \u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438 \u0434\u043b\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u0422\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0434\u043b\u044f \u044d\u0442\u0438\u0445 \u0446\u0435\u043b\u0435\u0439 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0437\u0430\u0433\u043b\u0443\u0448\u043a\u0438, \u043d\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441 \u0443\u0447\u0430\u0441\u0442\u0438\u0435\u043c \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 (\u043f\u0443\u0441\u0442\u044c \u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445) \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c, \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0430 \u0441\u0435\u0431\u044f \u0432 \u044d\u0442\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435 \u0437\u0430\u0434\u0430\u0447 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0438 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u0435\u0435. \u0412 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043c \u043e\u0442\u043b\u0430\u0434\u043a\u0443 \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430\u0445 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b \u0434\u0432\u0430 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b:<\/p>\n<ul>\n<li> \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0437\u0430\u0434\u0430\u0447\u0443 Spark \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 standalone;\n<p>   <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/6-\/ys\/cx\/6-yscx4h9xfvo3ndmonm2suktio.jpeg\">   <\/li>\n<li> \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0437\u0430\u0434\u0430\u0447\u0443 Spark \u043d\u0430 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 Kubernetes \u0432 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u043c \u043a\u043e\u043d\u0442\u0443\u0440\u0435.\n<p>   <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/lb\/ib\/wd\/lbibwd_1kbn-wsyv9qgt-8wrnxc.jpeg\">   <\/li>\n<\/ul>\n<p>   \u041f\u0435\u0440\u0432\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0438\u043c\u0435\u0435\u0442 \u043f\u0440\u0430\u0432\u043e \u043d\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435, \u043d\u043e \u0432\u043b\u0435\u0447\u0451\u0442 \u0437\u0430 \u0441\u043e\u0431\u043e\u0439 \u0440\u044f\u0434 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u043e\u0432:<\/p>\n<ul>\n<li> \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u0441 \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u043c\u0435\u0441\u0442\u0430 \u0434\u043e \u0432\u0441\u0435\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0435\u043c\u0443 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c;<\/li>\n<li> \u043d\u0430 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u043c\u0430\u0448\u0438\u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438.<\/li>\n<\/ul>\n<p>   \u0412\u0442\u043e\u0440\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043b\u0438\u0448\u0451\u043d \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u043e\u0432, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 Kubernetes \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u043f\u0443\u043b \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0437\u0430\u0434\u0430\u0447 \u0438 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u044b \u043a \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430\u043c \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c, \u0433\u0438\u0431\u043a\u043e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044f \u043a \u043d\u0435\u043c\u0443 \u0434\u043e\u0441\u0442\u0443\u043f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0440\u043e\u043b\u0435\u0432\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 Kubernetes \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0447\u043b\u0435\u043d\u043e\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u0412\u044b\u0434\u0435\u043b\u0438\u043c \u0435\u0433\u043e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u2014 \u0437\u0430\u043f\u0443\u0441\u043a \u0437\u0430\u0434\u0430\u0447 Spark \u0441 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u043d\u0430 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 Kubernetes \u0432 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u043c \u043a\u043e\u043d\u0442\u0443\u0440\u0435.<\/p>\n<p>  \u0420\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 Spark \u0434\u043b\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430. \u0427\u0442\u043e\u0431\u044b \u043d\u0430\u0447\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f Spark \u0435\u0433\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c:<\/p>\n<pre><code class=\"plaintext\">mkdir \/opt\/spark cd \/opt\/spark wget http:\/\/mirror.linux-ia64.org\/apache\/spark\/spark-2.4.5\/spark-2.4.5.tgz tar zxvf spark-2.4.5.tgz rm -f spark-2.4.5.tgz <\/code><\/pre>\n<p>   \u0421\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Kubernetes:<\/p>\n<pre><code class=\"plaintext\">cd spark-2.4.5\/ .\/build\/mvn -Pkubernetes -DskipTests clean package <\/code><\/pre>\n<p>   \u041f\u043e\u043b\u043d\u0430\u044f \u0441\u0431\u043e\u0440\u043a\u0430 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0430 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043e\u0431\u0440\u0430\u0437\u043e\u0432 Docker \u0438 \u0438\u0445 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043d\u0430 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 Kubernetes \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043d\u0443\u0436\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e jar \u0444\u0430\u0439\u043b\u044b \u0438\u0437 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u00abassembly\/\u00bb, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u043f\u0440\u043e\u0435\u043a\u0442:<\/p>\n<pre><code class=\"plaintext\">.\/build\/mvn -f .\/assembly\/pom.xml -Pkubernetes -DskipTests clean package <\/code><\/pre>\n<p>   \u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0437\u0430\u0434\u0430\u0447 Spark \u0432 Kubernetes \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0437 Docker, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e. \u0417\u0434\u0435\u0441\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b 2 \u043f\u043e\u0434\u0445\u043e\u0434\u0430:<\/p>\n<ul>\n<li> \u0421\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 Docker \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u043a\u043e\u0434 \u0437\u0430\u0434\u0430\u0447\u0438 Spark;<\/li>\n<li> \u0421\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u0442\u043e\u043b\u044c\u043a\u043e Spark \u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438, \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u043a\u043e\u0434 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u043e (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 HDFS).<\/li>\n<\/ul>\n<p>   \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0431\u0435\u0440\u0451\u043c \u043e\u0431\u0440\u0430\u0437 Docker, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0437\u0430\u0434\u0430\u0447\u0438 Spark. \u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043e\u0431\u0440\u0430\u0437\u043e\u0432 Docker \u0443 Spark \u0435\u0441\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0430\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u0430 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c \u00abdocker-image-tool\u00bb. \u0418\u0437\u0443\u0447\u0438\u043c \u043f\u043e \u043d\u0435\u0439 \u0441\u043f\u0440\u0430\u0432\u043a\u0443:<\/p>\n<pre><code class=\"plaintext\">.\/bin\/docker-image-tool.sh --help <\/code><\/pre>\n<p>   \u0421 \u0435\u0451 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0437\u044b Docker \u0438 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c \u0438\u0445 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0432 \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u044b\u0435 \u0440\u0435\u0435\u0441\u0442\u0440\u044b, \u043d\u043e \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043e\u043d\u0430 \u0438\u043c\u0435\u0435\u0442 \u0440\u044f\u0434 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u043e\u0432:<\/p>\n<ul>\n<li> \u0432 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0441\u0440\u0430\u0437\u0443 3 \u043e\u0431\u0440\u0430\u0437\u0430 Docker \u2014 \u043f\u043e\u0434 Spark, PySpark \u0438 R;<\/li>\n<li> \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0438\u043c\u044f \u043e\u0431\u0440\u0430\u0437\u0430.<\/li>\n<\/ul>\n<p>   \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0434\u0430\u043d\u043d\u043e\u0439 \u0443\u0442\u0438\u043b\u0438\u0442\u044b, \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435:<\/p>\n<pre><code class=\"plaintext\">vi bin\/docker-image-tool-upd.sh <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">#!\/usr\/bin\/env bash  function error {   echo &quot;$@&quot; 1&gt;&amp;2   exit 1 }  if [ -z &quot;${SPARK_HOME}&quot; ]; then   SPARK_HOME=&quot;$(cd &quot;`dirname &quot;$0&quot;`&quot;\/..; pwd)&quot; fi . &quot;${SPARK_HOME}\/bin\/load-spark-env.sh&quot;  function image_ref {   local image=&quot;$1&quot;   local add_repo=&quot;${2:-1}&quot;   if [ $add_repo = 1 ] &amp;&amp; [ -n &quot;$REPO&quot; ]; then     image=&quot;$REPO\/$image&quot;   fi   if [ -n &quot;$TAG&quot; ]; then     image=&quot;$image:$TAG&quot;   fi   echo &quot;$image&quot; }  function build {   local BUILD_ARGS   local IMG_PATH    if [ ! -f &quot;$SPARK_HOME\/RELEASE&quot; ]; then     IMG_PATH=$BASEDOCKERFILE     BUILD_ARGS=(       ${BUILD_PARAMS}       --build-arg       img_path=$IMG_PATH       --build-arg       datagram_jars=datagram\/runtimelibs       --build-arg       spark_jars=assembly\/target\/scala-$SPARK_SCALA_VERSION\/jars     )   else     IMG_PATH=&quot;kubernetes\/dockerfiles&quot;     BUILD_ARGS=(${BUILD_PARAMS})   fi    if [ -z &quot;$IMG_PATH&quot; ]; then     error &quot;Cannot find docker image. This script must be run from a runnable distribution of Apache Spark.&quot;   fi    if [ -z &quot;$IMAGE_REF&quot; ]; then     error &quot;Cannot find docker image reference. Please add -i arg.&quot;   fi    local BINDING_BUILD_ARGS=(     ${BUILD_PARAMS}     --build-arg     base_img=$(image_ref $IMAGE_REF)   )   local BASEDOCKERFILE=${BASEDOCKERFILE:-&quot;$IMG_PATH\/spark\/docker\/Dockerfile&quot;}    docker build $NOCACHEARG &quot;${BUILD_ARGS[@]}&quot; \\     -t $(image_ref $IMAGE_REF) \\     -f &quot;$BASEDOCKERFILE&quot; . }  function push {   docker push &quot;$(image_ref $IMAGE_REF)&quot; }  function usage {   cat &lt;&lt;EOF Usage: $0 [options] [command] Builds or pushes the built-in Spark Docker image.  Commands:   build       Build image. Requires a repository address to be provided if the image will be               pushed to a different registry.   push        Push a pre-built image to a registry. Requires a repository address to be provided.  Options:   -f file               Dockerfile to build for JVM based Jobs. By default builds the Dockerfile shipped with Spark.   -p file               Dockerfile to build for PySpark Jobs. Builds Python dependencies and ships with Spark.   -R file               Dockerfile to build for SparkR Jobs. Builds R dependencies and ships with Spark.   -r repo               Repository address.   -i name               Image name to apply to the built image, or to identify the image to be pushed.     -t tag                Tag to apply to the built image, or to identify the image to be pushed.   -m                    Use minikube's Docker daemon.   -n                    Build docker image with --no-cache   -b arg      Build arg to build or push the image. For multiple build args, this option needs to               be used separately for each build arg.  Using minikube when building images will do so directly into minikube's Docker daemon. There is no need to push the images into minikube in that case, they'll be automatically available when running applications inside the minikube cluster.  Check the following documentation for more information on using the minikube Docker daemon:    https:\/\/kubernetes.io\/docs\/getting-started-guides\/minikube\/#reusing-the-docker-daemon  Examples:   - Build image in minikube with tag &quot;testing&quot;     $0 -m -t testing build    - Build and push image with tag &quot;v2.3.0&quot; to docker.io\/myrepo     $0 -r docker.io\/myrepo -t v2.3.0 build     $0 -r docker.io\/myrepo -t v2.3.0 push EOF }  if [[ &quot;$@&quot; = *--help ]] || [[ &quot;$@&quot; = *-h ]]; then   usage   exit 0 fi  REPO= TAG= BASEDOCKERFILE= NOCACHEARG= BUILD_PARAMS= IMAGE_REF= while getopts f:mr:t:nb:i: option do  case &quot;${option}&quot;  in  f) BASEDOCKERFILE=${OPTARG};;  r) REPO=${OPTARG};;  t) TAG=${OPTARG};;  n) NOCACHEARG=&quot;--no-cache&quot;;;  i) IMAGE_REF=${OPTARG};;  b) BUILD_PARAMS=${BUILD_PARAMS}&quot; --build-arg &quot;${OPTARG};;  esac done  case &quot;${@: -1}&quot; in   build)     build     ;;   push)     if [ -z &quot;$REPO&quot; ]; then       usage       exit 1     fi     push     ;;   *)     usage     exit 1     ;; esac <\/code><\/pre>\n<p>   \u0421 \u0435\u0451 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 Spark, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0432 \u0441\u0435\u0431\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u043b\u0430 Pi \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Spark (\u0437\u0434\u0435\u0441\u044c {docker-registry-url} \u2014 URL \u0432\u0430\u0448\u0435\u0433\u043e \u0440\u0435\u0435\u0441\u0442\u0440\u0430 \u043e\u0431\u0440\u0430\u0437\u043e\u0432 Docker, {repo} \u2014 \u0438\u043c\u044f \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u0440\u0435\u0435\u0441\u0442\u0440\u0430, \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0449\u0435\u0435 \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c \u0432 OpenShift, {image-name} \u2014 \u0438\u043c\u044f \u043e\u0431\u0440\u0430\u0437\u0430 (\u0435\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0442\u0440\u0451\u0445\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u043e\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0437\u043e\u0432, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u0430\u043a \u0432 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u0440\u0435\u0435\u0441\u0442\u0440\u0435 \u043e\u0431\u0440\u0430\u0437\u043e\u0432 Red Hat OpenShift), {tag} \u2014 \u0442\u0435\u0433 \u0434\u0430\u043d\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043e\u0431\u0440\u0430\u0437\u0430):<\/p>\n<pre><code class=\"plaintext\">.\/bin\/docker-image-tool-upd.sh -f resource-managers\/kubernetes\/docker\/src\/main\/dockerfiles\/spark\/Dockerfile -r {docker-registry-url}\/{repo} -i {image-name} -t {tag} build <\/code><\/pre>\n<p>   \u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0443\u0435\u043c\u0441\u044f \u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 OKD \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0439 \u0443\u0442\u0438\u043b\u0438\u0442\u044b (\u0437\u0434\u0435\u0441\u044c {OKD-API-URL} \u2014 URL API \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 OKD):<\/p>\n<pre><code class=\"plaintext\">oc login {OKD-API-URL} <\/code><\/pre>\n<p>   \u041f\u043e\u043b\u0443\u0447\u0438\u043c \u0442\u043e\u043a\u0435\u043d \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 Docker Registry:<\/p>\n<pre><code class=\"plaintext\">oc whoami -t <\/code><\/pre>\n<p>   \u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0443\u0435\u043c\u0441\u044f \u0432\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u043c Docker Registry \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 OKD (\u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u043e\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0442\u043e\u043a\u0435\u043d, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b):<\/p>\n<pre><code class=\"plaintext\">docker login {docker-registry-url} <\/code><\/pre>\n<p>   \u0417\u0430\u0433\u0440\u0443\u0437\u0438\u043c \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 Docker \u0432 Docker Registry OKD:<\/p>\n<pre><code class=\"plaintext\">.\/bin\/docker-image-tool-upd.sh -r {docker-registry-url}\/{repo} -i {image-name} -t {tag} push <\/code><\/pre>\n<p>   \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0447\u0442\u043e \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432 OKD. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043e\u0442\u043a\u0440\u043e\u0435\u043c \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 URL \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 (\u0437\u0434\u0435\u0441\u044c {project} \u2014 \u0438\u043c\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 OpenShift, {OKD-WEBUI-URL} \u2014 URL Web \u043a\u043e\u043d\u0441\u043e\u043b\u0438 OpenShift) \u2014 https:\/\/{OKD-WEBUI-URL}\/console\/project\/{project}\/browse\/images\/{image-name}.<\/p>\n<p>  \u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0437\u0430\u0434\u0430\u0447 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u044b\u0439 \u0430\u043a\u043a\u0430\u0443\u043d\u0442 \u0441 \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u044f\u043c\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u043e\u0434\u043e\u0432 \u043f\u043e\u0434 root (\u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043e\u0431\u0441\u0443\u0434\u0438\u043c \u044d\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442):<\/p>\n<pre><code class=\"plaintext\">oc create sa spark -n {project} oc adm policy add-scc-to-user anyuid -z spark -n {project} <\/code><\/pre>\n<p>   \u0412\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 spark-submit \u0434\u043b\u044f \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0437\u0430\u0434\u0430\u0447\u0438 Spark \u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 OKD, \u0443\u043a\u0430\u0437\u0430\u0432 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u044b\u0439 \u0430\u043a\u043a\u0430\u0443\u043d\u0442 \u0438 \u043e\u0431\u0440\u0430\u0437 Docker:<\/p>\n<pre><code class=\"plaintext\"> \/opt\/spark\/bin\/spark-submit --name spark-test --class org.apache.spark.examples.SparkPi --conf spark.executor.instances=3 --conf spark.kubernetes.authenticate.driver.serviceAccountName=spark --conf spark.kubernetes.namespace={project} --conf spark.submit.deployMode=cluster --conf spark.kubernetes.container.image={docker-registry-url}\/{repo}\/{image-name}:{tag} --conf spark.master=k8s:\/\/https:\/\/{OKD-API-URL}  local:\/\/\/opt\/spark\/examples\/target\/scala-2.11\/jars\/spark-examples_2.11-2.4.5.jar <\/code><\/pre>\n<p>   \u0417\u0434\u0435\u0441\u044c:<\/p>\n<p>  &#8212;name \u2014 \u0438\u043c\u044f \u0437\u0430\u0434\u0430\u0447\u0438, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0438\u043c\u0435\u043d\u0438 \u043f\u043e\u0434\u043e\u0432 Kubernetes;<\/p>\n<p>  &#8212;class \u2014 \u043a\u043b\u0430\u0441\u0441 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0439 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0437\u0430\u0434\u0430\u0447\u0438;<\/p>\n<p>  &#8212;conf \u2014 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b Spark;<\/p>\n<p>  spark.executor.instances \u2014 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u044b\u0445 \u044d\u043a\u0437\u0435\u043a\u044c\u044e\u0442\u043e\u0440\u043e\u0432 Spark;<\/p>\n<p>  spark.kubernetes.authenticate.driver.serviceAccountName \u2014 \u0438\u043c\u044f \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u043e\u0439 \u0443\u0447\u0451\u0442\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 Kubernetes, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0439 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043f\u043e\u0434\u043e\u0432 (\u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u043f\u0440\u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438 \u0441 API Kubernetes);<\/p>\n<p>  spark.kubernetes.namespace \u2014 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0438\u043c\u0451\u043d Kubernetes, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0434\u044b \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 \u0438 \u044d\u043a\u0437\u0435\u043a\u044c\u044e\u0442\u0435\u0440\u043e\u0432;<\/p>\n<p>  spark.submit.deployMode \u2014 \u0441\u043f\u043e\u0441\u043e\u0431 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 Spark (\u0434\u043b\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e spark-submit \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u00abcluster\u00bb, \u0434\u043b\u044f Spark Operator \u0438 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0437\u0434\u043d\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 Spark \u00abclient\u00bb);<\/p>\n<p>  spark.kubernetes.container.image \u2014 \u043e\u0431\u0440\u0430\u0437 Docker, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u043e\u0434\u043e\u0432;<\/p>\n<p>  spark.master \u2014 URL API Kubernetes (\u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0442\u0430\u043a \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b);<\/p>\n<p>  local:\/\/ \u2014 \u043f\u0443\u0442\u044c \u0434\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 Spark \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u0431\u0440\u0430\u0437\u0430 Docker.<\/p>\n<p>  \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 OKD \u0438 \u0438\u0437\u0443\u0447\u0430\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u0434\u044b \u2014 https:\/\/{OKD-WEBUI-URL}\/console\/project\/{project}\/browse\/pods.<\/p>\n<p>  \u0414\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u043f\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u043e\u0431\u0449\u0438\u0439 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 Spark, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0432\u0441\u0435\u043c\u0438 \u0437\u0430\u0434\u0430\u0447\u0430\u043c\u0438 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430, \u0430 \u0441\u043d\u044d\u043f\u0448\u043e\u0442\u044b \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u043f\u0443\u0431\u043b\u0438\u043a\u0443\u044e\u0442\u0441\u044f \u0432\u043e \u0432\u043d\u0435\u0448\u043d\u0435\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, Hadoop) \u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 spark-submit \u0432 \u0432\u0438\u0434\u0435 \u0441\u0441\u044b\u043b\u043a\u0438. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 \u0437\u0430\u0434\u0430\u0447 Spark \u0431\u0435\u0437 \u043f\u0435\u0440\u0435\u0441\u0431\u043e\u0440\u043a\u0438 \u043e\u0431\u0440\u0430\u0437\u043e\u0432 Docker, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0434\u043b\u044f \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u043e\u0431\u0440\u0430\u0437\u043e\u0432, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, WebHDFS. \u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 (\u0437\u0434\u0435\u0441\u044c {host} \u2014 \u0445\u043e\u0441\u0442 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 WebHDFS, {port} \u2014 \u043f\u043e\u0440\u0442 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 WebHDFS, {path-to-file-on-hdfs} \u2014 \u0436\u0435\u043b\u0430\u0435\u043c\u044b\u0439 \u043f\u0443\u0442\u044c \u043a \u0444\u0430\u0439\u043b\u0443 \u043d\u0430 HDFS):<\/p>\n<pre><code class=\"plaintext\">curl -i -X PUT &quot;http:\/\/{host}:{port}\/webhdfs\/v1\/{path-to-file-on-hdfs}?op=CREATE <\/code><\/pre>\n<p>   \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d \u043e\u0442\u0432\u0435\u0442 \u0432\u0438\u0434\u0430 (\u0437\u0434\u0435\u0441\u044c {location} \u2014 \u044d\u0442\u043e URL, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u0430):<\/p>\n<pre><code class=\"plaintext\">HTTP\/1.1 307 TEMPORARY_REDIRECT Location: {location} Content-Length: 0 <\/code><\/pre>\n<p>   \u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b Spark \u0432 HDFS (\u0437\u0434\u0435\u0441\u044c {path-to-local-file} \u2014 \u043f\u0443\u0442\u044c \u043a \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u043c\u0443 \u0444\u0430\u0439\u043b\u0443 Spark \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u0445\u043e\u0441\u0442\u0435):<\/p>\n<pre><code class=\"plaintext\">curl -i -X PUT -T {path-to-local-file} &quot;{location}&quot; <\/code><\/pre>\n<p>   \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c spark-submit \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0444\u0430\u0439\u043b\u0430 Spark, \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u043e\u0433\u043e \u043d\u0430 HDFS (\u0437\u0434\u0435\u0441\u044c {class-name} \u2014 \u0438\u043c\u044f \u043a\u043b\u0430\u0441\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438):<\/p>\n<pre><code class=\"plaintext\">\/opt\/spark\/bin\/spark-submit --name spark-test --class {class-name} --conf spark.executor.instances=3 --conf spark.kubernetes.authenticate.driver.serviceAccountName=spark --conf spark.kubernetes.namespace={project} --conf spark.submit.deployMode=cluster --conf spark.kubernetes.container.image={docker-registry-url}\/{repo}\/{image-name}:{tag} --conf spark.master=k8s:\/\/https:\/\/{OKD-API-URL}  hdfs:\/\/{host}:{port}\/{path-to-file-on-hdfs} <\/code><\/pre>\n<p>   \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0430\u0434\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a HDFS \u0438 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0437\u0430\u0434\u0430\u0447\u0438 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c Dockerfile \u0438 \u0441\u043a\u0440\u0438\u043f\u0442 entrypoint.sh \u2014 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 Dockerfile \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0443 \u0434\u043b\u044f \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \/opt\/spark\/jars \u0438 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 HDFS \u0432 SPARK_CLASSPATH \u0432 entrypoint.sh.<\/p>\n<h3> \u0412\u0442\u043e\u0440\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u2014 Apache Livy <\/h3>\n<p>   \u0414\u0430\u043b\u0435\u0435, \u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u0430 \u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u0435\u0451 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 CI\/CD \u0438 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u0443\u0441\u043e\u0432 \u0435\u0451 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0435\u0451 \u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 spark-submit, \u043d\u043e \u044d\u0442\u043e \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0435\u0442 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 CI\/CD \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e Spark \u043d\u0430 \u0430\u0433\u0435\u043d\u0442\u0430\u0445\/\u0440\u0430\u043d\u043d\u0435\u0440\u0430\u0445 CI \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a API Kubernetes. \u0414\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u043b\u0443\u0447\u0430\u044f \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0432\u044b\u0431\u0440\u0430\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Apache Livy \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 REST API \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0437\u0430\u0434\u0430\u0447 Spark, \u0440\u0430\u0437\u043c\u0435\u0449\u0451\u043d\u043d\u043e\u0433\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 Kubernetes. \u0421 \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438 Spark \u043d\u0430 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 Kubernetes \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043e\u0431\u044b\u0447\u043d\u044b\u0435 cURL \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u0447\u0442\u043e \u043b\u0435\u0433\u043a\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c\u043e \u043d\u0430 \u0431\u0430\u0437\u0435 \u043b\u044e\u0431\u043e\u0433\u043e CI \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u0430 \u0435\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 Kubernetes \u0440\u0435\u0448\u0430\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u0440\u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438 \u0441 API Kubernetes.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/xz\/he\/mf\/xzhemfuhjydgd7rkxzlhgdu-k0c.jpeg\"><\/p>\n<p>  \u0412\u044b\u0434\u0435\u043b\u0438\u043c \u0435\u0433\u043e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u2014 \u0437\u0430\u043f\u0443\u0441\u043a \u0437\u0430\u0434\u0430\u0447 Spark \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 CI\/CD \u043d\u0430 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 Kubernetes \u0432 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u043c \u043a\u043e\u043d\u0442\u0443\u0440\u0435.<\/p>\n<p>  \u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e Apache Livy \u2014 \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u0430\u043a HTTP \u0441\u0435\u0440\u0432\u0435\u0440, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 Web \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0438 RESTful API, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c spark-submit, \u043f\u0435\u0440\u0435\u0434\u0430\u0432 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b. \u0422\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u043e \u043e\u043d \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u043b\u0441\u044f \u0432 \u0441\u043e\u0441\u0442\u0430\u0432\u0435 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u0430 HDP, \u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u0432\u0451\u0440\u043d\u0443\u0442 \u0432 OKD \u0438\u043b\u0438 \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0446\u0438\u0438 Kubernetes \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0430 \u0438 \u043d\u0430\u0431\u043e\u0440\u0430 \u043e\u0431\u0440\u0430\u0437\u043e\u0432 Docker, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u044d\u0442\u043e\u0433\u043e \u2014 <a href=\"https:\/\/github.com\/ttauveron\/k8s-big-data-experiments\/tree\/master\/livy-spark-2.3\">github.com\/ttauveron\/k8s-big-data-experiments\/tree\/master\/livy-spark-2.3<\/a>. \u0414\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u043b\u0443\u0447\u0430\u044f \u0431\u044b\u043b \u0441\u043e\u0431\u0440\u0430\u043d \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 Docker, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0438\u0439 \u0432 \u0441\u0435\u0431\u044f Spark \u0432\u0435\u0440\u0441\u0438\u0438 2.4.5 \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e Dockerfile:<\/p>\n<pre><code class=\"plaintext\">FROM java:8-alpine  ENV SPARK_HOME=\/opt\/spark ENV LIVY_HOME=\/opt\/livy ENV HADOOP_CONF_DIR=\/etc\/hadoop\/conf ENV SPARK_USER=spark  WORKDIR \/opt  RUN apk add --update openssl wget bash &amp;&amp; \\     wget -P \/opt https:\/\/downloads.apache.org\/spark\/spark-2.4.5\/spark-2.4.5-bin-hadoop2.7.tgz &amp;&amp; \\     tar xvzf spark-2.4.5-bin-hadoop2.7.tgz &amp;&amp; \\     rm spark-2.4.5-bin-hadoop2.7.tgz &amp;&amp; \\     ln -s \/opt\/spark-2.4.5-bin-hadoop2.7 \/opt\/spark  RUN wget http:\/\/mirror.its.dal.ca\/apache\/incubator\/livy\/0.7.0-incubating\/apache-livy-0.7.0-incubating-bin.zip &amp;&amp; \\     unzip apache-livy-0.7.0-incubating-bin.zip &amp;&amp; \\     rm apache-livy-0.7.0-incubating-bin.zip &amp;&amp; \\     ln -s \/opt\/apache-livy-0.7.0-incubating-bin \/opt\/livy &amp;&amp; \\     mkdir \/var\/log\/livy &amp;&amp; \\     ln -s \/var\/log\/livy \/opt\/livy\/logs &amp;&amp; \\     cp \/opt\/livy\/conf\/log4j.properties.template \/opt\/livy\/conf\/log4j.properties  ADD livy.conf \/opt\/livy\/conf ADD spark-defaults.conf \/opt\/spark\/conf\/spark-defaults.conf ADD entrypoint.sh \/entrypoint.sh  ENV PATH=&quot;\/opt\/livy\/bin:${PATH}&quot;  EXPOSE 8998  ENTRYPOINT [&quot;\/entrypoint.sh&quot;] CMD [&quot;livy-server&quot;] <\/code><\/pre>\n<p>   \u0421\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u043e\u0431\u0440\u0430\u043d \u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d \u0432 \u0438\u043c\u0435\u044e\u0449\u0438\u0439\u0441\u044f \u0443 \u0432\u0430\u0441 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 Docker, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 OKD. \u0414\u043b\u044f \u0435\u0433\u043e \u0440\u0430\u0437\u0432\u0451\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442 ({registry-url} \u2014 URL \u0440\u0435\u0435\u0441\u0442\u0440\u0430 \u043e\u0431\u0440\u0430\u0437\u043e\u0432 Docker, {image-name} \u2014 \u0438\u043c\u044f \u043e\u0431\u0440\u0430\u0437\u0430 Docker, {tag} \u2014 \u0442\u0435\u0433 \u043e\u0431\u0440\u0430\u0437\u0430 Docker, {livy-url} \u2014 \u0436\u0435\u043b\u0430\u0435\u043c\u044b\u0439 URL, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0441\u0435\u0440\u0432\u0435\u0440 Livy; \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442 \u00abRoute\u00bb \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u0430 Kubernetes \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f Red Hat OpenShift, \u0432 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442 Ingress \u0438\u043b\u0438 Service \u0442\u0438\u043f\u0430 NodePort):<\/p>\n<pre><code class=\"plaintext\">--- apiVersion: apps\/v1 kind: Deployment metadata:   labels:     component: livy   name: livy spec:   progressDeadlineSeconds: 600   replicas: 1   revisionHistoryLimit: 10   selector:     matchLabels:       component: livy   strategy:     rollingUpdate:       maxSurge: 25%       maxUnavailable: 25%     type: RollingUpdate   template:     metadata:       creationTimestamp: null       labels:         component: livy     spec:       containers:         - command:             - livy-server           env:             - name: K8S_API_HOST               value: localhost             - name: SPARK_KUBERNETES_IMAGE               value: 'gnut3ll4\/spark:v1.0.14'           image: '{registry-url}\/{image-name}:{tag}'           imagePullPolicy: Always           name: livy           ports:             - containerPort: 8998               name: livy-rest               protocol: TCP           resources: {}           terminationMessagePath: \/dev\/termination-log           terminationMessagePolicy: File           volumeMounts:             - mountPath: \/var\/log\/livy               name: livy-log             - mountPath: \/opt\/.livy-sessions\/               name: livy-sessions             - mountPath: \/opt\/livy\/conf\/livy.conf               name: livy-config               subPath: livy.conf             - mountPath: \/opt\/spark\/conf\/spark-defaults.conf               name: spark-config               subPath: spark-defaults.conf         - command:             - \/usr\/local\/bin\/kubectl             - proxy             - '--port'             - '8443'           image: 'gnut3ll4\/kubectl-sidecar:latest'           imagePullPolicy: Always           name: kubectl           ports:             - containerPort: 8443               name: k8s-api               protocol: TCP           resources: {}           terminationMessagePath: \/dev\/termination-log           terminationMessagePolicy: File       dnsPolicy: ClusterFirst       restartPolicy: Always       schedulerName: default-scheduler       securityContext: {}       serviceAccount: spark       serviceAccountName: spark       terminationGracePeriodSeconds: 30       volumes:         - emptyDir: {}           name: livy-log         - emptyDir: {}           name: livy-sessions         - configMap:             defaultMode: 420             items:               - key: livy.conf                 path: livy.conf             name: livy-config           name: livy-config         - configMap:             defaultMode: 420             items:               - key: spark-defaults.conf                 path: spark-defaults.conf             name: livy-config           name: spark-config --- apiVersion: v1 kind: ConfigMap metadata:   name: livy-config data:   livy.conf: |-     livy.spark.deploy-mode=cluster     livy.file.local-dir-whitelist=\/opt\/.livy-sessions\/     livy.spark.master=k8s:\/\/http:\/\/localhost:8443     livy.server.session.state-retain.sec = 8h   spark-defaults.conf: 'spark.kubernetes.container.image        &quot;gnut3ll4\/spark:v1.0.14&quot;' --- apiVersion: v1 kind: Service metadata:   labels:     app: livy   name: livy spec:   ports:     - name: livy-rest       port: 8998       protocol: TCP       targetPort: 8998   selector:     component: livy   sessionAffinity: None   type: ClusterIP --- apiVersion: route.openshift.io\/v1 kind: Route metadata:   labels:     app: livy   name: livy spec:   host: {livy-url}   port:     targetPort: livy-rest   to:     kind: Service     name: livy     weight: 100   wildcardPolicy: None <\/code><\/pre>\n<p>   \u041f\u043e\u0441\u043b\u0435 \u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u043e\u0434\u0430 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 Livy \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435: http:\/\/{livy-url}\/ui. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Livy \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448\u0443 \u0437\u0430\u0434\u0430\u0447\u0443 Spark, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f REST \u0437\u0430\u043f\u0440\u043e\u0441, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0438\u0437 Postman. \u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u0441 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043d\u0438\u0436\u0435 (\u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u00abargs\u00bb \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u044b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u043c\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438):<\/p>\n<pre><code class=\"json\">{     &quot;info&quot;: {         &quot;_postman_id&quot;: &quot;be135198-d2ff-47b6-a33e-0d27b9dba4c8&quot;,         &quot;name&quot;: &quot;Spark Livy&quot;,         &quot;schema&quot;: &quot;https:\/\/schema.getpostman.com\/json\/collection\/v2.1.0\/collection.json&quot;     },     &quot;item&quot;: [         {             &quot;name&quot;: &quot;1 Submit job with jar&quot;,             &quot;request&quot;: {                 &quot;method&quot;: &quot;POST&quot;,                 &quot;header&quot;: [                     {                         &quot;key&quot;: &quot;Content-Type&quot;,                         &quot;value&quot;: &quot;application\/json&quot;                     }                 ],                 &quot;body&quot;: {                     &quot;mode&quot;: &quot;raw&quot;,                     &quot;raw&quot;: &quot;{\\n\\t\\&quot;file\\&quot;: \\&quot;local:\/\/\/opt\/spark\/examples\/target\/scala-2.11\/jars\/spark-examples_2.11-2.4.5.jar\\&quot;, \\n\\t\\&quot;className\\&quot;: \\&quot;org.apache.spark.examples.SparkPi\\&quot;,\\n\\t\\&quot;numExecutors\\&quot;:1,\\n\\t\\&quot;name\\&quot;: \\&quot;spark-test-1\\&quot;,\\n\\t\\&quot;conf\\&quot;: {\\n\\t\\t\\&quot;spark.jars.ivy\\&quot;: \\&quot;\/tmp\/.ivy\\&quot;,\\n\\t\\t\\&quot;spark.kubernetes.authenticate.driver.serviceAccountName\\&quot;: \\&quot;spark\\&quot;,\\n\\t\\t\\&quot;spark.kubernetes.namespace\\&quot;: \\&quot;{project}\\&quot;,\\n\\t\\t\\&quot;spark.kubernetes.container.image\\&quot;: \\&quot;{docker-registry-url}\/{repo}\/{image-name}:{tag}\\&quot;\\n\\t}\\n}&quot;                 },                 &quot;url&quot;: {                     &quot;raw&quot;: &quot;http:\/\/{livy-url}\/batches&quot;,                     &quot;protocol&quot;: &quot;http&quot;,                     &quot;host&quot;: [                         &quot;{livy-url}&quot;                     ],                     &quot;path&quot;: [                         &quot;batches&quot;                     ]                 }             },             &quot;response&quot;: []         },         {             &quot;name&quot;: &quot;2 Submit job without jar&quot;,             &quot;request&quot;: {                 &quot;method&quot;: &quot;POST&quot;,                 &quot;header&quot;: [                     {                         &quot;key&quot;: &quot;Content-Type&quot;,                         &quot;value&quot;: &quot;application\/json&quot;                     }                 ],                 &quot;body&quot;: {                     &quot;mode&quot;: &quot;raw&quot;,                     &quot;raw&quot;: &quot;{\\n\\t\\&quot;file\\&quot;: \\&quot;hdfs:\/\/{host}:{port}\/{path-to-file-on-hdfs}\\&quot;, \\n\\t\\&quot;className\\&quot;: \\&quot;{class-name}\\&quot;,\\n\\t\\&quot;numExecutors\\&quot;:1,\\n\\t\\&quot;name\\&quot;: \\&quot;spark-test-2\\&quot;,\\n\\t\\&quot;proxyUser\\&quot;: \\&quot;0\\&quot;,\\n\\t\\&quot;conf\\&quot;: {\\n\\t\\t\\&quot;spark.jars.ivy\\&quot;: \\&quot;\/tmp\/.ivy\\&quot;,\\n\\t\\t\\&quot;spark.kubernetes.authenticate.driver.serviceAccountName\\&quot;: \\&quot;spark\\&quot;,\\n\\t\\t\\&quot;spark.kubernetes.namespace\\&quot;: \\&quot;{project}\\&quot;,\\n\\t\\t\\&quot;spark.kubernetes.container.image\\&quot;: \\&quot;{docker-registry-url}\/{repo}\/{image-name}:{tag}\\&quot;\\n\\t},\\n\\t\\&quot;args\\&quot;: [\\n\\t\\t\\&quot;HADOOP_CONF_DIR=\/opt\/spark\/hadoop-conf\\&quot;,\\n\\t\\t\\&quot;MASTER=k8s:\/\/https:\/\/kubernetes.default.svc:8443\\&quot;\\n\\t]\\n}&quot;                 },                 &quot;url&quot;: {                     &quot;raw&quot;: &quot;http:\/\/{livy-url}\/batches&quot;,                     &quot;protocol&quot;: &quot;http&quot;,                     &quot;host&quot;: [                         &quot;{livy-url}&quot;                     ],                     &quot;path&quot;: [                         &quot;batches&quot;                     ]                 }             },             &quot;response&quot;: []         }     ],     &quot;event&quot;: [         {             &quot;listen&quot;: &quot;prerequest&quot;,             &quot;script&quot;: {                 &quot;id&quot;: &quot;41bea1d0-278c-40c9-ad42-bf2e6268897d&quot;,                 &quot;type&quot;: &quot;text\/javascript&quot;,                 &quot;exec&quot;: [                     &quot;&quot;                 ]             }         },         {             &quot;listen&quot;: &quot;test&quot;,             &quot;script&quot;: {                 &quot;id&quot;: &quot;3cdd7736-a885-4a2d-9668-bd75798f4560&quot;,                 &quot;type&quot;: &quot;text\/javascript&quot;,                 &quot;exec&quot;: [                     &quot;&quot;                 ]             }         }     ],     &quot;protocolProfileBehavior&quot;: {} } <\/code><\/pre>\n<p>   \u0412\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043f\u0435\u0440\u0432\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0438\u0437 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438, \u043f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 OKD \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0447\u0442\u043e \u0437\u0430\u0434\u0430\u0447\u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u0430 \u2014 https:\/\/{OKD-WEBUI-URL}\/console\/project\/{project}\/browse\/pods. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 Livy (http:\/\/{livy-url}\/ui) \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u0441\u0435\u0441\u0441\u0438\u044f, \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e API Livy \u0438\u043b\u0438 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u0445\u043e\u0434 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u0438 \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u043b\u043e\u0433\u0438 \u0441\u0435\u0441\u0441\u0438\u0438.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043a\u0430\u0436\u0435\u043c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0440\u0430\u0431\u043e\u0442\u044b Livy. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0437\u0443\u0447\u0438\u043c \u0436\u0443\u0440\u043d\u0430\u043b\u044b \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 Livy \u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u043e\u0434\u0430 \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c Livy \u2014 https:\/\/{OKD-WEBUI-URL}\/console\/project\/{project}\/browse\/pods\/{livy-pod-name}?tab=logs. \u0418\u0437 \u043d\u0438\u0445 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 REST API Livy \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c \u00ablivy\u00bb \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f spark-submit, \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u043c\u0443 \u043d\u0430\u043c\u0438 \u0432\u044b\u0448\u0435 (\u0437\u0434\u0435\u0441\u044c {livy-pod-name} \u2014 \u0438\u043c\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0430 \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c Livy). \u0412 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u0432\u0442\u043e\u0440\u043e\u0439 \u0437\u0430\u043f\u0440\u043e\u0441, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438 \u0441 \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u044b\u043c \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 Spark \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 Livy.<\/p>\n<h3> \u0422\u0440\u0435\u0442\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u2014 Spark Operator <\/h3>\n<p>   \u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0430, \u0432\u0441\u0442\u0430\u0451\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u0435\u0451 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430. \u041d\u0430\u0442\u0438\u0432\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u0434\u043b\u044f \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0437\u0430\u0434\u0430\u0447 \u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 Kubernetes \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c CronJob \u0438 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0451, \u043d\u043e \u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u044c \u0438\u043c\u0435\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438 \u0432 Kubernetes \u0438 \u0434\u043b\u044f Spark \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0437\u0440\u0435\u043b\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u0445 Enterprise \u0443\u0440\u043e\u0432\u043d\u044f (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, Lightbend FastData Platform). \u041c\u044b \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u2014 \u0442\u0435\u043a\u0443\u0449\u0430\u044f \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f Spark (2.4.5) \u0438\u043c\u0435\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0437\u0430\u0434\u0430\u0447 Spark \u0432 Kubernetes, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043c\u0430\u0436\u043e\u0440\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 (3.0.0) \u0437\u0430\u044f\u0432\u043b\u0435\u043d\u0430 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u0430\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 Kubernetes, \u043d\u043e \u0434\u0430\u0442\u0430 \u0435\u0451 \u0432\u044b\u0445\u043e\u0434\u0430 \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0439. Spark Operator \u043a\u043e\u043c\u043f\u0435\u043d\u0441\u0438\u0440\u0443\u0435\u0442 \u044d\u0442\u043e\u0442 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u043a, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044f \u0432\u0430\u0436\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 ConfigMap \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a Hadoop \u0432 \u043f\u043e\u0434\u044b Spark) \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0438 \u043f\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044e.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/1_\/pv\/gf\/1_pvgf1zaoo0sfjixgg8duwgojw.jpeg\"><br \/>   \u0412\u044b\u0434\u0435\u043b\u0438\u043c \u0435\u0433\u043e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0442\u0440\u0435\u0442\u044c\u0435\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u2014 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a \u0437\u0430\u0434\u0430\u0447 Spark \u043d\u0430 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 Kubernetes \u0432 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0438\u0432\u043d\u043e\u043c \u043a\u043e\u043d\u0442\u0443\u0440\u0435.<\/p>\n<p>  Spark Operator \u0438\u043c\u0435\u0435\u0442 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 Google Cloud Platform \u2014 <a href=\"https:\/\/github.com\/GoogleCloudPlatform\/spark-on-k8s-operator\">github.com\/GoogleCloudPlatform\/spark-on-k8s-operator<\/a>. \u0415\u0433\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0430 3 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438:<\/p>\n<ol>\n<li> \u0412 \u0440\u0430\u043c\u043a\u0430\u0445 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 Lightbend FastData Platform\/Cloudflow;<\/li>\n<li> \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Helm:<br \/> \n<pre><code class=\"plaintext\">helm repo add incubator http:\/\/storage.googleapis.com\/kubernetes-charts-incubator helm install incubator\/sparkoperator --namespace spark-operator \t<\/code><\/pre>\n<p>   <\/li>\n<li> \u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u043e\u0432 \u0438\u0437 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f (https:\/\/github.com\/GoogleCloudPlatform\/spark-on-k8s-operator\/tree\/master\/manifest). \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u2014 \u0432 \u0441\u043e\u0441\u0442\u0430\u0432 Cloudflow \u0432\u0445\u043e\u0434\u0438\u0442 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0441 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 API v1beta1. \u0415\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0439 \u0442\u0438\u043f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438, \u0442\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u043e\u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 Spark \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u0442\u0440\u043e\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0438\u0437 \u0442\u0435\u0433\u043e\u0432 \u0432 Git \u0441 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 API, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u00abv1beta1-0.9.0-2.4.0\u00bb. \u0412\u0435\u0440\u0441\u0438\u044e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0438 CRD, \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u0432 \u0441\u043e\u0441\u0442\u0430\u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u0435 \u00abversions\u00bb:<br \/> \n<pre><code class=\"plaintext\">oc get crd sparkapplications.sparkoperator.k8s.io -o yaml \t<\/code><\/pre>\n<p>   <\/li>\n<\/ol>\n<p>   \u0415\u0441\u043b\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e, \u0442\u043e \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u043f\u043e\u0434 \u0441 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u043c Spark (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, cloudflow-fdp-sparkoperator \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 Cloudflow \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 Cloudflow) \u0438 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0442\u0438\u043f \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 Kubernetes \u0441 \u0438\u043c\u0435\u043d\u0435\u043c \u00absparkapplications\u00bb. \u0418\u0437\u0443\u0447\u0438\u0442\u044c \u0438\u043c\u0435\u044e\u0449\u0438\u0435\u0441\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 Spark \u043c\u043e\u0436\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<pre><code class=\"plaintext\">oc get sparkapplications -n {project} <\/code><\/pre>\n<p>   \u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0437\u0430\u0434\u0430\u0447 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Spark Operator \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c 3 \u0432\u0435\u0449\u0438:<\/p>\n<ul>\n<li> \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0437 Docker, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0438\u0439 \u0432 \u0441\u0435\u0431\u044f \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0435 \u0444\u0430\u0439\u043b\u044b. \u0412 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u043a\u0430\u0440\u0442\u0438\u043d\u0435 \u044d\u0442\u043e \u043e\u0431\u0440\u0430\u0437, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 CI\/CD \u0438 \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u043c \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435;<\/li>\n<li> \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0437 Docker \u0432 \u0440\u0435\u0435\u0441\u0442\u0440, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0439 \u0438\u0437 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 Kubernetes;<\/li>\n<li> \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442 \u0441 \u0442\u0438\u043f\u043e\u043c \u00abSparkApplication\u00bb \u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438. \u041f\u0440\u0438\u043c\u0435\u0440\u044b \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u043e\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <a href=\"https:\/\/github.com\/GoogleCloudPlatform\/spark-on-k8s-operator\/blob\/v1beta1-0.9.0-2.4.0\/examples\/spark-pi.yaml\">github.com\/GoogleCloudPlatform\/spark-on-k8s-operator\/blob\/v1beta1-0.9.0-2.4.0\/examples\/spark-pi.yaml<\/a>). \u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u0432\u0430\u0436\u043d\u044b\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u043a\u0430\u0441\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0430:<br \/> \n<ol>\n<li> \u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u0435 \u00abapiVersion\u00bb \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u043d\u0430 \u0432\u0435\u0440\u0441\u0438\u044f API, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430;<\/li>\n<li> \u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u0435 \u00abmetadata.namespace\u00bb \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0438\u043c\u0451\u043d, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435;<\/li>\n<li> \u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u0435 \u00abspec.image\u00bb \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u043d \u0430\u0434\u0440\u0435\u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0437\u0430 Docker \u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u043c \u0440\u0435\u0435\u0441\u0442\u0440\u0435;<\/li>\n<li> \u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u0435 \u00abspec.mainClass\u00bb \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u043d \u043a\u043b\u0430\u0441\u0441 \u0437\u0430\u0434\u0430\u0447\u0438 Spark, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430;<\/li>\n<li> \u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u0435 \u00abspec.mainApplicationFile\u00bb \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u043d \u043f\u0443\u0442\u044c \u043a \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u043c\u0443 jar \u0444\u0430\u0439\u043b\u0443;<\/li>\n<li> \u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u0435 \u00abspec.sparkVersion\u00bb \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f Spark;<\/li>\n<li> \u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u0435 \u00abspec.driver.serviceAccount\u00bb \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u043d\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u0430\u044f \u0443\u0447\u0451\u0442\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0438\u043c\u0451\u043d Kubernetes, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f;<\/li>\n<li> \u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u0435 \u00abspec.executor\u00bb \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u043d\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e;<\/li>\n<li> \u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u0435 \u00abspec.volumeMounts\u00bb \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0437\u0430\u0434\u0430\u0447\u0438 Spark.<\/li>\n<\/ol>\n<p>   <\/li>\n<\/ul>\n<p>   \u041f\u0440\u0438\u043c\u0435\u0440 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0430 (\u0437\u0434\u0435\u0441\u044c {spark-service-account} \u2014 \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u044b\u0439 \u0430\u043a\u043a\u0430\u0443\u043d\u0442 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 Kubernetes \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0437\u0430\u0434\u0430\u0447 Spark):<\/p>\n<pre><code class=\"plaintext\">apiVersion: &quot;sparkoperator.k8s.io\/v1beta1&quot; kind: SparkApplication metadata:   name: spark-pi   namespace: {project} spec:   type: Scala   mode: cluster   image: &quot;gcr.io\/spark-operator\/spark:v2.4.0&quot;   imagePullPolicy: Always   mainClass: org.apache.spark.examples.SparkPi   mainApplicationFile: &quot;local:\/\/\/opt\/spark\/examples\/jars\/spark-examples_2.11-2.4.0.jar&quot;   sparkVersion: &quot;2.4.0&quot;   restartPolicy:     type: Never   volumes:     - name: &quot;test-volume&quot;       hostPath:         path: &quot;\/tmp&quot;         type: Directory   driver:     cores: 0.1     coreLimit: &quot;200m&quot;     memory: &quot;512m&quot;     labels:       version: 2.4.0     serviceAccount: {spark-service-account}     volumeMounts:       - name: &quot;test-volume&quot;         mountPath: &quot;\/tmp&quot;   executor:     cores: 1     instances: 1     memory: &quot;512m&quot;     labels:       version: 2.4.0     volumeMounts:       - name: &quot;test-volume&quot;         mountPath: &quot;\/tmp&quot; <\/code><\/pre>\n<p>   \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u0430\u044f \u0443\u0447\u0451\u0442\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u043e \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0430 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438 \u0440\u043e\u043b\u0435\u0439, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0440\u0430\u0432\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f Spark \u0441 API Kubernetes (\u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e). \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e \u043d\u0443\u0436\u043d\u044b \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 Pod&#8217;\u043e\u0432. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0443 \u0440\u043e\u043b\u0438:<\/p>\n<pre><code class=\"plaintext\">oc adm policy add-role-to-user edit system:serviceaccount:{project}:{spark-service-account} -n {project} <\/code><\/pre>\n<p>   \u0422\u0430\u043a\u0436\u0435 \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u043d \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u00abhadoopConfigMap\u00bb, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u044c ConfigMap \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439 Hadoop \u0431\u0435\u0437 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u043e\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0432 \u043e\u0431\u0440\u0430\u0437 Docker. \u0422\u0430\u043a\u0436\u0435 \u043e\u043d \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0437\u0430\u0434\u0430\u0447 \u2014 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u00abschedule\u00bb \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u043d\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0434\u0430\u043d\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438.<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u043d\u0430\u0448 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442 \u0432 \u0444\u0430\u0439\u043b spark-pi.yaml \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c \u0435\u0433\u043e \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0443 Kubernetes:<\/p>\n<pre><code class=\"plaintext\">oc apply -f spark-pi.yaml <\/code><\/pre>\n<p>   \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u0441\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442 \u0442\u0438\u043f\u0430 \u00absparkapplications\u00bb:<\/p>\n<pre><code class=\"plaintext\">oc get sparkapplications -n {project} &gt; NAME       AGE &gt; spark-pi   22h <\/code><\/pre>\n<p>   \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d \u043f\u043e\u0434 \u0441 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c, \u0441\u0442\u0430\u0442\u0443\u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u0432 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u043c \u00absparkapplications\u00bb. \u0415\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<pre><code class=\"plaintext\">oc get sparkapplications spark-pi -o yaml -n {project} <\/code><\/pre>\n<p>   \u041f\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u0437\u0430\u0434\u0430\u0447\u0438 POD \u043f\u0435\u0440\u0435\u0439\u0434\u0451\u0442 \u0432 \u0441\u0442\u0430\u0442\u0443\u0441 \u00abCompleted\u00bb, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0442\u0430\u043a\u0436\u0435 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0432 \u00absparkapplications\u00bb. \u041b\u043e\u0433\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u0438\u043b\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b (\u0437\u0434\u0435\u0441\u044c {sparkapplications-pod-name} \u2014 \u0438\u043c\u044f \u043f\u043e\u0434\u0430 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438):<\/p>\n<pre><code class=\"plaintext\">oc logs {sparkapplications-pod-name} -n {project} <\/code><\/pre>\n<p>   \u0422\u0430\u043a\u0436\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0430\u043c\u0438 Spark \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u0435\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0443\u0442\u0438\u043b\u0438\u0442\u044b sparkctl. \u0414\u043b\u044f \u0435\u0451 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043a\u043b\u043e\u043d\u0438\u0440\u0443\u0435\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0441 \u0435\u0451 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c Go \u0438 \u0441\u043e\u0431\u0435\u0440\u0451\u043c \u0434\u0430\u043d\u043d\u0443\u044e \u0443\u0442\u0438\u043b\u0438\u0442\u0443:<\/p>\n<pre><code class=\"plaintext\">git clone https:\/\/github.com\/GoogleCloudPlatform\/spark-on-k8s-operator.git cd spark-on-k8s-operator\/ wget https:\/\/dl.google.com\/go\/go1.13.3.linux-amd64.tar.gz tar -xzf go1.13.3.linux-amd64.tar.gz sudo mv go \/usr\/local mkdir $HOME\/Projects export GOROOT=\/usr\/local\/go export GOPATH=$HOME\/Projects export PATH=$GOPATH\/bin:$GOROOT\/bin:$PATH go -version cd sparkctl go build -o sparkctl sudo mv sparkctl \/usr\/local\/bin <\/code><\/pre>\n<p>   \u0418\u0437\u0443\u0447\u0438\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 Spark:<\/p>\n<pre><code class=\"plaintext\">sparkctl list -n {project} <\/code><\/pre>\n<p>   \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u0447\u0438 Spark:<\/p>\n<pre><code class=\"plaintext\">vi spark-app.yaml <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">apiVersion: &quot;sparkoperator.k8s.io\/v1beta1&quot; kind: SparkApplication metadata:   name: spark-pi   namespace: {project} spec:   type: Scala   mode: cluster   image: &quot;gcr.io\/spark-operator\/spark:v2.4.0&quot;   imagePullPolicy: Always   mainClass: org.apache.spark.examples.SparkPi   mainApplicationFile: &quot;local:\/\/\/opt\/spark\/examples\/jars\/spark-examples_2.11-2.4.0.jar&quot;   sparkVersion: &quot;2.4.0&quot;   restartPolicy:     type: Never   volumes:     - name: &quot;test-volume&quot;       hostPath:         path: &quot;\/tmp&quot;         type: Directory   driver:     cores: 1     coreLimit: &quot;1000m&quot;     memory: &quot;512m&quot;     labels:       version: 2.4.0     serviceAccount: spark     volumeMounts:       - name: &quot;test-volume&quot;         mountPath: &quot;\/tmp&quot;   executor:     cores: 1     instances: 1     memory: &quot;512m&quot;     labels:       version: 2.4.0     volumeMounts:       - name: &quot;test-volume&quot;         mountPath: &quot;\/tmp&quot; <\/code><\/pre>\n<p>   \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e sparkctl:<\/p>\n<pre><code class=\"plaintext\">sparkctl create spark-app.yaml -n {project} <\/code><\/pre>\n<p>   \u0418\u0437\u0443\u0447\u0438\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 Spark:<\/p>\n<pre><code class=\"plaintext\">sparkctl list -n {project} <\/code><\/pre>\n<p>   \u0418\u0437\u0443\u0447\u0438\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 Spark:<\/p>\n<pre><code class=\"plaintext\">sparkctl event spark-pi -n {project} -f <\/code><\/pre>\n<p>   \u0418\u0437\u0443\u0447\u0438\u043c \u0441\u0442\u0430\u0442\u0443\u0441 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 Spark:<\/p>\n<pre><code class=\"plaintext\">sparkctl status spark-pi -n {project} <\/code><\/pre>\n<p>   \u0412 \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0435 \u043c\u0438\u043d\u0443\u0441\u044b \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u0438 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 Spark (2.4.5) \u0432 Kubernetes:<\/p>\n<ol>\n<li> \u041f\u0435\u0440\u0432\u044b\u0439 \u0438, \u043f\u043e\u0436\u0430\u043b\u0443\u0439, \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u043c\u0438\u043d\u0443\u0441 \u2014 \u044d\u0442\u043e \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 Data Locality. \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0432\u0441\u0435 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438 YARN \u0431\u044b\u043b\u0438 \u0438 \u043f\u043b\u044e\u0441\u044b \u0432 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438 \u043a\u043e\u0434\u0430 \u043a \u0434\u0430\u043d\u043d\u044b\u043c (\u0430 \u043d\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043a \u043a\u043e\u0434\u0443). \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0435\u043c\u0443 \u0437\u0430\u0434\u0430\u0447\u0438 Spark \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0438\u0441\u044c \u043d\u0430 \u0443\u0437\u043b\u0430\u0445, \u0433\u0434\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u043b\u0438\u0441\u044c \u0434\u0430\u043d\u043d\u044b\u0435, \u0443\u0447\u0430\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0432 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f\u0445, \u0438 \u0437\u0430\u043c\u0435\u0442\u043d\u043e \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u043b\u043e\u0441\u044c \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u0441\u0435\u0442\u0438. \u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 Kubernetes \u043c\u044b \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u043c\u0441\u044f \u0441 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u043f\u043e \u0441\u0435\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0432 \u0440\u0430\u0431\u043e\u0442\u0435 \u0437\u0430\u0434\u0430\u0447\u0438. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u0435, \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u043c\u043e\u0436\u0435\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c\u0441\u044f, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043e\u0431\u044a\u0451\u043c \u0434\u0438\u0441\u043a\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430, \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430\u043c \u0437\u0430\u0434\u0430\u0447\u0438 Spark \u0434\u043b\u044f \u0438\u0445 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f. \u0414\u0430\u043d\u043d\u044b\u0439 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u043a \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u043d\u0438\u0436\u0435\u043d \u0437\u0430 \u0441\u0447\u0451\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0445 \u0441\u0440\u0435\u0434\u0441\u0442\u0432, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u0445 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 Kubernetes (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, Alluxio), \u043d\u043e \u044d\u0442\u043e \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u043d\u043e\u0439 \u043a\u043e\u043f\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0443\u0437\u043b\u0430\u0445 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 Kubernetes.<\/li>\n<li> \u0412\u0442\u043e\u0440\u043e\u0439 \u0432\u0430\u0436\u043d\u044b\u0439 \u043c\u0438\u043d\u0443\u0441 \u2014 \u044d\u0442\u043e \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u0435\u043c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u043a\u0430\u0441\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0437\u0430\u0434\u0430\u0447 Spark \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u044b, \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Kerberos \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043d\u0435 \u043e\u0445\u0432\u0430\u0447\u0435\u043d (\u0445\u043e\u0442\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u0432 \u0432\u0435\u0440\u0441\u0438\u0438 3.0.0, \u0447\u0442\u043e \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0438), \u0430 \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043f\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044e \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 Spark (https:\/\/spark.apache.org\/docs\/2.4.5\/security.html) \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449 \u043a\u043b\u044e\u0447\u0435\u0439 \u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e YARN, Mesos \u0438 Standalone Cluster. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c, \u043f\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442\u0441\u044f \u0437\u0430\u0434\u0430\u0447\u0438 Spark, \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u043d \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u2014 \u043c\u044b \u043b\u0438\u0448\u044c \u0437\u0430\u0434\u0430\u0451\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u0443\u044e \u0443\u0447\u0451\u0442\u043d\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c, \u043f\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u043e\u0434, \u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u043f\u043e\u043b\u0438\u0442\u0438\u043a \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438. \u0412 \u0441\u0432\u044f\u0437\u0438 \u0441 \u044d\u0442\u0438\u043c \u043b\u0438\u0431\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c root, \u0447\u0442\u043e \u043d\u0435 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e \u0432 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0438\u0432\u043d\u043e\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438, \u043b\u0438\u0431\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c UID, \u0447\u0442\u043e \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u043e \u043f\u0440\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u043f\u0440\u0430\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0434\u0430\u043d\u043d\u044b\u043c (\u0440\u0435\u0448\u0430\u0435\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c PodSecurityPolicies \u0438 \u0438\u0445 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u043e\u0439 \u043a \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u044b\u043c \u0443\u0447\u0451\u0442\u043d\u044b\u043c \u0437\u0430\u043f\u0438\u0441\u044f\u043c). \u041d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u043b\u0438\u0431\u043e \u043f\u043e\u043c\u0435\u0449\u0435\u043d\u0438\u0435\u043c \u0432\u0441\u0435\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 \u043e\u0431\u0440\u0430\u0437 Docker, \u043b\u0438\u0431\u043e \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0435\u0439 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 Spark \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u0435\u043a\u0440\u0435\u0442\u043e\u0432, \u043f\u0440\u0438\u043d\u044f\u0442\u043e\u0433\u043e \u0432 \u0412\u0430\u0448\u0435\u0439 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438.   <\/li>\n<li> \u0417\u0430\u043f\u0443\u0441\u043a \u0437\u0430\u0434\u0430\u0447 Spark \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Kubernetes \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435 \u0438 \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u0430\u0445 (\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u0430\u0445, \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043e\u0431\u0440\u0430\u0437\u043e\u0432 Docker \u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u0445 \u0437\u0430\u043f\u0443\u0441\u043a\u0430). \u0418 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u2014 \u043f\u0440\u0438 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0435 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u0432\u0435\u0440\u0441\u0438\u0438 2.3.0 \u0438 2.4.5, \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u043b\u043e\u0441\u044c.   <\/li>\n<\/ol>\n<p>   \u0411\u0443\u0434\u0435\u043c \u0436\u0434\u0430\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0439 \u2014 \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u0432\u044b\u0448\u043b\u0430 \u0441\u0432\u0435\u0436\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f Spark (3.0.0), \u043f\u0440\u0438\u043d\u0451\u0441\u0448\u0430\u044f \u043e\u0449\u0443\u0442\u0438\u043c\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0440\u0430\u0431\u043e\u0442\u0443 Spark \u043d\u0430 Kubernetes, \u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0432\u0448\u0430\u044f \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0442\u0430\u0442\u0443\u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0442 \u0432 \u043f\u043e\u043b\u043d\u043e\u0439 \u043c\u0435\u0440\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043e\u0442 YARN \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438 Spark \u043d\u0430 Kubernetes, \u043d\u0435 \u043e\u043f\u0430\u0441\u0430\u044f\u0441\u044c \u0437\u0430 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u0412\u0430\u0448\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438 \u0431\u0435\u0437 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432.<\/p>\n<p>  Fin.<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/neoflex\/blog\/511734\/\"> https:\/\/habr.com\/ru\/company\/neoflex\/blog\/511734\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/neoflex\/blog\/511734\/\">\u0414\u043e\u0440\u043e\u0433\u0438\u0435 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0438, \u0434\u043e\u0431\u0440\u043e\u0433\u043e \u0434\u043d\u044f. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e Apache Spark \u0438 \u0435\u0433\u043e \u043f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u044b \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/bl\/re\/sk\/blreskwzxt52vlomhwaikqojieg.jpeg\"><\/p>\n<p>  \u0412 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u043c \u043c\u0438\u0440\u0435 Big Data Apache Spark \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u0435 \u0444\u0430\u043a\u0442\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u043c \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0437\u0430\u0434\u0430\u0447 \u043f\u0430\u043a\u0435\u0442\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u041f\u043e\u043c\u0438\u043c\u043e \u044d\u0442\u043e\u0433\u043e, \u043e\u043d \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433\u043e\u0432\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0445 \u0432 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438 micro batch, \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0449\u0438\u0445 \u0438 \u043e\u0442\u0433\u0440\u0443\u0436\u0430\u044e\u0449\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u043c\u0438 \u043f\u043e\u0440\u0446\u0438\u044f\u043c\u0438 (Spark Structured Streaming). \u0418 \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u043e \u043e\u043d \u044f\u0432\u043b\u044f\u043b\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e \u043e\u0431\u0449\u0435\u0433\u043e \u0441\u0442\u0435\u043a\u0430 Hadoop, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 YARN (\u0438\u043b\u0438, \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445, Apache Mesos). \u041a 2020 \u0433\u043e\u0434\u0443 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u043e\u043c \u0432\u0438\u0434\u0435 \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0439 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e\u0434 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u043c \u0432 \u0432\u0438\u0434\u0443 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u043f\u0440\u0438\u043b\u0438\u0447\u043d\u044b\u0445 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u043e\u0432 Hadoop \u2014 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435 HDP \u0438 CDH \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e, CDH \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u043d \u0438 \u0438\u043c\u0435\u0435\u0442 \u0432\u044b\u0441\u043e\u043a\u0443\u044e \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c, \u0430 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u0441\u0442\u0430\u0432\u0449\u0438\u043a\u0438 Hadoop \u043b\u0438\u0431\u043e \u043f\u0440\u0435\u043a\u0440\u0430\u0442\u0438\u043b\u0438 \u0441\u0432\u043e\u0451 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435, \u043b\u0438\u0431\u043e \u0438\u043c\u0435\u044e\u0442 \u0442\u0443\u043c\u0430\u043d\u043d\u043e\u0435 \u0431\u0443\u0434\u0443\u0449\u0435\u0435. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0441\u0451 \u0431\u043e\u043b\u044c\u0448\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0435\u0441 \u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0430 \u0438 \u043a\u0440\u0443\u043f\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0439 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a Apache Spark \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Kubernetes \u2014 \u0441\u0442\u0430\u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u043c \u0432 \u043e\u0440\u043a\u0435\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438 \u0432 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0445 \u0438 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0445 \u043e\u0431\u043b\u0430\u043a\u0430\u0445, \u043e\u043d \u0440\u0435\u0448\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0441 \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u044b\u043c \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0437\u0430\u0434\u0430\u0447 Spark \u043d\u0430 YARN \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u044e\u0449\u0443\u044e\u0441\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443 \u0441 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c \u043a\u043e\u043c\u043c\u0435\u0440\u0447\u0435\u0441\u043a\u0438\u0445 \u0438 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0445 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u043e\u0432 \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0439 \u0432\u0441\u0435\u0445 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432 \u0438 \u043c\u0430\u0441\u0442\u0435\u0439. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435 \u043d\u0430 \u0432\u043e\u043b\u043d\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u0438 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0443\u0436\u0435 \u0443\u0441\u043f\u0435\u043b\u043e \u043e\u0431\u0437\u0430\u0432\u0435\u0441\u0442\u0438\u0441\u044c \u043f\u0430\u0440\u043e\u0439-\u0442\u0440\u043e\u0439\u043a\u043e\u0439 \u0441\u0432\u043e\u0438\u0445 \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0446\u0438\u0439 \u0438 \u043d\u0430\u0440\u0430\u0441\u0442\u0438\u0442\u044c \u044d\u043a\u0441\u043f\u0435\u0440\u0442\u0438\u0437\u0443 \u0432 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438, \u0447\u0442\u043e \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u043f\u0435\u0440\u0435\u0435\u0437\u0434.<\/p>\n<p>  \u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 2.3.0 Apache Spark \u043e\u0431\u0437\u0430\u0432\u0451\u043b\u0441\u044f \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0437\u0430\u0434\u0430\u0447 \u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 Kubernetes \u0438 \u0441\u0435\u0433\u043e\u0434\u043d\u044f, \u043c\u044b \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0437\u0440\u0435\u043b\u043e\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430, \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u0445 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043f\u043e\u0434\u0432\u043e\u0434\u043d\u044b\u0445 \u043a\u0430\u043c\u043d\u044f\u0445, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u0438\u0442 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0438.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-307199","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/307199","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=307199"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/307199\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=307199"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=307199"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=307199"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}