agentleFS
dungnotnulldungnotnull/hybrid-harness-chaos-process-prm/skills/s05-service-onboarding/SKILL.md

harness-service-onboarding

Skill19 starsChanged 6 months agoMITView on GitHub

Onboard a new service, microservice, or application onto the Harness platform end-to-end. Use this skill whenever the user says "add a new service to Harness", "onboard my app", "register a new microservice", "set up Harness for X service", or needs to create service definitions, infrastructure definitions, environment configurations, monitored services, connector registrations, or delegate scoping for a new workload. Also trigger when a developer joins a team and needs to wire up their service for the first time.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Ensure the delegate has access to the target namespace:

    line 243
  2. Very specific:

    Before first real deployment, run pipeline with skipDryRun: false:

    line 315
  3. Distinctive:

    When Harness AI is unavailable: Use static pipeline templates from s09 Template Library and manual YAML construction following Harness …

    line 379

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Harness Service Onboarding

Purpose

Guide the complete end-to-end onboarding of a new service onto Harness: from creating the service entity to wiring up environments, infrastructure definitions, connectors, monitored services, and the first pipeline run.


Input Contract

InputSourceRequired
Pipeline YAML / service names04 (workflow_context.artifacts)Yes
Repository URL, container registrys01 or userYes
Kubernetes cluster infos06 output or userYes
Harness org/project identifiersCLAUDE.mdYes
Delegate selectors06 outputNo
Observability tool choices02 taste or s01No

Output Contract

OutputDestinationFormat
Service definition YAML.commandcode/artifacts/service-<name>.yamlYAML
Environment YAML per tier.commandcode/artifacts/env-<tier>.yamlYAML
Infrastructure definition YAML.commandcode/artifacts/infra-<name>-<tier>.yamlYAML
Connector configs.commandcode/artifacts/connectors.yamlYAML
Onboarding hand-off documentUser + s06 feedMarkdown
Service context (for s06, s07, s08, s10, s15)workflow_context.artifactsYAML object

Prerequisites

Gather before proceeding:

  • Service name, language/runtime, and repository URL
  • Container registry location (ECR, GCR, DockerHub, ACR)
  • Kubernetes cluster and namespace (or other target infra)
  • Harness Organization and Project identifiers
  • Cloud provider credentials (for connector setup)
  • Observability tool (Prometheus, Datadog, etc.) if CV is needed

Onboarding Checklist (run in order)

[ ] 1. Create Connector(s)
[ ] 2. Create Service Definition
[ ] 3. Create Environment(s)
[ ] 4. Create Infrastructure Definition(s)
[ ] 5. Scope Delegate to Namespace
[ ] 6. Create Monitored Service (if CV enabled)
[ ] 7. Create Pipeline (reference harness/01-pipeline-design)
[ ] 8. Create Input Set for each environment
[ ] 9. First dry-run validation
[ ] 10. Hand-off documentation

Step 1 — Connectors

Kubernetes Cluster Connector

connector:
  name: <CLUSTER_NAME> K8s
  identifier: <cluster_name>_k8s
  orgIdentifier: <ORG_ID>
  projectIdentifier: <PROJECT_ID>
  type: K8sCluster
  spec:
    credential:
      type: InheritFromDelegate
    delegateSelectors:
      - <DELEGATE_SELECTOR>

Docker Registry Connector

connector:
  name: <REGISTRY_NAME>
  identifier: <registry_identifier>
  type: DockerRegistry
  spec:
    dockerRegistryUrl: https://index.docker.io/v2/
    providerType: DockerHub
    auth:
      type: UsernamePassword
      spec:
        username: <+secrets.getValue("docker_username")>
        passwordRef: docker_password_secret

GitHub Source Connector

connector:
  name: GitHub <REPO_NAME>
  identifier: github_<repo_identifier>
  type: Github
  spec:
    url: https://github.com/<ORG>
    connectionType: Account
    authentication:
      type: Http
      spec:
        type: UsernameToken
        spec:
          username: <+secrets.getValue("github_username")>
          tokenRef: github_pat_secret
    apiAccess:
      type: Token
      spec:
        tokenRef: github_pat_secret
    delegateSelectors:
      - <DELEGATE_SELECTOR>

Step 2 — Service Definition

service:
  name: <SERVICE_NAME>
  identifier: <service_identifier>
  orgIdentifier: <ORG_ID>
  projectIdentifier: <PROJECT_ID>
  description: "<Service description>"
  tags:
    team: <TEAM_NAME>
    domain: <DOMAIN>
    managed-by: hcprm
  serviceDefinition:
    type: Kubernetes
    spec:
      manifests:
        - manifest:
            identifier: k8s_manifests
            type: K8sManifest
            spec:
              store:
                type: Github
                spec:
                  connectorRef: github_<repo_identifier>
                  gitFetchType: Branch
                  branch: main
                  paths:
                    - k8s/
              valuesPaths:
                - k8s/values.yaml
              skipResourceVersioning: false
              enableDeclarativeRollback: true
      artifacts:
        primary:
          primaryArtifactRef: primary
          sources:
            - identifier: primary
              sourceType: DockerRegistry
              spec:
                connectorRef: <registry_identifier>
                imagePath: <IMAGE_PATH>
                tag: <+input>
      variables:
        - name: replicaCount
          type: String
          value: "2"
        - name: memoryLimit
          type: String
          value: "512Mi"
        - name: cpuLimit
          type: String
          value: "500m"

Step 3 — Environments

# Create one environment entity per tier
environment:
  name: <ENV_TIER>  # e.g., staging
  identifier: <env_tier>
  orgIdentifier: <ORG_ID>
  projectIdentifier: <PROJECT_ID>
  type: PreProduction  # or Production
  tags:
    managed-by: hcprm
  variables:
    - name: replicaCount
      type: String
      value: "1"   # override per-env
  overrides:
    manifests:
      - manifest:
          identifier: env_values
          type: Values
          spec:
            store:
              type: Github
              spec:
                connectorRef: github_<repo_identifier>
                gitFetchType: Branch
                branch: main
                paths:
                  - k8s/values-<ENV_TIER>.yaml

Step 4 — Infrastructure Definition

infrastructureDefinition:
  name: <SERVICE_NAME>-<ENV_TIER>-infra
  identifier: <service_identifier>_<env_tier>_infra
  orgIdentifier: <ORG_ID>
  projectIdentifier: <PROJECT_ID>
  environmentRef: <env_tier>
  deploymentType: Kubernetes
  type: KubernetesDirect
  spec:
    connectorRef: <cluster_name>_k8s
    namespace: <K8S_NAMESPACE>
    releaseName: release-<+INFRA_KEY>
  allowSimultaneousDeployments: false

Step 5 — Delegate Scoping

Ensure the delegate has access to the target namespace:

# If using Harness Delegate Helm chart, apply RBAC:
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: harness-delegate-role
  namespace: <K8S_NAMESPACE>
  labels:
    managed-by: hcprm
rules:
  - apiGroups: ["", "apps", "extensions", "batch"]
    resources: ["pods", "deployments", "services", "configmaps",
                "secrets", "replicasets", "jobs", "statefulsets"]
    verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
  - apiGroups: ["networking.k8s.io"]
    resources: ["ingresses"]
    verbs: ["get", "list", "watch", "create", "update", "patch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: harness-delegate-binding
  namespace: <K8S_NAMESPACE>
subjects:
  - kind: ServiceAccount
    name: harness-delegate
    namespace: harness-delegate
roleRef:
  kind: Role
  name: harness-delegate-role
  apiGroup: rbac.authorization.k8s.io

Reference harness/03-delegate-management for full delegate setup.


Step 6 — Input Sets

Input sets capture environment-specific values, avoiding pipeline duplication.

inputSet:
  name: <ENV_TIER> Input Set
  identifier: <env_tier>_input_set
  orgIdentifier: <ORG_ID>
  projectIdentifier: <PROJECT_ID>
  pipelineIdentifier: <service_identifier>_pipeline
  inputSetReferences: []
  pipeline:
    identifier: <service_identifier>_pipeline
    variables:
      - name: imageTag
        value: latest
      - name: targetEnv
        value: <ENV_TIER>
    stages:
      - stage:
          identifier: Deploy_<env_identifier>
          spec:
            environment:
              environmentRef: <env_tier>
              infrastructureDefinitions:
                - identifier: <service_identifier>_<env_tier>_infra

Step 7 — Dry-Run Validation

Before first real deployment, run pipeline with skipDryRun: false:

  1. Navigate to pipeline → Run → select input set
  2. Enable "Dry Run" toggle (CD stage will generate manifests without applying)
  3. Review generated manifest in execution logs
  4. Confirm: correct image, namespace, resource limits, labels

Onboarding Hand-off Template

Generate and share this document with the service team:

## Harness Onboarding Summary — <SERVICE_NAME>

**Project**: <PROJECT_ID> | **Org**: <ORG_ID>

### Resources Created
| Resource | Identifier |
|---|---|
| Service | <service_identifier> |
| Environment (dev) | dev |
| Environment (staging) | staging |
| Infrastructure (dev) | <service_identifier>_dev_infra |
| Infrastructure (staging) | <service_identifier>_staging_infra |
| Pipeline | <service_identifier>_pipeline |

### How to Deploy
1. Push to `main` branch → webhook trigger fires automatically
2. Or: Harness UI → Pipelines → <SERVICE_NAME> → Run → select input set

### Contacts
- SRE Owner: <SRE_NAME>
- Harness Admin: <ADMIN_NAME>
- Runbook: <LINK>

AI Agent Integration

Autonomy Level

AspectLevelDescription
CurrentL2AI generates service/env/connector definitions from prompts
TargetL3AI creates and configures services, human validates

Harness AI Agent

Agent: Harness AI DevOps Agent Capabilities:

  • Service creation via conversational prompts
  • Environment definition generation
  • Connector configuration
  • Service dependency mapping

Human Gates

  • Service definition approval
  • Production environment creation

Fallback

When Harness AI is unavailable: Use static pipeline templates from s09 Template Library and manual YAML construction following Harness schema documentation.


Success Criteria

  • All connectors tested and showing "Success"
  • Service definition saved and visible in Harness UI
  • Infrastructure definition linked to correct cluster/namespace
  • Dry-run executed without errors
  • First real deployment to dev completed successfully
  • Hand-off document delivered to service team

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.