Create a service account for CI

Create a service account for pipelines; grant it only the roles it needs in a separate step.

yc iam service-account create --name sa-ci --description 'CI deployer'

tool
yc32 commands
tags
yciamcisecurity

More yc commands

  • yc iam key create --service-account-name sa-ci --output key.json

    Save a JSON authorized key for non-interactive login; rotate it and keep it in a secret store.

  • yc resource-manager folder add-access-binding <id> --role editor --service-account-name sa-ci

    Bind a role at the folder level; narrow roles are safer than editor.

  • yc managed-kubernetes cluster get-credentials <name> --external --force

    Add the cluster's external endpoint to kubeconfig; drop --external to use the internal VPC address.

  • yc managed-kubernetes cluster list --format json | jq -r '.[]|[.name,.status,.id]|@tsv'

    Print cluster name, status and ID as TSV for scripts and audits.

  • yc managed-kubernetes node-group create --cluster-name <name> --name ng-1 --platform standard-v3 --auto-scale min=1,max=5,initial=2 --location zone=ru-central1-a

    Create a node group in one zone that the autoscaler keeps between 1 and 5 nodes, starting with 2.

all 32 yc commands