Skip to content
This repository was archived by the owner on Apr 13, 2020. It is now read-only.

Commit 90f4ba0

Browse files
committed
Adding information on access.yaml configuration
1 parent 5209a4a commit 90f4ba0

File tree

3 files changed

+72
-8
lines changed

3 files changed

+72
-8
lines changed

guides/images/spk-add-variable.png

189 KB
Loading

guides/project-service-management-guide.md

+71-7
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ This document describes the workflow for deploying a set of services
2020
configured to sync from the single Materialized Manifest Repositories, and
2121
multiple Project repositories can be pointed to the single High Level
2222
Definition Repository.
23-
- Step 5 can be repeated each time you need to onboard a service to your
24-
Bedrxock automated infrastructure.
23+
- Step 5 can be repeated each time you need to onboard a service to your Bedrock
24+
automated infrastructure.
2525
- Step 6 can be run as many times as required to add a service revision to a
2626
Bedrock project.
2727

@@ -253,7 +253,7 @@ application repositories
253253

254254
#### Helm Configuration for SPK
255255

256-
`spk service create` allows a user to configure a service a number fo ways with
256+
`spk service create` allows a user to configure a service a number of ways with
257257
a backing helm chart.
258258

259259
Presently, there are are a number of options for `spk service create` documented
@@ -269,7 +269,7 @@ below:
269269
```
270270

271271
As noted by the the documentation text, `helm-chart-*` and `helm-config-*` are
272-
both mutually exclusive configurations ie: you can _only_ use one set of
272+
both mutually exclusive configurations: you can _only_ use one set of
273273
configurations or the other.
274274

275275
This section intends on documenting the various use cases for both sets of
@@ -290,10 +290,10 @@ arguments:
290290
spk service create --helm-chart-chart stable/nginx --helm-chart-repository github.com/helm/charts
291291
```
292292

293-
##### Helm Charts in a distinct Git Repository
293+
##### Helm Charts in a distinct Git Repository from Application Sources in the same Azure DevOps Project
294294

295-
If your Helm Charts are in their own distinct Git Repository in an Azure DevOps
296-
project, you can use the `helm-config` arguments to configure `spk`:
295+
If your Helm Charts are in their own distinct Git Repository in the _same_ Azure
296+
DevOps project, you can use the `helm-config` arguments to configure `spk`:
297297

298298
```
299299
spk service create --helm-config-git https://dev.azure.com/fabrikam/fabrikam-project/_git/fabrikam-helm-charts --helm-config-branch master --helm-path /charts/fabrikam
@@ -302,6 +302,59 @@ spk service create --helm-config-git https://dev.azure.com/fabrikam/fabrikam-pro
302302
The above invocation presumes that the helm chart repository configured for
303303
`spk` is _different_ from the application repository configured for `spk` usage.
304304

305+
The `helm-config-git` parameter _must not_ contain the username portion of a
306+
url. If you retrieve the URL from Azure DevOps's "Clone Repository" UI, it will
307+
automatically have the username filled for an HTTPs clone ie:
308+
309+
`https://[email protected]/fabrikam/fabrikam-project/_git/fabrikam-helm-charts`
310+
311+
Ensure that the you _remove_ the `fabrikam@` portion of the URL when passing
312+
parameters to `spk service create --helm-config-git`:
313+
314+
`https://dev.azure.com/fabrikam/fabrikam-project/_git/fabrikam-helm-charts`
315+
316+
##### Helm Charts in a distinct Git Repository from Application Sources in a different Azure DevOps Project
317+
318+
If your Helm Charts are in their own distinct Git Repository in a different
319+
Azure DevOps project, you can use still use the `helm-config` arguments to
320+
configure `spk`, but must also provide another option,
321+
`--helm-config-access-token-variable`. This configuration option is the name of
322+
the environment variable containing the Personal Access Token to access the git
323+
repository in `helm-config-git`:
324+
325+
```
326+
spk service create --helm-config-git https://dev.azure.com/fabrikam/fabrikam-helm-charts-project/_git/fabrikam-helm-charts --helm-config-branch master --helm-path /charts/fabrikam --helm-config-access-token-variable FABRIKAM_HELM_CHARTS_REPO_PAT
327+
```
328+
329+
The `helm-config-git` parameter _must not_ contain the username portion of a
330+
url. If you retrieve the URL from Azure DevOps's "Clone Repository" UI, it will
331+
automatically have the username filled for an HTTPs clone ie:
332+
333+
`https://[email protected]/fabrikam/fabrikam-project/_git/fabrikam-helm-charts`
334+
335+
Ensure that the you _remove_ the `fabrikam@` portion of the URL when passing
336+
parameters to `spk service create --helm-config-git`:
337+
338+
`https://dev.azure.com/fabrikam/fabrikam-project/_git/fabrikam-helm-charts`
339+
340+
Note the different Azure DevOps URL for the helm charts project in Azure DevOps
341+
and the addition of the `--helm-config-access-token-variable` parameter.
342+
343+
The `--helm-config-access-token-variable` parameter configures how an
344+
`access.yaml` file is written to the HLD for `fabrikate` to consume when
345+
rendering helm charts. For more information on authenticating with private git
346+
repositories when rendering helm charts, please refer to
347+
[fabrikate's documentation](https://github.com/microsoft/fabrikate/blob/master/docs/auth.md).
348+
349+
When the bedrock.yaml is committed, all the pipelines created, and the HLD
350+
repository is populated, you must add the environment variable,
351+
`FABRIKAM_HELM_CHARTS_REPO_PAT` to the HLD to Materialized pipeline as a
352+
pipeline variable. To do so, find the HLD to Materialized pipeline in the
353+
pipelines view on Azure DevOps, select it, select `Variables`, then select
354+
`New Variable`:
355+
356+
![Add a new pipeline variable](./images/spk-add-variable.png)
357+
305358
##### Helm Charts in the same repository as the application
306359

307360
If your Helm Charts are intended to be placed adjacent to your application
@@ -317,6 +370,17 @@ repository.
317370
spk service create --helm-config-git https://dev.azure.com/fabrikam/fabrikam-project/_git/fabrikam-app --helm-config-branch master --helm-path /charts/fabrikam
318371
```
319372

373+
The `helm-config-git` parameter _must not_ contain the username portion of a
374+
url. If you retrieve the URL from Azure DevOps's "Clone Repository" UI, it will
375+
automatically have the username filled for an HTTPs clone ie:
376+
377+
`https://[email protected]/fabrikam/fabrikam-project/_git/fabrikam-helm-charts`
378+
379+
Ensure that the you _remove_ the `fabrikam@` portion of the URL when passing
380+
parameters to `spk service create --helm-config-git`:
381+
382+
`https://dev.azure.com/fabrikam/fabrikam-project/_git/fabrikam-helm-charts`
383+
320384
#### Creating a Service Revision
321385

322386
- Create and checkout a new git branch

src/commands/hld/reconcile.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ export const reconcileHld = async (
189189
normalizedName(repositoryName)
190190
);
191191

192-
// Create access.yaml containing the bedrock application repo's URL in
192+
// Create access.yaml containing the bedrock application repo's URL
193193
await dependencies.createAccessYaml(
194194
dependencies.getGitOrigin,
195195
dependencies.generateAccessYaml,

0 commit comments

Comments
 (0)