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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# If DEIS_REGISTRY is not set, try to populate it from legacy DEV_REGISTRY
DEIS_REGISTRY ?= $(DEV_REGISTRY)
IMAGE_PREFIX ?= deis
IMAGE_PREFIX ?= hephy
COMPONENT ?= controller
SHORT_NAME ?= $(COMPONENT)

Expand Down
1 change: 1 addition & 0 deletions rootfs/api/management/commands/healthchecks.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

class Command(BaseCommand):
"""Management command for healthchecks"""

def handle(self, *args, **options):
"""Ensure DB and other things are alive"""
print("Checking if database is alive")
Expand Down
13 changes: 12 additions & 1 deletion rootfs/api/management/commands/load_db_state_to_k8s.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
from django.core.management.base import BaseCommand
from django.shortcuts import get_object_or_404

from api.models import Key, App, Domain, Certificate, Service
from api.models import Key, App, AppSettings, Domain, Certificate, Service
from api.exceptions import DeisException, AlreadyExists


class Command(BaseCommand):
"""Management command for publishing Deis platform state from the database
to k8s.
"""

def handle(self, *args, **options):
"""Publishes Deis platform state from the database to kubernetes."""
print("Publishing DB state to kubernetes...")
Expand Down Expand Up @@ -40,6 +41,16 @@ def handle(self, *args, **options):
print('ERROR: There was a problem deploying {} '
'due to {}'.format(application, str(error)))

# deploy autoscaling HPAs for application
appsettings = AppSettings.objects.filter(app=application).order_by('-created')[0]
if appsettings.autoscale:
try:
for proc_type in application.structure:
application.autoscale(proc_type, appsettings.autoscale[proc_type])
except Exception as error:
print('ERROR: There was a problem deploying HPAs for this {} proc_type '
'of {} app due to error: {}'.format(proc_type, application, error))

print("Done Publishing DB state to kubernetes.")

def save_apps(self):
Expand Down