Skip to content

Commit

Permalink
update armory cd to include patches and spinsvc options
Browse files Browse the repository at this point in the history
  • Loading branch information
aimeeu committed Aug 16, 2023
1 parent 9daf778 commit bb536a2
Show file tree
Hide file tree
Showing 2 changed files with 117 additions and 23 deletions.
2 changes: 1 addition & 1 deletion content/en/includes/plugins/terraform/config-redis.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
The Terraform Integration uses Redis to store Terraform logs and plans.
Terraform Integration uses Redis to store Terraform logs and plans.

>The Terraform Integration feature can only be configured to use a password with the default Redis user.
Expand Down
138 changes: 116 additions & 22 deletions content/en/plugins/terraform/install/armory-cd.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,128 @@ Enabling the Terraform Integration stage consists of these steps:

## {{% heading "prereq" %}}

You have read the [Terraform Integration Overview]({{< ref "plugins/terraform/_index.md" >}}).
* You have read the [Terraform Integration Overview]({{< ref "plugins/terraform/_index.md" >}}).
* You are running Armory Continuous Deployment.
* You manage your instance using the Armory Operator.

Terraform Integration is a built-in feature of Armory CD.

If you are running open source Spinnaker, see the [Pipelines-as-Code landing page]({{< ref "plugins/pipelines-as-code/#installation" >}}) for installation paths based on whether you are using Halyard or the Spinnaker Operator.

{{< include "plugins/terraform/terraform-prereqs.md" >}}

## Configure Armory CD

### Configure Redis

{{< include "plugins/terraform/config-redis.md" >}}
Terraform Integration uses Redis to store Terraform logs and plans.

>The Terraform Integration feature can only be configured to use a password with the default Redis user.
Configure Redis settings in your configuration and then apply.

{{< tabpane text=true right=true >}}
{{% tab header="spinnaker-kustomize-patches" %}}
You need to modify `spinnaker-kustomize-patches/armory/features/patch-terraformer.yml`. Add Redis configuration in the `profiles` section.

```yaml
profiles:
redis:
baseUrl: "<your-redis-url>"
password: "<your-redis-password>"
```
{{% /tab %}}
{{% tab header="spinnakerservice.yml" %}}
```yaml
spec:
spinnakerConfig:
profiles:
terraformer:
redis:
baseUrl: "<your-redis-url>"
password: "<your-redis-password>"
```
{{% /tab %}}
{{< /tabpane >}}
### Configure your artifact account
{{< include "plugins/terraform/config-artifact-acct.md" >}}
The Terraform Integration uses the following artifact accounts:
* **Git Repo** - To fetch the repo housing your main Terraform files.
* **GitHub, BitBucket or HTTP** - *Optional*. To fetch single files such as var-files or backend config files.
Spinnaker uses the Git Repo Artifact Provider to download the repo containing your main Terraform templates. For more configuration options, see [Configure a Git Repo Artifact Account](https://spinnaker.io/setup/artifacts/gitrepo/).
{{< tabpane text=true right=true >}}
{{% tab header="spinnaker-kustomize-patches" %}}
You need to modify `spinnaker-kustomize-patches/armory/features/patch-terraformer.yml`. Configure artifacts in the `spec.spinnakerConfig.config.artifacts` section.

```yaml
spec:
spinnakerConfig:
config:
armory:
terraform:
enabled: true
artifacts:
gitrepo:
enabled: true
accounts:
- name: gitrepo
username: <username>
token: <git-token>
# password:
# tokenFile:
# usernamePasswordFile:
# sshPrivateKeyFilePath:
# sshPrivateKeyPassphrase:
# sshKnownHostsFilePath:
# sshTrustUnknownHosts:
```

{{% /tab %}}
{{% tab header="spinnakerservice.yml" %}}

```yaml
spec:
spinnakerConfig:
profiles:
clouddriver:
artifacts:
gitRepo:
enabled: true
accounts:
- name: gitrepo
token: <your-personal-access-token>
```

{{% /tab %}}
{{< /tabpane >}}


### Configure additional repos

You need to modify `spinnaker-kustomize-patches/armory/features/patch-terraformer.yml`. Configure additional artifacts in the `spec.spinnakerConfig.config.artifacts` section.

{{< include "plugins/terraform/configure-optional-repos.md" >}}

## Enable Terraform Integration

Add to your Armory CD configuration:
{{< tabpane text=true right=true >}}
{{% tab header="spinnaker-kustomize-patches" %}}
You need to modify your Kustomization recipe to include `patch-terraformer.yml`.

```yaml
patchesStrategicMerge:
- armory/features/patch-terraformer.yml
```

{{% /tab %}}
{{% tab header="spinnakerservice.yml" %}}
Add `enabled: true` to your `terraform` section.

```yaml
spec:
Expand All @@ -53,29 +154,22 @@ spec:
enabled: true
```

## Apply the update
After you finish your Terraform Integration configuration, perform the following steps:
{{% /tab %}}
{{< /tabpane >}}

1. Apply the changes:
Assuming that Armory CD lives in the namespace `spinnaker` and the `SpinnakerService` manifest is named `spinnakerservice.yml`:

```bash
kubectl -n spinnaker apply -f spinnakerservice.yml
```
## Apply the update

1. Confirm that the Terraform Integration service (Terraformer) is deployed with your Armory CD deployment:
After you finish your Terraform Integration configuration, apply your changes. Confirm that the Terraform Integration service (Terraformer) is deployed with your Armory CD deployment:

```bash
kubectl get pods -n <your-spinnaker-namespace>
```
```bash
kubectl get pods -n <your-spinnaker-namespace>
```

In the command output, look for a line similar to the following:
In the command output, look for a line similar to the following:

```bash
spin-terraformer-d4334g795-sv4vz 2/2 Running 0 0d
```
```bash
spin-terraformer-d4334g795-sv4vz 2/2 Running 0 0d
```

## {{% heading "nextSteps" %}}

Expand Down

0 comments on commit bb536a2

Please sign in to comment.