harbor-operator

command module
v1.0.0-alpha.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

README

Go Release

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
  1. Install CRD's and the controller onto the clusters
kubectl apply -k config/crd
kubectl apply -k config/default
  1. Create secret holding credentials to the Harbor server
kubectl create secret generic harbor-credentials --from-literal="username=admin" --from-literal="password=Harbor12345"
  1. 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
  1. 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)
  1. Install CRD's
make install
  1. 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

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
api
v1alpha1
Package v1alpha1 contains API Schema definitions for the harbor v1alpha1 API group +kubebuilder:object:generate=true +groupName=harbor.mdlwr.com
Package v1alpha1 contains API Schema definitions for the harbor v1alpha1 API group +kubebuilder:object:generate=true +groupName=harbor.mdlwr.com
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL