On this page

Using OC command tool

Deploy BangDB on OpenShift

METHOD 1 – Deploying BangDB on openshift using OC command line tool

To Deploy BangDB on an openshift using OC command line tool – Let’s create a ‘BangDB’ instance as a Kubernetes deployment object. Here is the yaml file, bangdb.yaml for deployment object. Please don’t forget to change the value of namespace in the yaml file below.

 selector:
    matchLabels:
      deployment: bangdb
  template:
    metadata:
      creationTimestamp: null
      labels:
        deployment: bangdb
    spec:
      containers:
        - name: bangdb
          image: >-
            bangdb/bangdb-server
          ports:
            - name: tcp
              protocol: TCP
              containerPort: 10101
              targetPort: 10101
            - name: http
              protocol: TCP
              containerPort: 18080
              targetPort: 18080
          imagePullPolicy: Always
          securityContext:
              fsGroupChangePolicy: OnRootMismatch
              runAsNonRoot: true
              supplementalGroups: [bangdb,1000]
              allowPrivilegeEscalation: false
              seccompProfile:
                  type: RuntimeDefault
              capabilities:
                  drop: ["ALL"]
      volumeMounts:
         - name: data
           mountPath: /bin/data
         - name: logdir
           mountPath: /bin/logdir
      volumes:
         - name: data
         - name: logdir 

Now you can run the following command from the Bastion node.

oc apply -f bangdb.yaml

This deployment creates a single pod running ‘BangDB’. To verify the deployment you can check the logs of the pod created. The logs should appear as shown below saying ‘BangDB’ service is up and running.

Using OC Command line tool - BangDB
Was this article helpful to you? Yes No