Skip to content
Merged
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
8 changes: 3 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -129,19 +129,17 @@ run: go.build
@# To see other arguments that can be provided, run the command with --help instead
$(GO_OUT_DIR)/provider --debug

dev-debug: $(KIND) $(KUBECTL)
dev-debug: $(KIND) $(KUBECTL) $(HELM)
@$(INFO) Creating kind cluster
@$(KIND) create cluster --name=$(PROJECT_NAME)-dev
@$(KUBECTL) cluster-info --context kind-$(PROJECT_NAME)-dev
@$(KUBECTL) create ns argocd
@$(INFO) Installing ArgoCD
@$(KUBECTL) apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
@$(INFO) Installing Crossplane CRDs
@$(KUBECTL) apply -k https://github.com/crossplane/crossplane//cluster?ref=master
@$(INFO) Installing Crossplane CRDs and creating crossplane-system namespace
@$(HELM) install crossplane --namespace crossplane-system --create-namespace crossplane-stable/crossplane
@$(INFO) Installing Provider Template CRDs
@$(KUBECTL) apply --server-side=true -R -f package/crds
@$(INFO) Creating crossplane-system namespace
@$(KUBECTL) create ns crossplane-system
@$(INFO) Creating provider config and secret
@$(KIND) get kubeconfig --name=$(PROJECT_NAME)-dev > kubeconfig
@$(INFO) Now you can debug the provider with the IDE...
Expand Down
66 changes: 64 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,70 @@ following new functionality:

Follow the [official docs](https://crossplane.io/docs/master/getting-started/install-configure.html#install-crossplane) to install crossplane, then these steps to get started with `provider-argocd`.

### Add the Crossplane Helm Repository

```bash
helm repo add crossplane-stable https://charts.crossplane.io/stable
helm repo update
```

### Initialize Build Submodules

Before building or running the provider, ensure the required "build" Make submodule is initialized. This submodule supports CI/CD tasks shared across all providers.

```bash
make submodules
```

### Run ArgoCD and Crossplane Locally with Kind

To start a local Kubernetes cluster with `kind` and install Argo CD and Crossplane and the provider CRDs in a single command, run:

```bash
make dev-debug
```

which can later be undone with `make dev-teardown` deleting the Kind cluster.

### Run the Provider Locally for Development

To start the provider in debug mode, you can run the provider directly:

```bash
go run ./cmd/provider --debug
```

#### Optional: Run with VSCode

Alternatively, if you use VSCode, you can configure a file `.vscode/launch.json` to run the provider in debug mode in a more convenient way:

```json filename=".vscode/launch.json"
{
"configurations": [
{
"name": "Run Provider Locally",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "${workspaceFolder}/cmd/provider",
"args": [
"--debug"
]
}
]
}
```

### Apply CRs

To test the provider, you can apply the example CRs in `examples/`:

```bash
kubectl apply -f examples/projects/project.yaml
```

## Getting Started Step-by-Step

### Optional: Start a local Argo CD server
```bash
kind create cluster
Expand Down Expand Up @@ -105,8 +169,6 @@ spec:
EOF
```



## Contributing

provider-argocd is a community driven project and we welcome contributions. See
Expand Down
Loading