@varde-flyt/vfac 0.1.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +96 -0
- package/dist/vfac.mjs +16745 -0
- package/package.json +31 -0
package/README.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# vfac
|
|
2
|
+
|
|
3
|
+
Deploy and manage Varde Flyt Products from a manifest — from a terminal, a
|
|
4
|
+
pipeline or an agent.
|
|
5
|
+
|
|
6
|
+
```sh
|
|
7
|
+
npm install -g @varde-flyt/vfac
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Getting started
|
|
11
|
+
|
|
12
|
+
You need three things from your organization's Varde Flyt portal, under
|
|
13
|
+
**Identity → Context Gates**:
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
export VFAC_ENDPOINT=https://your-organization.cloud.vardeflyt.no
|
|
17
|
+
export VFAC_CREDENTIAL_ID=cg_...
|
|
18
|
+
export VFAC_CREDENTIAL_SECRET=... # shown once, when the Gate Key is created
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Then check what you have:
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
vfac doctor
|
|
25
|
+
vfac guide
|
|
26
|
+
vfac whoami
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
`doctor` checks the endpoint, the API, your credential and what that credential
|
|
30
|
+
reaches, in that order, and reports the first thing that is actually wrong.
|
|
31
|
+
|
|
32
|
+
`vfac guide` is the documentation. It is served by the platform you are pointed
|
|
33
|
+
at rather than bundled here, so it always describes the deployment in front of
|
|
34
|
+
you — versions, regions, service profiles and configuration are answered by that
|
|
35
|
+
platform's catalogue and are never hardcoded in this tool.
|
|
36
|
+
|
|
37
|
+
## Choose a Project
|
|
38
|
+
|
|
39
|
+
The catalogue is read **under a Project**, because that is the scope a Context
|
|
40
|
+
Gate is granted in. Nothing below works until one is selected:
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
vfac project list
|
|
44
|
+
vfac context set --project <projectId>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## The workflow
|
|
48
|
+
|
|
49
|
+
```sh
|
|
50
|
+
vfac product list
|
|
51
|
+
vfac product show <productId>
|
|
52
|
+
vfac manifest init --product <productId> --name "My resource" > resource.yaml
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
```sh
|
|
56
|
+
vfac validate -f resource.yaml
|
|
57
|
+
vfac plan -f resource.yaml
|
|
58
|
+
vfac apply -f resource.yaml --secret SETTING=env:VARIABLE
|
|
59
|
+
vfac get operation <operationId>
|
|
60
|
+
vfac get product-instance <productInstanceId>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Secrets are supplied per apply and never belong in the manifest — a manifest is a
|
|
64
|
+
file you commit.
|
|
65
|
+
|
|
66
|
+
## Running it again
|
|
67
|
+
|
|
68
|
+
**Send no secret.** A pipeline re-applies the same manifest on every push:
|
|
69
|
+
|
|
70
|
+
```sh
|
|
71
|
+
vfac apply -f resource.yaml
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
With no secret to write, an apply that finds nothing changed answers `NO_CHANGE`.
|
|
75
|
+
That is the ordinary outcome for a pipeline, not a failure. It is not a health
|
|
76
|
+
check either: `vfac` exits non-zero when a resource matches your manifest and is
|
|
77
|
+
not actually serving.
|
|
78
|
+
|
|
79
|
+
Sending a secret is itself a change. The platform stores secrets write-only, so
|
|
80
|
+
it has nothing to compare against and treats one it was handed as one to write —
|
|
81
|
+
so this answers `UPDATE` and redeploys, even when the value is the value already
|
|
82
|
+
stored:
|
|
83
|
+
|
|
84
|
+
```sh
|
|
85
|
+
vfac apply -f resource.yaml --secret SETTING=env:VARIABLE
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Send secrets on the apply that creates the resource and on the run that rotates
|
|
89
|
+
one, and on no other run. A pipeline that passes its secrets every run restarts
|
|
90
|
+
your service every time somebody pushes a README.
|
|
91
|
+
|
|
92
|
+
## Where the Gate Secret goes
|
|
93
|
+
|
|
94
|
+
Into your secret store, and nowhere else. `vfac` never writes it to disk: it
|
|
95
|
+
exchanges it for a short-lived session, and caches only that, in a `0700`
|
|
96
|
+
directory as a `0600` file.
|