Merge pull request #417 from pikasTech/fix/agentrun-d601-runner-proxy
配置 D601 AgentRun runner 代理
This commit is contained in:
@@ -303,6 +303,12 @@ controlPlane:
|
|||||||
apiKeySecretRef:
|
apiKeySecretRef:
|
||||||
name: agentrun-v02-api-key
|
name: agentrun-v02-api-key
|
||||||
key: HWLAB_API_KEY
|
key: HWLAB_API_KEY
|
||||||
|
egressProxyUrl: http://sub2api-egress-proxy.platform-infra.svc.cluster.local:10808
|
||||||
|
noProxyExtra:
|
||||||
|
- sub2api-egress-proxy
|
||||||
|
- sub2api-egress-proxy.platform-infra
|
||||||
|
- sub2api-egress-proxy.platform-infra.svc
|
||||||
|
- sub2api-egress-proxy.platform-infra.svc.cluster.local
|
||||||
localPostgres:
|
localPostgres:
|
||||||
enabled: false
|
enabled: false
|
||||||
gitMirror:
|
gitMirror:
|
||||||
|
|||||||
@@ -103,6 +103,8 @@ export interface AgentRunLaneSpec {
|
|||||||
readonly serviceAccount: string;
|
readonly serviceAccount: string;
|
||||||
readonly jobNamePrefix: string;
|
readonly jobNamePrefix: string;
|
||||||
readonly apiKeySecretRef: { readonly name: string; readonly key: string };
|
readonly apiKeySecretRef: { readonly name: string; readonly key: string };
|
||||||
|
readonly egressProxyUrl: string | null;
|
||||||
|
readonly noProxyExtra: readonly string[];
|
||||||
};
|
};
|
||||||
readonly localPostgres: {
|
readonly localPostgres: {
|
||||||
readonly enabled: boolean;
|
readonly enabled: boolean;
|
||||||
@@ -283,6 +285,8 @@ export function agentRunLaneSummary(spec: AgentRunLaneSpec): Record<string, unkn
|
|||||||
serviceAccount: spec.deployment.runner.serviceAccount,
|
serviceAccount: spec.deployment.runner.serviceAccount,
|
||||||
jobNamePrefix: spec.deployment.runner.jobNamePrefix,
|
jobNamePrefix: spec.deployment.runner.jobNamePrefix,
|
||||||
apiKeySecretRef: spec.deployment.runner.apiKeySecretRef,
|
apiKeySecretRef: spec.deployment.runner.apiKeySecretRef,
|
||||||
|
egressProxyUrl: spec.deployment.runner.egressProxyUrl,
|
||||||
|
noProxyExtra: spec.deployment.runner.noProxyExtra,
|
||||||
},
|
},
|
||||||
localPostgres: spec.deployment.localPostgres,
|
localPostgres: spec.deployment.localPostgres,
|
||||||
},
|
},
|
||||||
@@ -516,6 +520,8 @@ function parseDeployment(input: Record<string, unknown>, path: string): AgentRun
|
|||||||
serviceAccount: stringField(runner, "serviceAccount", `${path}.runner`),
|
serviceAccount: stringField(runner, "serviceAccount", `${path}.runner`),
|
||||||
jobNamePrefix: stringField(runner, "jobNamePrefix", `${path}.runner`),
|
jobNamePrefix: stringField(runner, "jobNamePrefix", `${path}.runner`),
|
||||||
apiKeySecretRef: parseSecretRef(recordField(runner, "apiKeySecretRef", `${path}.runner`), `${path}.runner.apiKeySecretRef`),
|
apiKeySecretRef: parseSecretRef(recordField(runner, "apiKeySecretRef", `${path}.runner`), `${path}.runner.apiKeySecretRef`),
|
||||||
|
egressProxyUrl: optionalStringField(runner, "egressProxyUrl", `${path}.runner`) ?? null,
|
||||||
|
noProxyExtra: optionalStringArrayField(runner, "noProxyExtra", `${path}.runner`),
|
||||||
},
|
},
|
||||||
localPostgres: parseLocalPostgres(localPostgres, `${path}.localPostgres`),
|
localPostgres: parseLocalPostgres(localPostgres, `${path}.localPostgres`),
|
||||||
};
|
};
|
||||||
@@ -659,6 +665,12 @@ function optionalEnvPair(obj: Record<string, unknown>, key: string, path: string
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function optionalStringArrayField(obj: Record<string, unknown>, key: string, path: string): readonly string[] {
|
||||||
|
const value = obj[key];
|
||||||
|
if (value === undefined || value === null) return [];
|
||||||
|
return stringArrayField(obj, key, path);
|
||||||
|
}
|
||||||
|
|
||||||
function stringRecordField(obj: Record<string, unknown>, path: string): Readonly<Record<string, string>> {
|
function stringRecordField(obj: Record<string, unknown>, path: string): Readonly<Record<string, string>> {
|
||||||
const result: Record<string, string> = {};
|
const result: Record<string, string> = {};
|
||||||
for (const [key, value] of Object.entries(obj)) {
|
for (const [key, value] of Object.entries(obj)) {
|
||||||
|
|||||||
@@ -437,6 +437,8 @@ function managerEnv(spec: AgentRunLaneSpec, sourceCommit: string, imageRef: stri
|
|||||||
{ name: "AGENTRUN_INTERNAL_MGR_URL", value: spec.runtime.internalBaseUrl },
|
{ name: "AGENTRUN_INTERNAL_MGR_URL", value: spec.runtime.internalBaseUrl },
|
||||||
{ name: "AGENTRUN_RUNNER_IMAGE", value: imageRef },
|
{ name: "AGENTRUN_RUNNER_IMAGE", value: imageRef },
|
||||||
{ name: "AGENTRUN_RUNNER_SERVICE_ACCOUNT", value: spec.deployment.runner.serviceAccount },
|
{ name: "AGENTRUN_RUNNER_SERVICE_ACCOUNT", value: spec.deployment.runner.serviceAccount },
|
||||||
|
...(spec.deployment.runner.egressProxyUrl === null ? [] : [{ name: "AGENTRUN_RUNNER_EGRESS_PROXY_URL", value: spec.deployment.runner.egressProxyUrl }]),
|
||||||
|
...(spec.deployment.runner.noProxyExtra.length === 0 ? [] : [{ name: "AGENTRUN_RUNNER_NO_PROXY_EXTRA", value: spec.deployment.runner.noProxyExtra.join(",") }]),
|
||||||
{ name: "AGENTRUN_API_KEY", valueFrom: { secretKeyRef: spec.deployment.manager.apiKeySecretRef } },
|
{ name: "AGENTRUN_API_KEY", valueFrom: { secretKeyRef: spec.deployment.manager.apiKeySecretRef } },
|
||||||
...(spec.deployment.manager.unideskSshEndpointEnv === null ? [] : [{ name: spec.deployment.manager.unideskSshEndpointEnv.name, value: spec.deployment.manager.unideskSshEndpointEnv.value }]),
|
...(spec.deployment.manager.unideskSshEndpointEnv === null ? [] : [{ name: spec.deployment.manager.unideskSshEndpointEnv.name, value: spec.deployment.manager.unideskSshEndpointEnv.value }]),
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user