provider-jfrogartifactory
is a Crossplane provider that
is built using Upjet code
generation tools and exposes XRM-conformant managed resources for the
Artifactory API.
Install the provider by using the following command after changing the image tag to the latest release:
up ctp provider install guidewire-oss/provider-jfrogartifactory:v0.1.0
Alternatively, you can use declarative installation:
cat <<EOF | kubectl apply -f -
apiVersion: pkg.crossplane.io/v1
kind: Provider
metadata:
name: provider-jfrogartifactory
spec:
package: guidewire-oss/provider-jfrogartifactory:v0.1.0
EOF
Notice that in this example Provider resource is referencing ControllerConfig with debug enabled.
You can see the API reference here.
Run code-generation pipeline:
go run cmd/generator/main.go "$PWD"
Run against a Kubernetes cluster:
make run
Build, push, and install:
make all
Build binary:
make build
For filing bugs, suggesting improvements, or requesting new features, please open an issue.
in a terminal in the dev container:
mage setupE2E
in new terminal:
kubectl apply -f package/crds
make run
in new terminal:
mage testE2E
- Cannot use OSS Artifactory because it does not support creating repositories through REST APIs.
- Get a license for Artifactory: https://jfrog.com/start-free/#ft
- Set the environment variable
ARTIFACTORY_LICENSE_KEY
in your local ~/.zshrc and restart your IDE. - After running
mage setupE2E
, runkubectl port-forward --namespace jfrog svc/artifactory-artifactory-nginx 8888:80
Note that ...crossplane.yaml: No such file or directory
can be ignored, and make build.all
can be used to build the image for amd64 on arm64 machines
make build
up xpkg build \
--controller <IMAGE_NAME>:<IMAGE_TAG> \
--package-root ./package \
--output ./jfrogprovider.xpkg
Push the image to ECR:
up xpkg push <ACCOUNT_ID>.dkr.ecr.us-west-2.amazonaws.com/jfrogprovider:<IMAGE_TAG> -f jfrogprovider.xpkg
To test on a scratch cluster using provider , do the following:
Create the following provider-artifactory.yaml
on your local machine:
apiVersion: pkg.crossplane.io/v1
kind: Provider
metadata:
name: provider-artifactory
spec:
package: <ACCOUNT_ID>.dkr.ecr.us-west-2.amazonaws.com/jfrogprovider:<IMAGE_TAG>
Then apply it on the scratch cluster:
kubectl apply -f <FILE_PATH>/provider-artifactory.yaml
Apply the kubernetes secrets
kubectl apply -f examples/manifests/templates/<FILE_NAME>.yaml
Apply the provider configs and repositories
kubectl apply -f examples/manifests/<FILE_NAME>.yaml
- In a cluster ,Apply all the manifest files in package/crds
In one of you terminals checkout this repository https://github.com/suvaanshkumar/provider-jfrogartifactory amd run
make run
In another terminal run the following
- Generate an identity token on artifactory to be used here.
- Create a file similar to creds.json present in examples/manifests/template folder and fill in the url and the and key
- Base64 encode this file and put it in the secret.yaml file present in examples/manifests/template in data field and apply the secret
- Apply providerconfigartifactory.yaml present in examples/manifests
- Apply the genericrepository.yaml or any other resource you want