-
Notifications
You must be signed in to change notification settings - Fork 38
docs: some demo script #363
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
Closed
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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 hidden or 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,66 @@ | ||||||
| Here is how to run e2e locally. Make sure that you have installed Docker and Kind. | ||||||
|
|
||||||
| 1. Install mongo db | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| ```shell | ||||||
| helm install ryan-mongodb -n mongodb-system --create-namespace azure-marketplace/mongodb-sharded --set service.type=LoadBalancer,configsvr.pdb.create=true,configsvr.persistence.storageClass=managed-csi | ||||||
|
|
||||||
| kubectl apply -f mongo_install.yaml | ||||||
| ``` | ||||||
|
|
||||||
| 2. Verify on the member cluster | ||||||
| ```shell | ||||||
| helm list -n mongodb-system | ||||||
|
|
||||||
| export MONGODB_ROOT_PASSWORD=$(kubectl get secret --namespace mongodb-system ryan-mongodb-mongodb-sharded -o jsonpath="{.data.mongodb-root-password}" | base64 -d) | ||||||
| kubectl run --namespace mongodb-system ryan-mongodb-mongodb-sharded-client --rm --tty -i --restart='Never' --image marketplace.azurecr.io/bitnami/mongodb-sharded:6.0.1-debian-11-r1 --command -- mongosh admin --host ryan-mongodb-mongodb-sharded --authenticationDatabase admin -u root -p $MONGODB_ROOT_PASSWORD | ||||||
|
|
||||||
| export SERVICE_IP=$(kubectl get svc --namespace mongodb-system ryan-mongodb-mongodb-sharded --include "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}") | ||||||
| mongosh --host $SERVICE_IP --port 27017 --authenticationDatabase admin -p $MONGODB_ROOT_PASSWORD | ||||||
| ``` | ||||||
|
|
||||||
| 3. Add the ArgoCD Helm | ||||||
| ```shell | ||||||
| export KUBECONFIG=~/.kube/fleet-hub | ||||||
| helm repo add argo https://argoproj.github.io/argo-helm | ||||||
| helm search repo argo | ||||||
| ``` | ||||||
|
|
||||||
| 2. Create the CRP on the hub | ||||||
| ```shell | ||||||
| kubectl apply -f argoCD_install.yaml | ||||||
| ``` | ||||||
|
|
||||||
| 3. Install the argoCD | ||||||
| ```shell | ||||||
| helm install --create-namespace -n argocd-system aks-demo argo/argo-cd | ||||||
| ``` | ||||||
|
|
||||||
| 4. Verify on one member cluster that the argoCD is installed | ||||||
| ```shell | ||||||
| kubectl get crds -l app.kubernetes.io/part-of=argocd | ||||||
| kubectl -n argocd-system get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d; echo | ||||||
| kubectl port-forward svc/aks-demo-argocd-server -n argocd-system 8080:443 | ||||||
| ``` | ||||||
| Check the argoCD web on cluster1 | ||||||
|
|
||||||
| 5. Apply the Argo application on the hub | ||||||
| ```shell | ||||||
| kubectl apply -f argo-app.yaml | ||||||
| ``` | ||||||
|
|
||||||
| 6. Check the member cluster1 and cluster2 web | ||||||
|
|
||||||
| 7. Change the Git Repo | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| 8. Delete the argo application | ||||||
| ```shell | ||||||
| kubectl delete -f argo-app.yaml | ||||||
| ``` | ||||||
|
|
||||||
| 9.uninstall the resources | ||||||
| ```shell | ||||||
| helm delete ryan-mongodb -n mongodb-system | ||||||
| helm delete aks-demo -n argocd-system | ||||||
| kubectl delete crds -l app.kubernetes.io/part-of=argocd | ||||||
| kubectl delete ns argocd-system | ||||||
| ``` | ||||||
This file contains hidden or 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,21 @@ | ||
| apiVersion: argoproj.io/v1alpha1 | ||
| kind: Application | ||
| metadata: | ||
| name: in-cluster-guestbook | ||
| namespace: argocd-system | ||
| #finalizers: | ||
| # - resources-finalizer.argocd.argoproj.io | ||
| spec: | ||
| destination: | ||
| namespace: guestbook | ||
| server: https://kubernetes.default.svc | ||
| project: default | ||
| source: | ||
| path: guestbook | ||
| repoURL: https://github.com/ryanzhang-oss/argocd-example-apps/ | ||
| targetRevision: argo-test | ||
| syncPolicy: | ||
| automated: | ||
| prune: true | ||
| syncOptions: | ||
| - CreateNamespace=true |
This file contains hidden or 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,28 @@ | ||
| apiVersion: fleet.azure.com/v1alpha1 | ||
| kind: ClusterResourcePlacement | ||
| metadata: | ||
| name: argocd-installer | ||
| spec: | ||
| resourceSelectors: | ||
| - group: "" | ||
| version: v1 | ||
| kind: Namespace | ||
| name: argocd-system | ||
| - group: rbac.authorization.k8s.io | ||
| version: v1 | ||
| kind: ClusterRole | ||
| labelSelector: | ||
| matchLabels: | ||
| app.kubernetes.io/part-of: argocd | ||
| - group: rbac.authorization.k8s.io | ||
| version: v1 | ||
| kind: ClusterRoleBinding | ||
| labelSelector: | ||
| matchLabels: | ||
| app.kubernetes.io/part-of: argocd | ||
| - group: apiextensions.k8s.io | ||
| version: v1 | ||
| kind: CustomResourceDefinition | ||
| labelSelector: | ||
| matchLabels: | ||
| app.kubernetes.io/part-of: argocd |
This file contains hidden or 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,10 @@ | ||
| apiVersion: fleet.azure.com/v1alpha1 | ||
| kind: ClusterResourcePlacement | ||
| metadata: | ||
| name: mongo-installer | ||
| spec: | ||
| resourceSelectors: | ||
| - group: "" | ||
| version: v1 | ||
| kind: Namespace | ||
| name: mongodb-system |
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.
should we write down the precondition (setup) of this demo? looks like we assume we have setup one 1 hub cluster and 2 member clusters.
may be also a sentence about the goal of the demo?