Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure manifests into Components for composability #372

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 55 additions & 2 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,68 @@ In order to use the plugin in Argo CD you have 4 distinct options:
- Installation via `argocd-cm` ConfigMap

- Download AVP in a volume and control everything as Kubernetes manifests
- Available as a pre-built Kustomize app: <https://github.com/argoproj-labs/argocd-vault-plugin/blob/main/manifests/cmp-configmap>

- Available as a pre-built opinionated Kustomize app, including ArgoCD
via a base:
<https://github.com/argoproj-labs/argocd-vault-plugin/blob/main/manifests/cmp-configmap>. To consume, use this in your kustomization.yaml:

```yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- https://github.com/argoproj-labs/argocd-vault-plugin//manifests/cmp-configmap
```

- Also available as a [Kustomize Component](https://kubectl.docs.kubernetes.io/guides/config_management/components/)
containing only the configmap form of the plugin. This is useful if
you want to bring your own version of ArgoCD (e.g. High-Availability)
or compose it with other plugins/config:
<https://github.com/argoproj-labs/argocd-vault-plugin/blob/main/manifests/components/configmap>.
To consume, use something like this in your kustomization.yaml:

```yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- https://github.com/argoproj/argo-cd//manifests/ha/cluster-install?ref=2.4.4
... any other plugins/resources
components:
- https://github.com/argoproj-labs/argocd-vault-plugin//manifests/components/configmap
```

- Create a custom `argocd-repo-server` image with AVP and supporting tools pre-installed

- Installation via a sidecar container [(new, starting with Argo CD v2.4.0)](https://argo-cd.readthedocs.io/en/stable/user-guide/config-management-plugins/#installing-a-cmp)

- Download AVP and supporting tools into a volume and control everything as Kubernetes manifests, using an off-the-shelf sidecar image

- Available as a pre-built Kustomize app: <https://github.com/argoproj-labs/argocd-vault-plugin/blob/main/manifests/cmp-sidecar>
- Available as a pre-built opinionated Kustomize app, including ArgoCD
via a base:
<https://github.com/argoproj-labs/argocd-vault-plugin/blob/main/manifests/cmp-sidecar>. To consume, use this in your kustomization.yaml:

```yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- https://github.com/argoproj-labs/argocd-vault-plugin//manifests/cmp-sidecar
```

- Also available as a [Kustomize Component](https://kubectl.docs.kubernetes.io/guides/config_management/components/)
containing only the sidecar form of the plugin. This is useful if
you want to bring your own version of ArgoCD (e.g. High-Availability)
or compose it with other plugins/config:
<https://github.com/argoproj-labs/argocd-vault-plugin/blob/main/manifests/components/sidecar>.
To consume, use something like this in your kustomization.yaml:

```yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- https://github.com/argoproj/argo-cd//manifests/ha/cluster-install?ref=2.4.4
... any other plugins/resources
components:
- https://github.com/argoproj-labs/argocd-vault-plugin//manifests/components/sidecar
```

- Create a custom sidecar image with AVP and supporting tools pre-installed

Expand Down
6 changes: 3 additions & 3 deletions manifests/cmp-configmap/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ kind: Kustomization
resources:
- https://github.com/argoproj/argo-cd/manifests/cluster-install

patchesStrategicMerge:
- argocd-repo-server-deploy.yaml
- argocd-cm.yaml
components:
- ../components/configmap

5 changes: 2 additions & 3 deletions manifests/cmp-sidecar/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ images:
# Fixed in https://github.com/argoproj/argo-cd/pull/9319
resources:
- https://github.com/argoproj/argo-cd//manifests/cluster-install?ref=v2.4.0
- cmp-plugin.yaml

patchesStrategicMerge:
- argocd-repo-server.yaml
components:
- ../components/sidecar
6 changes: 6 additions & 0 deletions manifests/components/configmap/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component

patchesStrategicMerge:
- argocd-repo-server-deploy.yaml
- argocd-cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ spec:
# Note: In 2.4.0 onward, there is a dedicated SA for repo-server (not default)
# Note: This is not fully supported for Kubernetes < v1.19
automountServiceAccountToken: true
# Note: This is not fully supported for Kubernetes < v1.19. If you are
# having issues with the token on < v1.19, try uncommenting this:
# securityContext:
# fsGroup: 3999

# Each of the embedded YAMLs inside cmp-plugin ConfigMap will be mounted into it's respective plugin sidecar
volumes:
Expand All @@ -18,6 +22,8 @@ spec:
name: cmp-plugin
- name: custom-tools
emptyDir: {}
- name: cmp-tmp
emptyDir: {}

# Download tools
initContainers:
Expand Down Expand Up @@ -51,7 +57,7 @@ spec:
- mountPath: /home/argocd/cmp-server/plugins
name: plugins
- mountPath: /tmp
name: tmp
name: cmp-tmp

# Register plugins into sidecar
- mountPath: /home/argocd/cmp-server/config/plugin.yaml
Expand All @@ -76,7 +82,7 @@ spec:
- mountPath: /home/argocd/cmp-server/plugins
name: plugins
- mountPath: /tmp
name: tmp
name: cmp-tmp

# Register plugins into sidecar
- mountPath: /home/argocd/cmp-server/config/plugin.yaml
Expand All @@ -101,7 +107,7 @@ spec:
- mountPath: /home/argocd/cmp-server/plugins
name: plugins
- mountPath: /tmp
name: tmp
name: cmp-tmp

# Register plugins into sidecar
- mountPath: /home/argocd/cmp-server/config/plugin.yaml
Expand Down
8 changes: 8 additions & 0 deletions manifests/components/sidecar/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component

resources:
- cmp-plugin.yaml

patchesStrategicMerge:
- argocd-repo-server.yaml
5 changes: 5 additions & 0 deletions manifests/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ./cmp-configmap