Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ AWS EKS specific annotation for ALB Ingress. or `openshift` to allow running on
- `podSecurityContext` Settings linked to the [security context of the pod](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/)
- `containerSecurityContext` Settings linked to the [security context of the container](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/)
- `service.type` Type of service to create for the editor (allowed `ClusterIP` or `NodePort`, default `ClusterIP`)
- `schedulerName` name of the custom Kubernetes scheduler to use for Project Pods and MQTT agent Pods (default not set, uses default Kubernetes scheduler)

Expects to pick up K8s credentials from the environment

Expand Down
9 changes: 9 additions & 0 deletions kubernetes.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ const createDeployment = async (project, options) => {
localPod.metadata.labels.name = project.safeName
localPod.spec.serviceAccount = process.env.EDITOR_SERVICE_ACCOUNT

if (this._schedulerName) {
localPod.spec.schedulerName = this._schedulerName
}

if (stack.container) {
localPod.spec.containers[0].image = stack.container
} else {
Expand Down Expand Up @@ -648,6 +652,10 @@ const createMQTTTopicAgent = async (broker) => {
localPod.spec.nodeSelector = this._app.config.driver.options.projectSelector
}

if (this._schedulerName) {
localPod.spec.schedulerName = this._schedulerName
}

localPod.metadata.name = `mqtt-schema-agent-${broker.Team.hashid.toLowerCase()}-${agent ? 'team-broker' : broker.hashid.toLowerCase()}`
localPod.metadata.labels = {
name: `mqtt-schema-agent-${broker.Team.hashid.toLowerCase()}-${broker.hashid.toLowerCase()}`,
Expand Down Expand Up @@ -709,6 +717,7 @@ module.exports = {
this._projectIngressAnnotations = this._app.config.driver.options?.projectIngressAnnotations
this._logPassthrough = this._app.config.driver.options?.logPassthrough || false
this._cloudProvider = this._app.config.driver.options?.cloudProvider
this._schedulerName = this._app.config.driver.options?.schedulerName
if (this._app.config.driver.options?.customHostname?.enabled) {
this._app.log.info('[k8s] Enabling Custom Hostname Support')
this._customHostname = this._app.config.driver.options?.customHostname
Expand Down