Share persistent volume claims amongst containers in Kubernetes/OpenShift

TL;DR You can share PV and PVC within the same project/namespace for shared volumes (nfs, gluster, etc…), you can also access your shared volume from multiple project/namespaces but it will require project dedicated PV and PVCs, as a PV is bound to single project/namespace and PVC is project/namespace scoped. Below I’ve tried to illustrate the … Read more

How to restart pod in OpenShift?

You need to do your changes in the deployment config but not in the pod. Because OpenShift treats pods as largely immutable; changes cannot be made to a pod definition while it is running. https://docs.openshift.com/enterprise/3.0/architecture/core_concepts/pods_and_services.html#pods If you make some changes in deployment config and save them, pod will restart and and your changes will take … Read more

How to include script and run it into kubernetes yaml?

I’m using this approach in OpenShift, so it should be applicable in Kubernetes as well. Try to put your script into a configmap key/value, mount this configmap as a volume and run the script from the volume. apiVersion: batch/v1 kind: Job metadata: name: hello-world-job spec: parallelism: 1 completions: 1 template: metadata: name: hello-world-job spec: volumes: … Read more

Deploying Ruby on Rails – Is there a good alternative for Heroku? [closed]

Yes there are This is a very good post I found on the subject Heroku Alternatives : For Deploying Rails Applications I went over the options there one by one and, to my humble opinion, OpenShift is the best option for a small-medium website, at least for the beginning of developing and creating a POC\Prototype … Read more

Permission denied (publickey,gssapi-keyex,gssapi-with-mic) on openshift

if you are using Windows, you can try the following steps: look for your ssh public key usually you can find it at c:\\users\\YOUR_USERNAME\\.ssh copy your openshift public key to your git’s ssh-key folder suppose we have git in d:\\git then we need to copy the public key from c:\\users\\YOUR_USERNAME\\.ssh to d:\\git\\.ssh try if it … Read more

How to use naked GoDaddy domain with OpenShift hosting? [closed]

Solution 01) Sign up to cloudflare 02) Set these cname rules: mydomain.com > appname-username.rhcloud.com (this will utilise ‘cname flattening’) www > mydomain.com 03) Set page rules: http://www.mydomain.com/* > http://mydomain.com/$1 04) Set alias in OpenShift to mydomain.com 05) Make sure GoDaddy DNS record doesn’t have any conflicting cname or A record set up. 06) Let it … Read more

What is the different between openshift deploymentconfig and kubernetes deployment

A DeploymentConfig (DC) in OpenShift is more or less equivalent to a Kubernetes Deployment, nowadays. Main difference (besides that one is using ReplicationController and the other using ReplicaSet as you rightly pointed out) is that there are a few things you can do with a DeploymentConfig (around triggers) that you can’t do with a Deployment. … Read more

Separate back-end and front-end apps on same domain?

You are gonna to dig yourself… deep 🙂 Simplest and most clean approach with no any doubt is creating a single application serving data for both, BE and FE, where you differ response (JSON vs HTML) by the URL, pseudo routes: GET /products/:id controllers.Frontend.productHtml(id) GET /backend/products/:id controllers.Backend.productJson(id) Benefits: single deployment (let’s say to Heroku) name … Read more

Can I connect one service account to multiple namespaces in Kubernetes?

You can simply reference a ServiceAccount from another namespace in the RoleBinding: apiVersion: rbac.authorization.k8s.io/v1beta1 kind: Role metadata: name: pod-reader namespace: ns2 rules: – apiGroups: [“”] resources: [“pods”] verbs: [“get”, “list”, “watch”] — apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: pod-reader-from-ns1 namespace: ns2 roleRef: apiGroup: rbac.authorization.k8s.io kind: Role name: pod-reader subjects: – kind: ServiceAccount name: ns1-service-account namespace: … Read more