From 384793baffddf23ba93bf7dfec682f86780a45f1 Mon Sep 17 00:00:00 2001 From: Clayton Coleman Date: Thu, 11 Jun 2015 17:04:18 -0400 Subject: [PATCH] Support a containerized node Add OPENSHIFT_CONTAINERIZED=true to trigger this mode, fixes docker config file. --- images/base/Dockerfile | 2 +- images/origin/Dockerfile | 2 ++ pkg/cmd/server/kubernetes/node_config.go | 5 +++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/images/base/Dockerfile b/images/base/Dockerfile index 4c6300d68ab8..dac609dcc9ed 100644 --- a/images/base/Dockerfile +++ b/images/base/Dockerfile @@ -7,5 +7,5 @@ FROM centos:centos7 # components from EPEL must be installed in a separate yum install step -RUN yum install -y git tar wget socat hostname epel-release && \ +RUN yum install -y git tar wget socat hostname sysvinit-tools util-linux epel-release && \ yum clean all diff --git a/images/origin/Dockerfile b/images/origin/Dockerfile index f975fdb2b029..dd108da5a3d9 100644 --- a/images/origin/Dockerfile +++ b/images/origin/Dockerfile @@ -13,12 +13,14 @@ RUN ln -s /usr/bin/openshift /usr/bin/oc && \ ln -s /usr/bin/openshift /usr/bin/oadm && \ ln -s /usr/bin/openshift /usr/bin/osc && \ ln -s /usr/bin/openshift /usr/bin/osadm && \ + ln -s /usr/bin/openshift /usr/bin/kubectl && \ ln -s /usr/bin/openshift /usr/bin/openshift-deploy && \ ln -s /usr/bin/openshift /usr/bin/openshift-docker-build && \ ln -s /usr/bin/openshift /usr/bin/openshift-sti-build && \ ln -s /usr/bin/openshift /usr/bin/openshift-router ENV HOME /root +ENV OPENSHIFT_CONTAINERIZED true ENV KUBECONFIG /var/lib/openshift/openshift.local.config/master/admin.kubeconfig WORKDIR /var/lib/openshift ENTRYPOINT ["/usr/bin/openshift"] diff --git a/pkg/cmd/server/kubernetes/node_config.go b/pkg/cmd/server/kubernetes/node_config.go index 82d5a77ce05b..4a3370dbf715 100644 --- a/pkg/cmd/server/kubernetes/node_config.go +++ b/pkg/cmd/server/kubernetes/node_config.go @@ -17,6 +17,7 @@ import ( "github.com/golang/glog" configapi "github.com/openshift/origin/pkg/cmd/server/api" + cmdutil "github.com/openshift/origin/pkg/cmd/util" cmdflags "github.com/openshift/origin/pkg/cmd/util/flags" "github.com/openshift/origin/pkg/cmd/util/variable" ) @@ -120,6 +121,10 @@ func BuildKubernetesNodeConfig(options configapi.NodeConfig) (*NodeConfig, error server.TLSCertFile = options.ServingInfo.ServerCert.CertFile server.TLSPrivateKeyFile = options.ServingInfo.ServerCert.KeyFile + if value := cmdutil.Env("OPENSHIFT_CONTAINERIZED", ""); len(value) > 0 { + server.Containerized = value == "true" + } + // resolve extended arguments // TODO: this should be done in config validation (along with the above) so we can provide // proper errors