-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
chore: add kustomize project for testing param CMP locally #11265
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 | ||
leoluz marked this conversation as resolved.
Show resolved
Hide resolved
|
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 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this equivalent to a cluster install?