Skip to content

Commit

Permalink
Adapter Image deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
Praveengostu committed Sep 16, 2022
1 parent b2d540f commit 7b815b4
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 1 deletion.
2 changes: 2 additions & 0 deletions templates/service/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ locals {
schematics_runtime_job_image = "icr.io/schematics-remote/schematics-agent-ws-job-20220704:60824f4e-276"
#Schematics agent ansible image ID
schematics_runtime_ansible_job_image = "us.icr.io/schematics/schematics-ansible-job:b164f614-171"
#Schematics agent adapter image ID
schematics_runtime_adapter_job_image = "us.icr.io/schematics/schematics-data-adapter:48537ed2-62"
#schematics_sandbox_image
schematics_sandbox_image = "icr.io/schematics-remote/schematics-sandbox:9bdc3645-283"
#Schematics environment (dev|stage|prod)
Expand Down
71 changes: 70 additions & 1 deletion templates/service/runtime-ansible-job.tf
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,27 @@ resource "kubernetes_config_map" "runtime_ansible_job_configmap" {

}

resource "kubernetes_config_map" "runtime_adapter_job_configmap" {
metadata {
name = "schematics-runtime-ansible-job-config"
namespace = "schematics-runtime"
}

data = {
ADAPTER_HTTPPORT = "4001"
ADAPTER_MAXRETRIES = ""
ADAPTER_LOCATION = "us-south"
ADAPTER_LOGGERLEVEL = "-1"
ADAPTER_ATLOGGERLEVEL = "-1"
ADAPTER_EXTLOGGERLEVEL = "-1"
ADAPTER_EXTLOGPATH = "/var/log/schematics/%s.log"
ADAPTER_PLUGINHOME = "/go/src/github.ibm.com/blueprint/schematics-data-adapter/plugins"
}

depends_on = [kubernetes_namespace.namespace]

}

resource "kubernetes_service" "ansible_job_service" {
metadata {
name = "ansible-job-service"
Expand Down Expand Up @@ -234,15 +255,63 @@ resource "kubernetes_deployment" "runtime_ansible_job" {
}
}

container {
name = "adapter"
image = "us.icr.io/$${CR_NAMESPACE}/schematics-data-adapter:$${ADAPTER_IMAGE_TAG}"

env_from {
config_map_ref {
name = "schematics-runtime-adapter-job-config"
}
}

port {
name = "http-adapter"
container_port = 4001
}
resources {
limits = {
cpu = "500m"
memory = "1Gi"
}

requests = {
cpu = "500m"
memory = "1Gi"
}
}

volume_mount {
name = "at-events"
mount_path = "/var/log/at"
}

volume_mount {
name = "ext-logs"
mount_path = "/var/log/schematics"
}
}

restart_policy = "Always"
termination_grace_period_seconds = 180000
}
}

strategy {
type = "RollingUpdate"

rolling_update {
max_unavailable = "1"
max_surge = "1"
}
}

revision_history_limit = 5
}

depends_on = [kubernetes_service.job_service, kubernetes_config_map.runtime_ansible_job_configmap, kubernetes_namespace.namespace]
depends_on = [kubernetes_service.job_service, kubernetes_config_map.runtime_ansible_job_configmap,kubernetes_config_map.runtime_adapter_job_configmap, kubernetes_namespace.namespace]
}



##############################################################################

0 comments on commit 7b815b4

Please sign in to comment.