Docker容器独立运行但在kubernetes

时间:2017-10-02 10:01:19

标签: hadoop docker kubernetes

我有可以使用sudo docker run -itd -p 50070:50070 -p 8088:8088 --name hadoop-master kiwenlau/hadoop:1.0命令运行的docker容器(Hadoop安装https://github.com/kiwenlau/hadoop-cluster-docker)没有任何问题,但是当尝试将相同的映像部署到kubernetes时,pod无法启动。为了创建部署,我使用kubectl run hadoop-master --image=kiwenlau/hadoop:1.0 --port=8088 --port=50070命令

这里描述pod命令的日志

Events:
  FirstSeen     LastSeen        Count   From                                                    SubObjectPath                   Type            Reason          Message
  ---------     --------        -----   ----                                                    -------------                   --------        ------          -------
  6m            6m              1       default-scheduler                                                                       Normal          Scheduled       Successfully assigned hadoop-master-2828539450-rnwsd to gke-mtd-cluster-default-pool-6b97d4d0-hcbt
  6m            6m              1       kubelet, gke-mtd-cluster-default-pool-6b97d4d0-hcbt     spec.containers{hadoop-master}  Normal          Created         Created container with id 1560ff87e0e7357c76cec89f5f429e0b9b5fc51523c79e4e2c12df1834d7dd75
  6m            6m              1       kubelet, gke-mtd-cluster-default-pool-6b97d4d0-hcbt     spec.containers{hadoop-master}  Normal          Started         Started container with id 1560ff87e0e7357c76cec89f5f429e0b9b5fc51523c79e4e2c12df1834d7dd75
  6m            6m              1       kubelet, gke-mtd-cluster-default-pool-6b97d4d0-hcbt     spec.containers{hadoop-master}  Normal          Created         Created container with id c939d3336687a33e69d37aa73177e673fd56d766cb499a4235e89d554d233c37
  6m            6m              1       kubelet, gke-mtd-cluster-default-pool-6b97d4d0-hcbt     spec.containers{hadoop-master}  Normal          Started         Started container with id c939d3336687a33e69d37aa73177e673fd56d766cb499a4235e89d554d233c37
  6m            6m              2       kubelet, gke-mtd-cluster-default-pool-6b97d4d0-hcbt                                     Warning         FailedSync      Error syncing pod, skipping: failed to "StartContainer" for "hadoop-master" with CrashLoopBackOff: "Back-off 10s restarting failed container=hadoop-master pod=hadoop-master-2828539450-rnwsd_default(562dae39-a757-11e7-a5a3-42010a8401c6)"

  6m    6m      1       kubelet, gke-mtd-cluster-default-pool-6b97d4d0-hcbt     spec.containers{hadoop-master}  Normal  Created         Created container with id 7d1c67686c039e459ee0ea3936eedb4996a5201f6a1fec02ac98d219bb07745f
  6m    6m      1       kubelet, gke-mtd-cluster-default-pool-6b97d4d0-hcbt     spec.containers{hadoop-master}  Normal  Started         Started container with id 7d1c67686c039e459ee0ea3936eedb4996a5201f6a1fec02ac98d219bb07745f
  6m    6m      2       kubelet, gke-mtd-cluster-default-pool-6b97d4d0-hcbt                                     Warning FailedSync      Error syncing pod, skipping: failed to "StartContainer" for "hadoop-master" with CrashLoopBackOff: "Back-off 20s restarting failed container=hadoop-master pod=hadoop-master-2828539450-rnwsd_default(562dae39-a757-11e7-a5a3-42010a8401c6)"

  5m    5m      1       kubelet, gke-mtd-cluster-default-pool-6b97d4d0-hcbt     spec.containers{hadoop-master}  Normal  Started         Started container with id a8879a2c794b3e62f788ad56e403cb619644e9219b2c092e760ddeba506b2e44
  5m    5m      1       kubelet, gke-mtd-cluster-default-pool-6b97d4d0-hcbt     spec.containers{hadoop-master}  Normal  Created         Created container with id a8879a2c794b3e62f788ad56e403cb619644e9219b2c092e760ddeba506b2e44
  5m    5m      3       kubelet, gke-mtd-cluster-default-pool-6b97d4d0-hcbt                                     Warning FailedSync      Error syncing pod, skipping: failed to "StartContainer" for "hadoop-master" with CrashLoopBackOff: "Back-off 40s restarting failed container=hadoop-master pod=hadoop-master-2828539450-rnwsd_default(562dae39-a757-11e7-a5a3-42010a8401c6)"

  5m    5m      1       kubelet, gke-mtd-cluster-default-pool-6b97d4d0-hcbt     spec.containers{hadoop-master}  Normal  Created         Created container with id 8907cdf19c51b87cea6e1e611649e874db2c21f47234df54bd9f27515cee0a0e
  5m    5m      1       kubelet, gke-mtd-cluster-default-pool-6b97d4d0-hcbt     spec.containers{hadoop-master}  Normal  Started         Started container with id 8907cdf19c51b87cea6e1e611649e874db2c21f47234df54bd9f27515cee0a0e
  5m    3m      7       kubelet, gke-mtd-cluster-default-pool-6b97d4d0-hcbt                                     Warning FailedSync      Error syncing pod, skipping: failed to "StartContainer" for "hadoop-master" with CrashLoopBackOff: "Back-off 1m20s restarting failed container=hadoop-master pod=hadoop-master-2828539450-rnwsd_default(562dae39-a757-11e7-a5a3-42010a8401c6)"

  3m    3m      1       kubelet, gke-mtd-cluster-default-pool-6b97d4d0-hcbt     spec.containers{hadoop-master}  Normal  Created         Created container with id 294072caea596b47324914a235c1882dbc521cc355644a1e25ebf06f0e04301f
  3m    3m      1       kubelet, gke-mtd-cluster-default-pool-6b97d4d0-hcbt     spec.containers{hadoop-master}  Normal  Started         Started container with id 294072caea596b47324914a235c1882dbc521cc355644a1e25ebf06f0e04301f
  3m    1m      12      kubelet, gke-mtd-cluster-default-pool-6b97d4d0-hcbt                                     Warning FailedSync      Error syncing pod, skipping: failed to "StartContainer" for "hadoop-master" with CrashLoopBackOff: "Back-off 2m40s restarting failed container=hadoop-master pod=hadoop-master-2828539450-rnwsd_default(562dae39-a757-11e7-a5a3-42010a8401c6)"

  6m    50s     7       kubelet, gke-mtd-cluster-default-pool-6b97d4d0-hcbt     spec.containers{hadoop-master}  Normal  Pulled          Container image "kiwenlau/hadoop:1.0" already present on machine
  50s   50s     1       kubelet, gke-mtd-cluster-default-pool-6b97d4d0-hcbt     spec.containers{hadoop-master}  Normal  Created         Created container with id 7da7508ac864d04d47639b0d2c374a27c3e8a3351e13a2564e57453cf857426d
  50s   50s     1       kubelet, gke-mtd-cluster-default-pool-6b97d4d0-hcbt     spec.containers{hadoop-master}  Normal  Started         Started container with id 7da7508ac864d04d47639b0d2c374a27c3e8a3351e13a2564e57453cf857426d
  6m    0s      31      kubelet, gke-mtd-cluster-default-pool-6b97d4d0-hcbt     spec.containers{hadoop-master}  Warning BackOff         Back-off restarting failed container
  49s   0s      5       kubelet, gke-mtd-cluster-default-pool-6b97d4d0-hcbt                                     Warning FailedSync      Error syncing pod, skipping: failed to "StartContainer" for "hadoop-master" with CrashLoopBackOff: "Back-off 5m0s restarting failed container=hadoop-master pod=hadoop-master-2828539450-rnwsd_default(562dae39-a757-11e7-a5a3-42010a8401c6)"

kubectl日志输出:

kubectl logs hadoop-master-2828539450-rnwsd
 * Starting OpenBSD Secure Shell server sshd
   ...done.

请注意,docker容器本身没有启动hadoop。为了启动它,我必须连接到容器并手动启动hadoop,但是我希望能够在K8s中简单地运行容器。

由于

1 个答案:

答案 0 :(得分:1)

kubernetes中的等效命令是

<PubmedArticle>
    <MedlineCitation Status="MEDLINE" Owner="NLM">
        <PMID Version="1">23121439</PMID>
        <DateCreated>
            <Year>2012</Year>
            <Month>11</Month>
            <Day>29</Day>
        </DateCreated>
        <DateCompleted>
            <Year>2012</Year>
            <Month>12</Month>
            <Day>12</Day>
        </DateCompleted>
        <DateRevised>
            <Year>2015</Year>
            <Month>11</Month>
            <Day>19</Day>
        </DateRevised>
        <Article PubModel="Print-Electronic">
            <Journal>
                <ISSN IssnType="Electronic">1533-4406</ISSN>
                <JournalIssue CitedMedium="Internet">
                    <Volume>367</Volume>
                    <Issue>22</Issue>
                    <PubDate>
                        <Year>2012</Year>
                        <Month>Nov</Month>
                        <Day>29</Day>
                    </PubDate>
                </JournalIssue>
                <Title>The New England journal of medicine</Title>
                <ISOAbbreviation>N. Engl. J. Med.</ISOAbbreviation>
            </Journal>
            <ArticleTitle>Bedside monitoring to adjust antiplatelet therapy for coronary stenting.</ArticleTitle>
            <Pagination>
                <MedlinePgn>2100-9</MedlinePgn>
            </Pagination>
            <ELocationID EIdType="doi" ValidYN="Y">10.1056/NEJMoa1209979</ELocationID>
            <Abstract>
                <AbstractText Label="BACKGROUND" NlmCategory="BACKGROUND">Patients' responses to oral antiplatelet therapy are subject to variation. Bedside monitoring offers the opportunity to improve outcomes after coronary stenting by individualizing therapy.</AbstractText>
                <AbstractText Label="METHODS" NlmCategory="METHODS">We randomly assigned 2440 patients scheduled for coronary stenting at 38 centers to a strategy of platelet-function monitoring, with drug adjustment in patients who had a poor response to antiplatelet therapy, or to a conventional strategy without monitoring and drug adjustment. The primary end point was the composite of death, myocardial infarction, stent thrombosis, stroke, or urgent revascularization 1 year after stent implantation. For patients in the monitoring group, the VerifyNow P2Y12 and aspirin point-of-care assays were used in the catheterization laboratory before stent implantation and in the outpatient clinic 2 to 4 weeks later.</AbstractText>
                <AbstractText Label="RESULTS" NlmCategory="RESULTS">In the monitoring group, high platelet reactivity in patients taking clopidogrel (34.5% of patients) or aspirin (7.6%) led to the administration of an additional bolus of clopidogrel, prasugrel, or aspirin along with glycoprotein IIb/IIIa inhibitors during the procedure. The primary end point occurred in 34.6% of the patients in the monitoring group, as compared with 31.1% of those in the conventional-treatment group (hazard ratio, 1.13; 95% confidence interval [CI], 0.98 to 1.29; P=0.10). The main secondary end point, stent thrombosis or any urgent revascularization, occurred in 4.9% of the patients in the monitoring group and 4.6% of those in the conventional-treatment group (hazard ratio, 1.06; 95% CI, 0.74 to 1.52; P=0.77). The rate of major bleeding events did not differ significantly between groups.</AbstractText>
                <AbstractText Label="CONCLUSIONS" NlmCategory="CONCLUSIONS">This study showed no significant improvements in clinical outcomes with platelet-function monitoring and treatment adjustment for coronary stenting, as compared with standard antiplatelet therapy without monitoring. (Funded by Allies in Cardiovascular Trials Initiatives and Organized Networks and others; ARCTIC ClinicalTrials.gov number, NCT00827411.).</AbstractText>
            </Abstract>
            <AuthorList CompleteYN="Y">
                <Author ValidYN="Y">
                    <LastName>Collet</LastName>
                    <ForeName>Jean-Philippe</ForeName>
                    <Initials>JP</Initials>
                    <AffiliationInfo>
                        <Affiliation>Institut de Cardiologie Hôpital Pitié–Salpêtrière and Université Pierre et Marie Curie, Paris, France.</Affiliation>
                    </AffiliationInfo>
                </Author>
                <Author ValidYN="Y">
                    <LastName>Cuisset</LastName>
                    <ForeName>Thomas</ForeName>
                    <Initials>T</Initials>
                </Author>
                <Author ValidYN="Y">
                    <LastName>Rangé</LastName>
                    <ForeName>Grégoire</ForeName>
                    <Initials>G</Initials>
                </Author>
                <Author ValidYN="Y">
                    <LastName>Cayla</LastName>
                    <ForeName>Guillaume</ForeName>
                    <Initials>G</Initials>
                </Author>
                <Author ValidYN="Y">
                    <LastName>Elhadad</LastName>
                    <ForeName>Simon</ForeName>
                    <Initials>S</Initials>
                </Author>
                <Author ValidYN="Y">
                    <LastName>Pouillot</LastName>
                    <ForeName>Christophe</ForeName>
                    <Initials>C</Initials>
                </Author>
                <Author ValidYN="Y">
                    <LastName>Henry</LastName>
                    <ForeName>Patrick</ForeName>
                    <Initials>P</Initials>
                </Author>
                <Author ValidYN="Y">
                    <LastName>Motreff</LastName>
                    <ForeName>Pascal</ForeName>
                    <Initials>P</Initials>
                </Author>
                <Author ValidYN="Y">
                    <LastName>Carrié</LastName>
                    <ForeName>Didier</ForeName>
                    <Initials>D</Initials>
                </Author>
                <Author ValidYN="Y">
                    <LastName>Boueri</LastName>
                    <ForeName>Ziad</ForeName>
                    <Initials>Z</Initials>
                </Author>
                <Author ValidYN="Y">
                    <LastName>Belle</LastName>
                    <ForeName>Loic</ForeName>
                    <Initials>L</Initials>
                </Author>
                <Author ValidYN="Y">
                    <LastName>Van Belle</LastName>
                    <ForeName>Eric</ForeName>
                    <Initials>E</Initials>
                </Author>
                <Author ValidYN="Y">
                    <LastName>Rousseau</LastName>
                    <ForeName>Hélène</ForeName>
                    <Initials>H</Initials>
                </Author>
                <Author ValidYN="Y">
                    <LastName>Aubry</LastName>
                    <ForeName>Pierre</ForeName>
                    <Initials>P</Initials>
                </Author>
                <Author ValidYN="Y">
                    <LastName>Monségu</LastName>
                    <ForeName>Jacques</ForeName>
                    <Initials>J</Initials>
                </Author>
                <Author ValidYN="Y">
                    <LastName>Sabouret</LastName>
                    <ForeName>Pierre</ForeName>
                    <Initials>P</Initials>
                </Author>
                <Author ValidYN="Y">
                    <LastName>O'Connor</LastName>
                    <ForeName>Stephen A</ForeName>
                    <Initials>SA</Initials>
                </Author>
                <Author ValidYN="Y">
                    <LastName>Abtan</LastName>
                    <ForeName>Jérémie</ForeName>
                    <Initials>J</Initials>
                </Author>
                <Author ValidYN="Y">
                    <LastName>Kerneis</LastName>
                    <ForeName>Mathieu</ForeName>
                    <Initials>M</Initials>
                </Author>
                <Author ValidYN="Y">
                    <LastName>Saint-Etienne</LastName>
                    <ForeName>Christophe</ForeName>
                    <Initials>C</Initials>
                </Author>
                <Author ValidYN="Y">
                    <LastName>Barthélémy</LastName>
                    <ForeName>Olivier</ForeName>
                    <Initials>O</Initials>
                </Author>
                <Author ValidYN="Y">
                    <LastName>Beygui</LastName>
                    <ForeName>Farzin</ForeName>
                    <Initials>F</Initials>
                </Author>
                <Author ValidYN="Y">
                    <LastName>Silvain</LastName>
                    <ForeName>Johanne</ForeName>
                    <Initials>J</Initials>
                </Author>
                <Author ValidYN="Y">
                    <LastName>Vicaut</LastName>
                    <ForeName>Eric</ForeName>
                    <Initials>E</Initials>
                </Author>
                <Author ValidYN="Y">
                    <LastName>Montalescot</LastName>
                    <ForeName>Gilles</ForeName>
                    <Initials>G</Initials>
                </Author>
                <Author ValidYN="Y">
                    <CollectiveName>ARCTIC Investigators</CollectiveName>
                </Author>
            </AuthorList>
            <Language>eng</Language>
            <DataBankList CompleteYN="Y">
                <DataBank>
                    <DataBankName>ClinicalTrials.gov</DataBankName>
                    <AccessionNumberList>
                        <AccessionNumber>NCT00827411</AccessionNumber>
                    </AccessionNumberList>
                </DataBank>
            </DataBankList>
            <PublicationTypeList>
                <PublicationType UI="D016428">Journal Article</PublicationType>
                <PublicationType UI="D016448">Multicenter Study</PublicationType>
                <PublicationType UI="D016449">Randomized Controlled Trial</PublicationType>
                <PublicationType UI="D013485">Research Support, Non-U.S. Gov't</PublicationType>
            </PublicationTypeList>
            <ArticleDate DateType="Electronic">
                <Year>2012</Year>
                <Month>11</Month>
                <Day>04</Day>
            </ArticleDate>
        </Article>
        <MedlineJournalInfo>
            <Country>United States</Country>
            <MedlineTA>N Engl J Med</MedlineTA>
            <NlmUniqueID>0255562</NlmUniqueID>
            <ISSNLinking>0028-4793</ISSNLinking>
        </MedlineJournalInfo>
        <ChemicalList>
            <Chemical>
                <RegistryNumber>0</RegistryNumber>
                <NameOfSubstance UI="D010879">Piperazines</NameOfSubstance>
            </Chemical>
            <Chemical>
                <RegistryNumber>0</RegistryNumber>
                <NameOfSubstance UI="D010975">Platelet Aggregation Inhibitors</NameOfSubstance>
            </Chemical>
            <Chemical>
                <RegistryNumber>0</RegistryNumber>
                <NameOfSubstance UI="D011725">Pyridines</NameOfSubstance>
            </Chemical>
            <Chemical>
                <RegistryNumber>0</RegistryNumber>
                <NameOfSubstance UI="D013876">Thiophenes</NameOfSubstance>
            </Chemical>
            <Chemical>
                <RegistryNumber>0</RegistryNumber>
                <NameOfSubstance UI="C446540">thienopyridine</NameOfSubstance>
            </Chemical>
            <Chemical>
                <RegistryNumber>A74586SNO7</RegistryNumber>
                <NameOfSubstance UI="C055162">clopidogrel</NameOfSubstance>
            </Chemical>
            <Chemical>
                <RegistryNumber>G89JQ59I13</RegistryNumber>
                <NameOfSubstance UI="D000068799">Prasugrel Hydrochloride</NameOfSubstance>
            </Chemical>
            <Chemical>
                <RegistryNumber>OM90ZUW7M1</RegistryNumber>
                <NameOfSubstance UI="D013988">Ticlopidine</NameOfSubstance>
            </Chemical>
            <Chemical>
                <RegistryNumber>R16CO5Y76E</RegistryNumber>
                <NameOfSubstance UI="D001241">Aspirin</NameOfSubstance>
            </Chemical>
        </ChemicalList>
        <CitationSubset>AIM</CitationSubset>
        <CitationSubset>IM</CitationSubset>
        <CommentsCorrectionsList>
            <CommentsCorrections RefType="CommentIn">
                <RefSource>N Engl J Med. 2013 Feb 28;368(9):871</RefSource>
                <PMID Version="1">23445102</PMID>
            </CommentsCorrections>
            <CommentsCorrections RefType="CommentIn">
                <RefSource>Nat Rev Cardiol. 2013 Jan;10(1):2</RefSource>
                <PMID Version="1">23165070</PMID>
            </CommentsCorrections>
            <CommentsCorrections RefType="CommentIn">
                <RefSource>N Engl J Med. 2013 Feb 28;368(9):870-1</RefSource>
                <PMID Version="1">23445101</PMID>
            </CommentsCorrections>
            <CommentsCorrections RefType="CommentIn">
                <RefSource>N Engl J Med. 2013 Feb 28;368(9):871-2</RefSource>
                <PMID Version="1">23445100</PMID>
            </CommentsCorrections>
        </CommentsCorrectionsList>
        <MeshHeadingList>
            <MeshHeading>
                <DescriptorName UI="D000368" MajorTopicYN="N">Aged</DescriptorName>
            </MeshHeading>
            <MeshHeading>
                <DescriptorName UI="D001241" MajorTopicYN="N">Aspirin</DescriptorName>
                <QualifierName UI="Q000008" MajorTopicYN="N">administration &amp; dosage</QualifierName>
            </MeshHeading>
            <MeshHeading>
                <DescriptorName UI="D003327" MajorTopicYN="N">Coronary Disease</DescriptorName>
                <QualifierName UI="Q000401" MajorTopicYN="N">mortality</QualifierName>
                <QualifierName UI="Q000628" MajorTopicYN="Y">therapy</QualifierName>
            </MeshHeading>
            <MeshHeading>
                <DescriptorName UI="D003328" MajorTopicYN="N">Coronary Thrombosis</DescriptorName>
            </MeshHeading>
            <MeshHeading>
                <DescriptorName UI="D016903" MajorTopicYN="N">Drug Monitoring</DescriptorName>
                <QualifierName UI="Q000379" MajorTopicYN="Y">methods</QualifierName>
            </MeshHeading>
            <MeshHeading>
                <DescriptorName UI="D005260" MajorTopicYN="N">Female</DescriptorName>
            </MeshHeading>
            <MeshHeading>
                <DescriptorName UI="D006801" MajorTopicYN="N">Humans</DescriptorName>
            </MeshHeading>
            <MeshHeading>
                <DescriptorName UI="D008297" MajorTopicYN="N">Male</DescriptorName>
            </MeshHeading>
            <MeshHeading>
                <DescriptorName UI="D008875" MajorTopicYN="N">Middle Aged</DescriptorName>
            </MeshHeading>
            <MeshHeading>
                <DescriptorName UI="D009203" MajorTopicYN="N">Myocardial Infarction</DescriptorName>
                <QualifierName UI="Q000453" MajorTopicYN="N">epidemiology</QualifierName>
            </MeshHeading>
            <MeshHeading>
                <DescriptorName UI="D010879" MajorTopicYN="N">Piperazines</DescriptorName>
                <QualifierName UI="Q000008" MajorTopicYN="N">administration &amp; dosage</QualifierName>
            </MeshHeading>
            <MeshHeading>
                <DescriptorName UI="D010975" MajorTopicYN="N">Platelet Aggregation Inhibitors</DescriptorName>
                <QualifierName UI="Q000008" MajorTopicYN="Y">administration &amp; dosage</QualifierName>
            </MeshHeading>
            <MeshHeading>
                <DescriptorName UI="D019095" MajorTopicYN="Y">Point-of-Care Systems</DescriptorName>
            </MeshHeading>
            <MeshHeading>
                <DescriptorName UI="D000068799" MajorTopicYN="N">Prasugrel Hydrochloride</DescriptorName>
            </MeshHeading>
            <MeshHeading>
                <DescriptorName UI="D011725" MajorTopicYN="N">Pyridines</DescriptorName>
                <QualifierName UI="Q000008" MajorTopicYN="N">administration &amp; dosage</QualifierName>
            </MeshHeading>
            <MeshHeading>
                <DescriptorName UI="D019233" MajorTopicYN="N">Retreatment</DescriptorName>
            </MeshHeading>
            <MeshHeading>
                <DescriptorName UI="D015607" MajorTopicYN="Y">Stents</DescriptorName>
                <QualifierName UI="Q000009" MajorTopicYN="N">adverse effects</QualifierName>
            </MeshHeading>
            <MeshHeading>
                <DescriptorName UI="D013876" MajorTopicYN="N">Thiophenes</DescriptorName>
                <QualifierName UI="Q000008" MajorTopicYN="N">administration &amp; dosage</QualifierName>
            </MeshHeading>
            <MeshHeading>
                <DescriptorName UI="D013988" MajorTopicYN="N">Ticlopidine</DescriptorName>
                <QualifierName UI="Q000008" MajorTopicYN="N">administration &amp; dosage</QualifierName>
                <QualifierName UI="Q000031" MajorTopicYN="N">analogs &amp; derivatives</QualifierName>
            </MeshHeading>
        </MeshHeadingList>

    </MedlineCitation>
    <PubmedData>
        <History>
            <PubMedPubDate PubStatus="entrez">
                <Year>2012</Year>
                <Month>11</Month>
                <Day>6</Day>
                <Hour>6</Hour>
                <Minute>0</Minute>
            </PubMedPubDate>
            <PubMedPubDate PubStatus="pubmed">
                <Year>2012</Year>
                <Month>11</Month>
                <Day>6</Day>
                <Hour>6</Hour>
                <Minute>0</Minute>
            </PubMedPubDate>
            <PubMedPubDate PubStatus="medline">
                <Year>2012</Year>
                <Month>12</Month>
                <Day>13</Day>
                <Hour>6</Hour>
                <Minute>0</Minute>
            </PubMedPubDate>
        </History>
        <PublicationStatus>ppublish</PublicationStatus>
        <ArticleIdList>
            <ArticleId IdType="pubmed">23121439</ArticleId>
            <ArticleId IdType="doi">10.1056/NEJMoa1209979</ArticleId>
        </ArticleIdList>
    </PubmedData>
</PubmedArticle>

实际上它并不是关于kubernetes,Dockerfile中有错误。

A docker container exits when its main process finishes.

使用kubectl run -it hadoop-master --image=kiwenlau/hadoop:1.0 --port=8088 --port=50070 ,SSH服务在后台启动,之后容器在作业完成时停止。

它应该是一个在前台运行的可执行脚本/程序,如CMD [ "sh", "-c", "service ssh start; bash"]

仅供参考,通常我们不需要ssh到容器,因为~/start-hadoop.sh应该足够了。