Skip to content

Commit

Permalink
Possibility to use kubernetes ingress
Browse files Browse the repository at this point in the history
  • Loading branch information
henrod committed Jun 14, 2017
1 parent 752ad0a commit 401814a
Show file tree
Hide file tree
Showing 10 changed files with 60 additions and 4 deletions.
3 changes: 3 additions & 0 deletions controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,9 @@ func deleteSchedulerHelper(logger logrus.FieldLogger, mr *models.MixedMetricsRep
if scheduler.ID != "" {
scheduler.State = models.StateTerminating
scheduler.StateLastChangedAt = time.Now().Unix()
if scheduler.LastScaleOpAt == 0 {
scheduler.LastScaleOpAt = 1
}
err = mr.WithSegment(models.SegmentUpdate, func() error {
return scheduler.Update(db)
})
Expand Down
2 changes: 1 addition & 1 deletion helm/charts/maestro-main/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: maestro-main
home: https://github.com/topfreegames/maestro
description: Maestro api and worker
version: 2.6.2
version: 2.7.0
maintainers:
- name: TFGCo
email: backend@tfgco.com
4 changes: 4 additions & 0 deletions helm/charts/maestro-main/templates/maestro-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ spec:
ports:
- protocol: TCP
port: 80
{{- if eq .Values.global.use_ingress "true" }}
type: ClusterIP
{{- else}}
type: LoadBalancer
{{- end}}
---
apiVersion: extensions/v1beta1
kind: Deployment
Expand Down
26 changes: 26 additions & 0 deletions helm/charts/maestro-main/templates/maestro-ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{{- if eq .Values.global.use_ingress "true" }}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ingress
namespace: maestro
annotations:
dns.alpha.kubernetes.io/external: {{ .Values.maestro_url }}
spec:
{{- if ne .Values.tls_crt "" }}
{{- if ne .Values.tls_key "" }}
tls:
- hosts:
- {{ .Values.maestro_url }}
secretName: maestro-ssl
{{- end}}
{{- end}}
rules:
- host: {{ .Values.maestro_url }}
http:
paths:
- backend:
serviceName: maestro-api
servicePort: 80
path: /
{{- end}}
15 changes: 15 additions & 0 deletions helm/charts/maestro-main/templates/maestro-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{- if eq .Values.global.use_ingress "true" }}
{{- if ne .Values.tls_crt "" }}
{{- if ne .Values.tls_key "" }}
apiVersion: v1
data:
tls.crt: {{ .Values.tls_crt }}
tls.key: {{ .Values.tls_key }}
kind: Secret
metadata:
name: maestro-ssl
namespace: maestro
type: Opaque
{{- end}}
{{- end}}
{{- end}}
3 changes: 3 additions & 0 deletions helm/charts/maestro-main/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ redis_url: redis://:@maestro-redis:6379
google_clientid: ""
google_clientsecret: ""
oauth_domains: "example.com other.com"
tls_crt: ""
tls_key: ""
maestro_url: "maestro.example.com"
2 changes: 1 addition & 1 deletion helm/charts/maestro/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: maestro
home: https://github.com/topfreegames/maestro
description: Maestro
version: 0.1.14
version: 0.1.16
maintainers:
- name: TFGCo
email: backend@tfgco.com
2 changes: 1 addition & 1 deletion helm/charts/maestro/requirements.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ dependencies:
version: 0.1.0
repository: http://helm.tfgco.com
- name: maestro-main
version: 2.6.2
version: 2.7.0
repository: http://helm.tfgco.com
5 changes: 5 additions & 0 deletions helm/charts/maestro/values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
global:
database_location: "on-cluster"
redis_location: "on-cluster"
use_ingress: "false"
maestro-main:
postgres_host: maestro-postgres
postgres_port: "5432"
Expand All @@ -9,3 +11,6 @@ maestro-main:
google_clientid: ""
google_clientsecret: ""
oauth_domains: "example.com other.com"
tls_crt: ""
tls_key: ""
maestro_url: "maestro.example.com"
2 changes: 1 addition & 1 deletion metadata/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
package metadata

//Version of Maestro
var Version = "2.6.0"
var Version = "2.7.0"

//KubeVersion is the desired Kubernetes version
var KubeVersion = "v1.6.4"

0 comments on commit 401814a

Please sign in to comment.