forked from argoproj/argo-cd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add kustomize project for testing param CMP locally (argoproj#…
…11265) Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com> Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com> Signed-off-by: schakrad <chakradari.sindhu@gmail.com>
- Loading branch information
Showing
7 changed files
with
139 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
This folder contains an Argo CD configuration file to allow | ||
testing CMP plugins locally. The Kustomize project will: | ||
|
||
- Install Argo CD in the current k8s context | ||
- Patch repo server configuring a test CMP plugin | ||
- Install an application that can be used to interact with the CMP plugin | ||
|
||
To install Argo CD with this Kustomize project run the following | ||
command: | ||
|
||
`kustomize build ./test/manifests/cmp | sed 's/imagePullPolicy: Always/imagePullPolicy: Never/g' | kubectl apply -f -` | ||
|
||
In Argo CD UI login with user/pass: admin/password | ||
|
||
An application with name `cmp-sidecar` should be available for testing. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Application | ||
metadata: | ||
name: plugin-test-app | ||
spec: | ||
project: default | ||
source: | ||
repoURL: https://github.com/argoproj/argo-cd.git | ||
path: test/manifests/cmp/app | ||
plugin: | ||
env: | ||
- name: FOO | ||
value: bar | ||
- name: REV | ||
value: test-$ARGOCD_APP_REVISION | ||
parameters: | ||
- name: array-param | ||
array: | ||
- override | ||
- values | ||
destination: | ||
namespace: default | ||
server: https://kubernetes.default.svc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# This yaml is used mainly to trigger the CMP plugin | ||
# for testing purposes. In real world, it should contain | ||
# proper kubernetes manifest files. | ||
name: sidecar-plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
resources: | ||
- ../../../manifests/namespace-install | ||
- ../../../manifests/crds | ||
- ../../../manifests/cluster-rbac | ||
- plugin.yaml | ||
- app.yaml | ||
|
||
patchesStrategicMerge: | ||
- repo-patch.yaml | ||
- secret-patch.yaml | ||
|
||
images: | ||
- name: quay.io/argoproj/argocd | ||
newName: argocd | ||
newTag: param |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: my-plugin-config | ||
data: | ||
plugin.yaml: | | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: ConfigManagementPlugin | ||
metadata: | ||
name: my-plugin | ||
spec: | ||
version: v1.0 | ||
init: | ||
command: [sh , -c, 'echo "params: $ARGOCD_APP_PARAMETERS"'] | ||
generate: | ||
command: [jq, -n, '{"kind": "ConfigMap", "apiVersion": "v1", "metadata": { "name": env.ARGOCD_APP_NAME, "namespace": env.ARGOCD_APP_NAMESPACE, "annotations": {"test": "annotation test", "KubeVersion": env.KUBE_VERSION }}, "data": { "params": env.ARGOCD_APP_PARAMETERS } }'] | ||
discover: | ||
fileName: "./subdir/s*.yaml" | ||
parameters: | ||
static: | ||
- name: string-param | ||
string: default-string-value | ||
- name: array-param | ||
array: [default, items] | ||
collectionType: array | ||
- name: map-param | ||
map: | ||
some: value | ||
collectionType: map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: argocd-repo-server | ||
app.kubernetes.io/part-of: argocd | ||
app.kubernetes.io/component: repo-server | ||
name: argocd-repo-server | ||
spec: | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/name: argocd-repo-server | ||
template: | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: argocd-repo-server | ||
spec: | ||
serviceAccountName: argocd-repo-server | ||
automountServiceAccountToken: false | ||
containers: | ||
- name: my-plugin | ||
command: [/var/run/argocd/argocd-cmp-server] | ||
image: stedolan/jq | ||
securityContext: | ||
runAsNonRoot: true | ||
runAsUser: 999 | ||
volumeMounts: | ||
- mountPath: /var/run/argocd | ||
name: var-files | ||
- mountPath: /home/argocd/cmp-server/plugins | ||
name: plugins | ||
- mountPath: /home/argocd/cmp-server/config/plugin.yaml | ||
subPath: plugin.yaml | ||
name: my-plugin-config | ||
volumes: | ||
- configMap: | ||
name: my-plugin-config | ||
name: my-plugin-config | ||
- emptyDir: {} | ||
name: cmp-tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: argocd-secret | ||
labels: | ||
app.kubernetes.io/name: argocd-secret | ||
app.kubernetes.io/part-of: argocd | ||
stringData: | ||
# admin.password is "password" | ||
admin.password: $2a$10$RncPyHW/B5ll2Z3J8s.IBOnbZ9uoJ4JhHLKzj5lzG/kU1KN1Oj3/K | ||
admin.passwordMtime: 2019-03-20T17:54:53Z | ||
type: Opaque |