MCPcopy Index your code
hub / github.com/google/adk-python / to_gke

Function to_gke

src/google/adk/cli/cli_deploy.py:1220–1476  ·  view source on GitHub ↗

Deploys an agent to Google Kubernetes Engine(GKE). Args: agent_folder: The folder (absolute path) containing the agent source code. project: Google Cloud project id. region: Google Cloud region. cluster_name: The name of the GKE cluster. service_name: The service name in GKE.

(
    *,
    agent_folder: str,
    project: Optional[str],
    region: Optional[str],
    cluster_name: str,
    service_name: str,
    app_name: str,
    temp_folder: str,
    port: int,
    trace_to_cloud: bool,
    otel_to_cloud: bool,
    with_ui: bool,
    log_level: str,
    adk_version: str,
    allow_origins: Optional[list[str]] = None,
    session_service_uri: Optional[str] = None,
    artifact_service_uri: Optional[str] = None,
    memory_service_uri: Optional[str] = None,
    use_local_storage: bool = False,
    a2a: bool = False,
    trigger_sources: Optional[str] = None,
    service_type: Literal[
        'ClusterIP', 'NodePort', 'LoadBalancer'
    ] = 'ClusterIP',
)

Source from the content-addressed store, hash-verified

1218
1219
1220def to_gke(
1221 *,
1222 agent_folder: str,
1223 project: Optional[str],
1224 region: Optional[str],
1225 cluster_name: str,
1226 service_name: str,
1227 app_name: str,
1228 temp_folder: str,
1229 port: int,
1230 trace_to_cloud: bool,
1231 otel_to_cloud: bool,
1232 with_ui: bool,
1233 log_level: str,
1234 adk_version: str,
1235 allow_origins: Optional[list[str]] = None,
1236 session_service_uri: Optional[str] = None,
1237 artifact_service_uri: Optional[str] = None,
1238 memory_service_uri: Optional[str] = None,
1239 use_local_storage: bool = False,
1240 a2a: bool = False,
1241 trigger_sources: Optional[str] = None,
1242 service_type: Literal[
1243 'ClusterIP', 'NodePort', 'LoadBalancer'
1244 ] = 'ClusterIP',
1245):
1246 """Deploys an agent to Google Kubernetes Engine(GKE).
1247
1248 Args:
1249 agent_folder: The folder (absolute path) containing the agent source code.
1250 project: Google Cloud project id.
1251 region: Google Cloud region.
1252 cluster_name: The name of the GKE cluster.
1253 service_name: The service name in GKE.
1254 app_name: The name of the app, by default, it's basename of `agent_folder`.
1255 temp_folder: The local directory to use as a temporary workspace for
1256 preparing deployment artifacts. The tool populates this folder with a copy
1257 of the agent's source code and auto-generates necessary files like a
1258 Dockerfile and deployment.yaml.
1259 port: The port of the ADK api server.
1260 trace_to_cloud: Whether to enable Cloud Trace.
1261 otel_to_cloud: Whether to enable exporting OpenTelemetry signals
1262 to Google Cloud.
1263 with_ui: Whether to deploy with UI.
1264 log_level: The logging level.
1265 adk_version: The ADK version to use in GKE.
1266 allow_origins: Origins to allow for CORS. Can be literal origins or regex
1267 patterns prefixed with 'regex:'.
1268 session_service_uri: The URI of the session service.
1269 artifact_service_uri: The URI of the artifact service.
1270 memory_service_uri: The URI of the memory service.
1271 use_local_storage: Whether to use local .adk storage in the container.
1272 service_type: The Kubernetes Service type (default: ClusterIP).
1273 """
1274 click.secho(
1275 '\n🚀 Starting ADK Agent Deployment to GKE...', fg='cyan', bold=True
1276 )
1277 click.echo('--------------------------------------------------')

Callers

nothing calls this directly

Calls 10

_resolve_projectFunction · 0.85
openFunction · 0.85
formatMethod · 0.80
splitMethod · 0.80
stripMethod · 0.80
existsMethod · 0.45
joinMethod · 0.45
writeMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected