Skip to content

Commit

Permalink
update example commands and secrets documentation (#60)
Browse files Browse the repository at this point in the history
Signed-off-by: Manabu McCloskey <manabu.mccloskey@gmail.com>
  • Loading branch information
nabuskey authored Aug 27, 2024
1 parent 620736e commit 4dcdf46
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,37 @@ idpbuilder installs the following packages to the cluster.

Once installed, idpbuilder passes control over these packages to ArgoCD by storing manifests in Gitea repositories then creating ArgoCD applications. From here on, ArgoCD manages them based on manifests checked into Git repositories.

## Getting Relevant Secrets

The `idpbuilder get secrets` command retrieves the following:
- ArgoCD initial admin password.
- Gitea admin user credentials.
- Any secrets labeled with `cnoe.io/cli-secret=true`.

You can think of the command as executing the following kubectl commands:

```bash
kubectl -n argocd get secret argocd-initial-admin-secret
kubectl get secrets -n gitea gitea-admin-secret
kubectl get secrets -A -l cnoe.io/cli-secret=true
```

If you want to retrieve secrets for a package, you can use the `-p` flag. To get secrets for a package named `gitea`:

```bash
idpbuilder get secrets -p gitea
```

For the `-p` flag to work, you must label the secret with `cnoe.io/package-name`.
For example, to make secret values available in a secret named `my-secret` for a package named `foo`:

```bash
kubectl label secret my-secret "cnoe.io/package-name=foo" "cnoe.io/cli-secret=true"
```

The secret will then be listed when issuing the `idpbuilder get secrets` command.
Alternatively, you can use the following command to retrieve the individual secret:

```
idpbuilder get secrets -p foo
```
61 changes: 31 additions & 30 deletions docs/reference-implementation/installations/idpbuilder/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ index: 2
The most basic command which creates a Kubernetes Cluster (Kind cluster) with the core packages installed.

```bash
./idpbuilder create
idpbuilder create
```

Once idpbuilder finishes provisioning cluster and packages, you can access GUIs by going to the following addresses in your browser.
Expand All @@ -23,59 +23,60 @@ Once idpbuilder finishes provisioning cluster and packages, you can access GUIs
You can obtain credentials for them by running the following command:

```bash
./idpbuilder get secrets
idpbuilder get secrets
```

<details>
<summary> The "get secrets" command </summary>
### Example commands

The `get secrets` command retrieves the following:
- ArgoCD initial admin password.
- Gitea admin user credentials.
- Any secrets labeled with `cnoe.io/cli-secret=true`.
**For more advanced use cases, check out the [Stacks Repository](https://github.com/cnoe-io/stacks).**

You can think of the command as executing the following kubectl commands:

```bash
kubectl -n argocd get secret argocd-initial-admin-secret
kubectl get secrets -n gitea gitea-admin-secret
kubectl get secrets -A -l cnoe.io/cli-secret=true
```
In addition, secrets labeled with `cnoe.io/package-name` can be specified with the `-p` flag. For example, for Gitea:
#### Create

```bash
./idpbuilder get secrets -p gitea
```
Specify the kubernetes version by using the `--kube-version` flag. Supported versions are available [here](https://github.com/kubernetes-sigs/kind/releases).

</details>
```
idpbuilder create --kube-version v1.27.3
```

### Example commands
Specify your own kind configuration file, use the `--kind-config` flag.

**For more advanced use cases, check out the [Stacks Repository](https://github.com/cnoe-io/stacks).**
```
idpbuilder create --build-name local --kind-config ./my-kind.yaml
```

You can specify the kubernetes version by using the `--kube-version` flag. Supported versions are available [here](https://github.com/kubernetes-sigs/kind/releases).
Override ArgoCD configmap.

```
./idpbuilder create --kube-version v1.27.3
idpbuilder create --package-custom-file=argocd:path/to/argocd-cm.yaml
```

If you want to specify your own kind configuration file, use the `--kind-config` flag.
For available flags and subcommands:

```
./idpbuilder create --build-name local --kind-config ./my-kind.yaml
idpbuilder create --help
```

If you want to specify ArgoCD configmap.
#### Get

Get all relevant secrets. See [this section](how-it-works.md#getting-relevant-secrets) for more information.

```
./idpbuilder create --package-custom-file=argocd:path/to/argocd-cm.yaml
idpbuilder get secrets
```

Run the following commands for available flags and subcommands:
Get secrets for a package named `gitea`.

```
idpbuilder get secrets -p gitea
```

#### Delete

Delete a cluster named `localdev`.

```
./idpbuilder --help
./idpbuilder create --help
idpbuilder delete --name localdev
```

### Custom Packages
Expand Down

0 comments on commit 4dcdf46

Please sign in to comment.