Skip to content

Commit

Permalink
Support a containerized node
Browse files Browse the repository at this point in the history
Add OPENSHIFT_CONTAINERIZED=true to trigger this mode, fixes docker
config file.
  • Loading branch information
smarterclayton committed Jun 12, 2015
1 parent e0a1540 commit 384793b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion images/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions images/origin/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
5 changes: 5 additions & 0 deletions pkg/cmd/server/kubernetes/node_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 384793b

Please sign in to comment.