Updates from August, 2018 Toggle Comment Threads | Keyboard Shortcuts

  • Serdar Osman Onur 11:44 am on August 13, 2018 Permalink | Reply
    Tags: , ,   

    Taking Config Files Outside of a POD – OpenShift

    There are configuration files that affect the way your application works and behaves. These files get deployed together with your application. So, when you deploy your application (in this case Red Hat SSO) these config files will also be deployed inside a POD. If you want to edit your configuration you will need to rsh into your pod and make changes to these configuration files. How about your PODs being destroyed and re-created on another node? What happens to the changes in your configuration files? They are gone!

    There are a couple of alternative approaches you can follow here. If you use a configmap or mount a PV, in both cases they become a part of the “DC” and when a pod is destroyed & re-created it will keep using the configmap or refer to the mounted PV. You get to keep any modifications you have made to your config files when a pod gets destroyed and re-created.

    You can use configmaps/secrets

    Using config maps is “like” mounting a volume to your POD.

    my-conf]# oc create configmap my-conf –from-file=. –dry-run -o yaml
    oc set volume dc/my-dc –configmap-name my-conf –mount-path /test –add=true

    You can mount secrets in a similar way:
    oc create secret generic my-secret –from-file=. –dry-run -o yaml
    oc set volume dc/my-dc –secret-name my-secret –mount-path /test

    In this case you will need to use “oc edit” command to make changes to your configmaps but the problem is, in order for these changes to be reflected in your running application, you will need to re-deploy it (this is what the Red Hat support wrote back to me…).

    You can use PersistentVolumes

    In this scenario, you need to create a PersistentVolume, create a PersistentVolumeClaim and bind the POD to the PV using this claim.

    You PV needs to include the config files that you want to use. A way to go about this could be:

    a) Copy all the files in your config directory to the PV
    b) Mount the PV to your config directory (inside your POD)

    Be Careful! You need to do a) before b) otherwise you will lose all the files and folders inside the config directory of your POD. The good thing about PersistentVolume usage is that you don’t need to re-deploy your PODs to your OpenShift cluster.

     
  • Serdar Osman Onur 7:52 am on August 2, 2018 Permalink | Reply
    Tags: , , , ,   

    Red Hat SSO 7.1 Persistent Application Template Deployment on OpenShift Failed

    I was having a problem deploying the persistent (PostgreSQL) red hat sso 7.1 application on OpenShift. For some reason, my postgresql pod was being stuck at ContainerCreating state. I saw the below message when I described sso-postgresql pod:

    FailedMount Unable to mount volumes for pod “sso-postgresql-1-3gjgf_tybsdev(b652abc6-9002-11e8-a82a-0050569897ab)”: timeout expired waiting for volumes to attach/mount for pod “tybsdev”/”sso-postgresql-1-3gjgf”. list of unattached/unmounted volumes=[sso-postgresql-pvol]

    “mount.nfs: Connection refused ”

    I thought the problem was about my PV/PVC configurations. I checked them and they seemed alright. I tried changing the accessMode of the related PV. I changed it from ReadWriteOnce to ReadWriteMany just to try and it didn’t work.

    Then I check the NFS service on the NFS server “systemctl status nfs”
    NFS service was stopped!

    I started the NFS service and I changed accessMode of PV back to ReadWriteOnce, re-started the installation process. It worked!

     
c
Compose new post
j
Next post/Next comment
k
Previous post/Previous comment
r
Reply
e
Edit
o
Show/Hide comments
t
Go to top
l
Go to login
h
Show/Hide help
shift + esc
Cancel