Onboard a repository¶
You end up with a staging and a production environment that deploy on their own.
Before you start¶
| You need | Detail |
|---|---|
A repository in blackstorm-dev |
Lowercase letters, digits, and hyphens; starts with a letter; up to 50 characters |
| Read access for the GitOps GitHub App | Ask an operator |
| A private Docker Hub repository | Same name as the GitHub repository |
Steps¶
1. Create the repository¶
gh repo create blackstorm-dev/my-app --private \
--template blackstorm-dev/project-template --clone
cd my-app
2. Create your key¶
make init # (1)!
- Creates
age.key, registers its public part in.sops.yaml, and uploads the private part to GitHub asSOPS_AGE_KEY.
3. Add your registry credentials¶
Three files, all encrypted. See Secrets.
4. Declare the contract¶
deploy/platform.yaml
releaseFormat: commit-sha # (1)!
images:
- repository: docker.io/<namespace>/my-app # (2)!
name: <namespace>/my-app # (3)!
environments:
staging:
path: deploy/staging
promotion: automatic
production:
path: deploy/production
promotion: manual
from: staging # (4)!
- How CI names a release. See Continuous integration.
- Every image that makes up a release.
- The name your manifests use for that image.
- Production only receives releases that staging verified.
5. Set your hostnames¶
deploy/staging/kustomization.yaml
patches:
- target:
kind: HTTPRoute
name: app
patch: |-
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: app
spec:
hostnames:
- my-app-staging.localhost
Do the same in deploy/production/kustomization.yaml.
6. Turn discovery on¶
gh repo edit --add-topic blackstorm-deploy
git push