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

Commit

Permalink
Fixing formatting (#461)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrebriggs authored Mar 27, 2020
1 parent af9ea2d commit fd486cb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 20 deletions.
6 changes: 1 addition & 5 deletions docs/commands/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,6 @@
"description": "Name of the resource group to create new storage account when it does not exist",
"required": true
},
{
"arg": "-k, --key-vault-name <key-vault-name>",
"description": "Name of the Azure key vault"
},
{
"arg": "--service-principal-id <service-principal-id>",
"description": "Azure service principal id with `contributor` role in Azure Resource Group",
Expand Down Expand Up @@ -316,7 +312,7 @@
"alias": "r",
"description": "Reconcile a HLD with the services tracked in bedrock.yaml.",
"options": [],
"markdown": "## Description\n\nThe reconcile feature scaffolds a HLD with the services in the `bedrock.yaml`\nfile at the root level of the application repository. Recall that in a\nmono-repo, `spk service create` will add an entry into the `bedrock.yaml`\ncorresponding to all tracked services. When the service has been merged into\n`master` of the application repository, a pipeline (see `hld-lifecycle.yaml`,\ncreated by `spk project init`) runs `spk hld reconcile` to add any _new_\nservices tracked in `bedrock.yaml` to the HLD.\n\nThis command is _intended_ to be run in a pipeline (see the generated\n`hld-lifecycle.yaml` created from `spk project init`), but can be run by the\nuser in a CLI for verification.\n\nFor a `bedrock.yaml` file that contained within the\n`https://dev.azure.com/foo/bar/_git` repository, that has the following\nstructure:\n\n```\nrings:\n master:\n isDefault: true\nservices:\n ./services/fabrikam:\n displayName: 'fabrikam'\n k8sBackendPort: 8001\n k8sBackend: 'fabrikam-k8s-svc'\n pathPrefix: 'fabrikam-service'\n pathPrefixMajorVersion: 'v1'\n helm:\n chart:\n branch: master\n git: 'https://dev.azure.com/foo/bar/_git'\n path: stable/fabrikam-application\n middlewares:\n - ''\nvariableGroups:\n - fabrikam-vg\n```\n\nA HLD is produced that resembles the following:\n\n```\n├── component.yaml\n└── fabrikam\n ├── access.yaml\n ├── component.yaml\n ├── config\n │   └── common.yaml\n └── fabrikam\n ├── component.yaml\n ├── config\n │   └── common.yaml\n └── master\n ├── component.yaml\n ├── config\n │   └── common.yaml\n └── static\n ├── ingress-route.yaml\n └── middlewares.yaml\n```\n\nWith the `ingress-route.yaml` representing a\n[Traefik2 Ingress Route](https://docs.traefik.io/routing/providers/kubernetes-crd/#kind-ingressroute)\nbacked by a Kubernetes Service, and the `middlewares.yaml` representing a\n[Traefik2 Middleware](https://docs.traefik.io/routing/providers/kubernetes-crd/#kind-middleware)\nthat strips path prefixes.\n\nFor the `bedrock.yaml` shown above, the `ingress-route.yaml` produced is:\n\n```\napiVersion: traefik.containo.us/v1alpha1\nkind: IngressRoute\nmetadata:\n name: fabrikam-master\nspec:\n routes:\n - kind: Rule\n match: 'PathPrefix(`/v1/fabrikam-service`) && Headers(`Ring`, `master`)'\n middlewares:\n - name: fabrikam-master\n services:\n - name: fabrikam-k8s-svc-master\n port: 8001\n```\n\nAnd the `middlewares.yaml` produced is:\n\n```\napiVersion: traefik.containo.us/v1alpha1\nkind: Middleware\nmetadata:\n name: fabrikam-master\nspec:\n stripPrefix:\n forceSlash: false\n prefixes:\n - /v1/fabrikam-service\n```\n\nNote that there exists a third generated file, `access.yaml`. For the above\n`bedrock.yaml`, `access.yaml` contains a single line, which represents a\n[Fabrikate access.yaml definition](https://github.com/microsoft/fabrikate/blob/master/docs/auth.md#accessyaml),\nallowing Fabrikate to pull Helm Charts that are contained within the same\napplication repository:\n\n```\n'https://dev.azure.com/foo/bar/_git': ACCESS_TOKEN_SECRET\n```\n\nWhen `fabrikate` is invoked in the HLD to Manifest pipeline, it will utilize the\n`ACCESS_TOKEN_SECRET` environment variable injected at pipeline run-time as a\nPersonal Access Token to pull any referenced helm charts from the application\nrepository.\n"
"markdown": "## Description\n\nThe reconcile feature scaffolds a HLD with the services in the `bedrock.yaml`\nfile at the root level of the application repository. Recall that in a\nmono-repo, `spk service create` will add an entry into the `bedrock.yaml`\ncorresponding to all tracked services. When the service has been merged into\n`master` of the application repository, a pipeline (see `hld-lifecycle.yaml`,\ncreated by `spk project init`) runs `spk hld reconcile` to add any _new_\nservices tracked in `bedrock.yaml` to the HLD.\n\nThis command is _intended_ to be run in a pipeline (see the generated\n`hld-lifecycle.yaml` created from `spk project init`), but can be run by the\nuser in a CLI for verification.\n\nFor a `bedrock.yaml` file that contained within the\n`https://dev.azure.com/foo/bar/_git` repository, that has the following\nstructure:\n\n```yaml\nrings:\n master:\n isDefault: true\nservices:\n ./services/fabrikam:\n displayName: \"fabrikam\"\n k8sBackendPort: 8001\n k8sBackend: \"fabrikam-k8s-svc\"\n pathPrefix: \"fabrikam-service\"\n pathPrefixMajorVersion: \"v1\"\n helm:\n chart:\n branch: master\n git: \"https://dev.azure.com/foo/bar/_git\"\n path: stable/fabrikam-application\n middlewares:\n - \"\"\nvariableGroups:\n - fabrikam-vg\n```\n\nA HLD is produced that resembles the following:\n\n```\n├── component.yaml\n└── fabrikam\n ├── access.yaml\n ├── component.yaml\n ├── config\n │ └── common.yaml\n └── fabrikam\n ├── component.yaml\n ├── config\n │ └── common.yaml\n └── master\n ├── component.yaml\n ├── config\n │ └── common.yaml\n └── static\n ├── ingress-route.yaml\n └── middlewares.yaml\n```\n\nWith the `ingress-route.yaml` representing a\n[Traefik2 Ingress Route](https://docs.traefik.io/routing/providers/kubernetes-crd/#kind-ingressroute)\nbacked by a Kubernetes Service, and the `middlewares.yaml` representing a\n[Traefik2 Middleware](https://docs.traefik.io/routing/providers/kubernetes-crd/#kind-middleware)\nthat strips path prefixes.\n\nFor the `bedrock.yaml` shown above, the `ingress-route.yaml` produced is:\n\n```yaml\napiVersion: traefik.containo.us/v1alpha1\nkind: IngressRoute\nmetadata:\n name: fabrikam-master\nspec:\n routes:\n - kind: Rule\n match: \"PathPrefix(`/v1/fabrikam-service`) && Headers(`Ring`, `master`)\"\n middlewares:\n - name: fabrikam-master\n services:\n - name: fabrikam-k8s-svc-master\n port: 8001\n```\n\nAnd the `middlewares.yaml` produced is:\n\n```yaml\napiVersion: traefik.containo.us/v1alpha1\nkind: Middleware\nmetadata:\n name: fabrikam-master\nspec:\n stripPrefix:\n forceSlash: false\n prefixes:\n - /v1/fabrikam-service\n```\n\nNote that there exists a third generated file, `access.yaml`. For the above\n`bedrock.yaml`, `access.yaml` contains a single line, which represents a\n[Fabrikate access.yaml definition](https://github.com/microsoft/fabrikate/blob/master/docs/auth.md#accessyaml),\nallowing Fabrikate to pull Helm Charts that are contained within the same\napplication repository:\n\n```yaml\n\"https://dev.azure.com/foo/bar/_git\": ACCESS_TOKEN_SECRET\n```\n\nWhen `fabrikate` is invoked in the HLD to Manifest pipeline, it will utilize the\n`ACCESS_TOKEN_SECRET` environment variable injected at pipeline run-time as a\nPersonal Access Token to pull any referenced helm charts from the application\nrepository.\n"
},
"infra generate": {
"command": "generate",
Expand Down
30 changes: 15 additions & 15 deletions src/commands/hld/reconcile.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,24 @@ For a `bedrock.yaml` file that contained within the
`https://dev.azure.com/foo/bar/_git` repository, that has the following
structure:

```
```yaml
rings:
master:
isDefault: true
services:
./services/fabrikam:
displayName: 'fabrikam'
displayName: "fabrikam"
k8sBackendPort: 8001
k8sBackend: 'fabrikam-k8s-svc'
pathPrefix: 'fabrikam-service'
pathPrefixMajorVersion: 'v1'
k8sBackend: "fabrikam-k8s-svc"
pathPrefix: "fabrikam-service"
pathPrefixMajorVersion: "v1"
helm:
chart:
branch: master
git: 'https://dev.azure.com/foo/bar/_git'
git: "https://dev.azure.com/foo/bar/_git"
path: stable/fabrikam-application
middlewares:
- ''
- ""
variableGroups:
- fabrikam-vg
```
Expand All @@ -46,15 +46,15 @@ A HLD is produced that resembles the following:
├── access.yaml
├── component.yaml
├── config
   └── common.yaml
└── common.yaml
└── fabrikam
├── component.yaml
├── config
   └── common.yaml
└── common.yaml
└── master
├── component.yaml
├── config
   └── common.yaml
└── common.yaml
└── static
├── ingress-route.yaml
└── middlewares.yaml
Expand All @@ -68,15 +68,15 @@ that strips path prefixes.

For the `bedrock.yaml` shown above, the `ingress-route.yaml` produced is:

```
```yaml
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: fabrikam-master
spec:
routes:
- kind: Rule
match: 'PathPrefix(`/v1/fabrikam-service`) && Headers(`Ring`, `master`)'
match: "PathPrefix(`/v1/fabrikam-service`) && Headers(`Ring`, `master`)"
middlewares:
- name: fabrikam-master
services:
Expand All @@ -86,7 +86,7 @@ spec:
And the `middlewares.yaml` produced is:

```
```yaml
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
Expand All @@ -104,8 +104,8 @@ Note that there exists a third generated file, `access.yaml`. For the above
allowing Fabrikate to pull Helm Charts that are contained within the same
application repository:

```
'https://dev.azure.com/foo/bar/_git': ACCESS_TOKEN_SECRET
```yaml
"https://dev.azure.com/foo/bar/_git": ACCESS_TOKEN_SECRET
```

When `fabrikate` is invoked in the HLD to Manifest pipeline, it will utilize the
Expand Down

0 comments on commit fd486cb

Please sign in to comment.