Skip to content

Commit

Permalink
Add suppor for node affinity, taints and tolerations (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
alfespa17 committed Jul 4, 2022
1 parent bcb8599 commit 5fb827f
Show file tree
Hide file tree
Showing 6 changed files with 105 additions and 0 deletions.
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,43 @@ ingress:
kubernetes.io/ingress.class: alb
```
### 4.1 Node Affinity, Taints and Tolerations.
The API, Registry, Executor and UI support using affinity, taints and tolerations. Use the following examples as reference:
#### Example API.
```yaml
api:
enabled: true
version: "2.5.0"
replicaCount: "1"
serviceType: "ClusterIP"
resources:
limits:
cpu: 500m
memory: 1024Mi
requests:
cpu: 200m
memory: 256Mi
tolerations:
- key: "key1"
operator: "Equal"
value: "value1"
effect: "NoSchedule"
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: name
operator: In
values:
- terrakube
properties:
databaseType: "H2"
```
### 5. Deploy Terrakube using helm chart
Now you have all the information to deploy Terrakube, you can use the following example:
Expand Down
8 changes: 8 additions & 0 deletions templates/deployment-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,12 @@ spec:
port: 8080
initialDelaySeconds: 120
periodSeconds: 10
{{- with .Values.api.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.api.tolerations }}
tolerations:
{{- toYaml . | nindent 6 }}
{{- end }}
{{ end }}
8 changes: 8 additions & 0 deletions templates/deployment-executor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,12 @@ spec:
port: 8090
initialDelaySeconds: 120
periodSeconds: 10
{{- with .Values.executor.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.executor.tolerations }}
tolerations:
{{- toYaml . | nindent 6 }}
{{- end }}
{{ end }}
8 changes: 8 additions & 0 deletions templates/deployment-registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,12 @@ spec:
port: 8075
initialDelaySeconds: 120
periodSeconds: 10
{{- with .Values.registry.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.registry.tolerations }}
tolerations:
{{- toYaml . | nindent 6 }}
{{- end }}
{{ end }}
8 changes: 8 additions & 0 deletions templates/deployment-ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,12 @@ spec:
envFrom:
- secretRef:
name: terrakube-ui-secrets
{{- with .Values.ui.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.ui.tolerations }}
tolerations:
{{- toYaml . | nindent 6 }}
{{- end }}
{{ end }}
36 changes: 36 additions & 0 deletions values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,15 @@
"resources": {
"type": "object"
},
"affinity": {
"type": "object"
},
"tolerations": {
"type": "array",
"items": {
"type": "object"
}
},
"properties": {
"type": "object",
"required": ["databaseType", "databaseHostname", "databaseName", "databaseUser", "databasePassword"],
Expand Down Expand Up @@ -174,6 +183,15 @@
"resources": {
"type": "object"
},
"affinity": {
"type": "object"
},
"tolerations": {
"type": "array",
"items": {
"type": "object"
}
},
"properties": {
"type": "object",
"required": ["toolsRepository", "toolsBranch"],
Expand Down Expand Up @@ -220,6 +238,15 @@
},
"resources": {
"type": "object"
},
"affinity": {
"type": "object"
},
"tolerations": {
"type": "array",
"items": {
"type": "object"
}
}
}
},
Expand All @@ -245,6 +272,15 @@
},
"resources": {
"type": "object"
},
"affinity": {
"type": "object"
},
"tolerations": {
"type": "array",
"items": {
"type": "object"
}
}
}
},
Expand Down

0 comments on commit 5fb827f

Please sign in to comment.