Skip to content

Commit

Permalink
fix: Omit config key in configure artifact document. (argoproj#2539)
Browse files Browse the repository at this point in the history
Co-authored-by: Simon Behar <[email protected]>
  • Loading branch information
Eji4h and simster7 committed Mar 28, 2020
1 parent 864bf1e commit b4c9c54
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 187 deletions.
1 change: 1 addition & 0 deletions docs/configure-artifact-repository.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ Example:
$ kubectl edit configmap workflow-controller-configmap -n argo # assumes argo was installed in the argo namespace
...
data:
config: |
artifactRepository: |
s3:
bucket: my-bucket
Expand Down
1 change: 1 addition & 0 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ kubectl edit cm -n argo workflow-controller-configmap
Add the following:
```yaml
data:
config: |
artifactRepository: |
s3:
bucket: my-bucket
Expand Down
95 changes: 95 additions & 0 deletions docs/workflow-controller-configmap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# Workflow Controller Configmap

## Introduction

The Workflow Controller Configmap is used to set controller-wide settings.

For a detailed example, please see [`workflow-controller-configmap.yaml`](./workflow-controller-configmap.yaml).

## Setting the Configmap

The configmap should be saved as a K8s Configmap on the cluster in the same namespace as the `workflow-controller`.
It should then be referenced by the `workflow-controller` as an command argument:

```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: workflow-controller
spec:
selector:
matchLabels:
app: workflow-controller
template:
metadata:
labels:
app: workflow-controller
spec:
containers:
- args:
- --configmap
- workflow-controller-configmap # Set configmap name here
- --executor-image
- argoproj/argoexec:latest
- --namespaced
command:
- workflow-controller
image: argoproj/workflow-controller:latest
name: workflow-controller
serviceAccountName: argo
```

## Alternate Structure

In all versions, the configuration may be under a `config: |` key:

```yaml
# This file describes the config settings available in the workflow controller configmap
apiVersion: v1
kind: ConfigMap
metadata:
name: workflow-controller-configmap
data:
config: |
instanceID: my-ci-controller
artifactRepository:
archiveLogs: true
s3:
endpoint: s3.amazonaws.com
bucket: my-bucket
region: us-west-2
insecure: false
accessKeySecret:
name: my-s3-credentials
key: accessKey
secretKeySecret:
name: my-s3-credentials
key: secretKey
```

In version 2.7+, the `config: |` key is optional. However, if the `config: |` key is not used, all nested maps under top level
keys should be strings. This makes it easier to generate the map with some configuration management tools like Kustomize.

```yaml
# This file describes the config settings available in the workflow controller configmap
apiVersion: v1
kind: ConfigMap
metadata:
name: workflow-controller-configmap
data: # "config: |" key is optional in 2.7+!
instanceID: my-ci-controller
artifactRepository: | # However, all nested maps must be strings
archiveLogs: true
s3:
endpoint: s3.amazonaws.com
bucket: my-bucket
region: us-west-2
insecure: false
accessKeySecret:
name: my-s3-credentials
key: accessKey
secretKeySecret:
name: my-s3-credentials
key: secretKey
```
2 changes: 1 addition & 1 deletion docs/workflow-controller-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kind: ConfigMap
metadata:
name: workflow-controller-configmap
data:
config: |
config: | # This is optional in v2.7+, see docs/workflow-controller-configmap.md
# instanceID is a label selector to limit the controller's watch to a specific instance. It
# contains an arbitrary value that is carried forward into its pod labels, under the key
# workflows.argoproj.io/controller-instanceid, for the purposes of workflow segregation. This
Expand Down
186 changes: 0 additions & 186 deletions docs/workflow-controller-configmap_v2.7+.yaml

This file was deleted.

0 comments on commit b4c9c54

Please sign in to comment.