Skip to content

DaemonSets (Run a container on all nodes) on OpenShift

Chakradhar Rao Jonagam edited this page Aug 19, 2016 · 2 revisions

This is available on Openshift >= 3.2 version of openshift This use case is to run a specific docker container (veermuchandi/welcome) on all nodes (or a set nodes with specific label)

Enable HostPorts expose on Openshift

oc edit scc restricted  #as system:admin user

# change allowHostPorts: true   and save

myDaemonset.yaml

apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
  name: welcome
spec:
  template:
    metadata:
      name: welcome
      labels:
        daemon: welcome
    spec:
      containers:
      - name: c
        image: veermuchandi/welcome
        ports:
        - containerPort: 8080
          hostPort: 8080
          name: serverport
oc create -f myDaemonset.yaml  #with system:admin user
Clone this wiki locally