Skip to main content

Adopt a Repository, DNS and Sign-in

Bring a repository, a domain and a sign-in flow that you already have under management. For a new repository, read Set Up a Repository and CI.

Adopt a GitHub repository​

Declare a GithubRepository with the same name as the repository on GitHub. The engine looks the repository up first. It creates a repository only if it finds none. If it finds the repository, it changes the repository to match your manifest.

warning

Set public, description and configuration to match the live repository before you merge. If they differ, the engine changes the live repository.

The engine applies these settings to an adopted repository:

SettingWhat the engine applies
VisibilityPrivate. Public only if spec.public is true.
DescriptionThe value of spec.description. If the field is empty, the current description stays.
Issues, wiki and projectsOff. Each one is on only if spec.configuration turns it on.
Merge methodsSquash merge only. Merge commits and rebase merges are off.
Default branchmain
Branches after a mergeGitHub deletes the branch of a merged pull request.
ArchiveThe repository is not archived.

The engine also commits .github/CODEOWNERS to main. If the repository has a BuildDefinition, it also commits the CI workflow files. It then applies your branch rules and permissions. Make sure that the repository has a main branch.

apiVersion: lowops.manifests.v1
kind: GithubRepository
metadata:
name: legacy-billing-service # must match the repository name on GitHub
github-connection: default
organization: fincorp
spec:
public: false # must match the visibility on GitHub
description: "Billing service" # must match the description on GitHub
configuration:
issues: true # on only if the repository has issues today
wiki: false
projects: false
strategy: GITHUB_FLOW
codeOwners:
- path: "*"
owners: [platform-team]
permissions:
administrators:
groups: [platform-admins]
contributors:
groups: [backend-team]

If the GitHub App of your GithubConnection can see only selected repositories, add the repository before you merge. In GitHub, open Settings > Applications > Installed GitHub Apps, select the Infrastream app, and add the repository under Repository access. If you skip this, the engine cannot see the repository. It tries to create it, and GitHub rejects the name as a duplicate.

Add CI​

Follow Set Up a Repository and CI. Declare the ArtifactRegistry before the BuildDefinition that names it. Validation fails with "unknown artifact/external registry" if the registry does not exist yet.

Point a domain at the service​

Follow Set Up a Custom Domain. The one manual step is to delegate the domain to the new zone with NS records. An A record does not work.

Sign in​

Two mechanisms exist. Pick the one that matches your users.

Customers: IdentityProvider. Use it for an app with its own sign-in page. Declare the provider, then require it in a route rule.

apiVersion: lowops.manifests.v1
kind: IdentityProvider
metadata:
name: billing-portal-login
public-ingress: api-gateway
project: payment-gateway
environment: production
organizational-unit: retail-banking
organization: fincorp
spec:
displayName: "Fincorp Billing Portal"
providers:
google: true
# In the HttpRoute rule of the protected path:
rules:
- matches:
- prefixMatch: /portal
action:
destinations:
- deploymentConfig: billing-portal
port: 8080
authentication:
- type: IDENTITY_PROVIDER
tenants: [billing-portal-login]

Staff: IAP. Use type: INTERNAL in the route rule. The iapPermissions block of the parent PublicIngress says who can open the route. Your app receives a verified identity and never handles raw credentials.

    authentication:
- type: INTERNAL
note

The WorkforceIdentityProvider kind does nothing today. No code reads its spec. The platform team sets up staff single sign-on on the Organization. For staff tools, use type: INTERNAL.

Other common kinds​

  • GithubSecret gives a GitHub Actions workflow a build-time credential, for example an npm token. Set valueRef to the name of a Secret manifest. List the name in spec.secrets of the GithubRepository.
  • ExternalApplication, ExternalRegistry and TrustedRepository deploy an image that you built elsewhere. See Deploy an Application.