Skip to content

Commit

Permalink
Merge pull request #140 from FlowFuse/openshift
Browse files Browse the repository at this point in the history
Make NR pods run on OpenShift
  • Loading branch information
knolleary authored Mar 8, 2024
2 parents f4a8af8 + 74813e4 commit c1164e2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ driver:
- `projectNamespace` the namespace Project pods should run in
- `projectSelector` a list of labels that should be used to select which nodes Project Pods
should run on
- `cloudProvider` can be left unset for none `aws` deployments. This triggers the adding of
AWS EKS specific annotation for ALB Ingress.
- `cloudProvider` normally not set, but can be `aws` This triggers the adding of
AWS EKS specific annotation for ALB Ingress. or `openshift` to allow running on OpenShift (Enterprise license only)
- `privateCA` name of ConfigMap holding PEM CA Cert Bundle (file name `certs.pem`) Optional
- `certManagerIssuer` name of the ClusterIssuer to use to create HTTPS certs for instances (default not set)
- `k8sRetries` how many times to retry actions against the K8s API
Expand Down
5 changes: 5 additions & 0 deletions kubernetes.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,10 @@ const createDeployment = async (project, options) => {
localPod.spec.containers[0].env.push({ name: 'NODE_EXTRA_CA_CERTS', value: '/usr/local/ssl-certs/chain.pem' })
}

if (this._app.license.active() && this._cloudProvider === 'openshift') {
localPod.spec.securityContext = {}
}

if (stack.memory && stack.cpu) {
localPod.spec.containers[0].resources.requests.memory = `${stack.memory}Mi`
localPod.spec.containers[0].resources.limits.memory = `${stack.memory}Mi`
Expand Down Expand Up @@ -611,6 +615,7 @@ module.exports = {
this._k8sRetries = this._app.config.driver.options?.k8sRetries || 10
this._certManagerIssuer = this._app.config.driver.options?.certManagerIssuer
this._logPassthrough = this._app.config.driver.options?.logPassthrough || false
this._cloudProvider = this._app.config.driver.options?.cloudProvider

const kc = new k8s.KubeConfig()

Expand Down

0 comments on commit c1164e2

Please sign in to comment.