
harbor-operator
Manage Harbor registries with Kubernetes
Description
harbor-operator lets admins and developers manage resources in Harbor using Kubernetes through CRD's, such as Projects & Registries.
Getting Started
You’ll need a Kubernetes cluster to run against. You can use KIND to get a local cluster for testing, or run against a remote cluster.
Note: Your controller will automatically use the current context in your kubeconfig file (i.e. whatever cluster kubectl cluster-info
shows).
Running on the cluster
- Install CRD's and the controller onto the clusters
kubectl apply -k config/crd
kubectl apply -k config/default
- Create secret holding credentials to the Harbor server
kubectl create secret generic harbor-credentials --from-literal="username=admin" --from-literal="password=Harbor12345"
- Create a
HarborService
cat <<EOF | kubectl apply -f -
apiVersion: harbor.mdlwr.com/v1alpha1
kind: HarborService
metadata:
name: harbor-default
spec:
insecure: true
scheme: https
externalBackend:
host: harbor.my.company.com
port: 443
secretRef:
name: harbor-credentials
EOF
- Start creating resources, such as
Project
with a reference to your HarborService
cat <<EOF | kubectl apply -f -
apiVersion: harbor.mdlwr.com/v1alpha1
kind: HarborProject
metadata:
name: project-01
spec:
harbor: harbor-default
EOF
Running locally (for contributors)
- Install CRD's
make install
- Run the controller
make run
Uninstall CRDs
To delete the CRDs from the cluster:
make uninstall
Undeploy controller
UnDeploy the controller to the cluster:
make undeploy
Contributing
You are welcome to contribute to this project by opening PR's. Create an Issue if you have feedback