Skip to content

Commit

Permalink
Merge pull request #19785 from carbonin/dont_create_pods_service
Browse files Browse the repository at this point in the history
Don't create the service for pods
  • Loading branch information
Fryguy authored Jan 30, 2020
2 parents 505d8d6 + 9764856 commit f36c8d8
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions app/models/miq_worker/service_worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ module ServiceWorker
def create_container_objects
orchestrator = ContainerOrchestrator.new

orchestrator.create_service(service_name, service_label, SERVICE_PORT)
orchestrator.create_deployment(worker_deployment_name) do |definition|
configure_worker_deployment(definition)

definition[:spec][:serviceName] = service_name
definition[:spec][:template][:metadata][:labels].merge!(service_label)

container = definition[:spec][:template][:spec][:containers].first
Expand Down Expand Up @@ -42,11 +40,7 @@ def add_readiness_probe(container_definition)
end

def service_label
{:service => service_name}
end

def service_name
worker_deployment_name.delete_prefix(deployment_prefix)
{:service => worker_deployment_name.delete_prefix(deployment_prefix)}
end

# Can be overriden by including classes
Expand Down

0 comments on commit f36c8d8

Please sign in to comment.