Skip to content

Commit

Permalink
Merge pull request goharbor#1066 from ywk253100/210930_htpasswd
Browse files Browse the repository at this point in the history
Drop the support for helm v2 and use "htpasswd" to generate the registry credential
  • Loading branch information
ywk253100 authored Oct 20, 2021
2 parents 46771e2 + e16513d commit fe58258
Show file tree
Hide file tree
Showing 10 changed files with 894 additions and 244 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
k8s_version: [v1.20.0, v1.19.4, v1.18.8]
k8s_version: [v1.22.0, v1.21.1, v1.20.7]
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -31,7 +31,7 @@ jobs:

- name: Install Nginx ingress controller
run: |
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/ingress-nginx-2.3.0/deploy/static/provider/kind/deploy.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.0.3/deploy/static/provider/kind/deploy.yaml
kubectl wait --namespace ingress-nginx --for=condition=ready pod --selector=app.kubernetes.io/component=controller --timeout=120s
- name: Set up Go 1.13
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
helm_version: [3.2.3, 2.16.12]
helm_version: [3.2.3]
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
23 changes: 2 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ This [Helm](https://github.com/kubernetes/helm) chart installs [Harbor](https://

## Prerequisites

- Kubernetes cluster 1.18+
- Helm 2.10.0+
- Kubernetes cluster 1.20+
- Helm v3

## Installation

Expand Down Expand Up @@ -60,31 +60,13 @@ If Harbor is deployed behind the proxy, set it as the URL of proxy.
### Install the chart

Install the Harbor helm chart with a release name `my-release`:

helm 2:

```bash
helm install --name my-release harbor/harbor
```

helm 3:

```bash
helm install my-release harbor/harbor
```

## Uninstallation

To uninstall/delete the `my-release` deployment:

helm 2:

```bash
helm delete --purge my-release
```

helm 3:

```
helm uninstall my-release
```
Expand Down Expand Up @@ -272,7 +254,6 @@ The following table lists the configurable parameters of the Harbor chart and th
| `registry.secret` | Secret is used to secure the upload state from client and registry storage backend. See [official docs](https://github.com/docker/distribution/blob/master/docs/configuration.md#http). If a secret key is not specified, Helm will generate one. Must be a string of 16 chars. | |
| `registry.credentials.username` | The username for accessing the registry instance, which is hosted by htpasswd auth mode. More details see [official docs](https://github.com/docker/distribution/blob/master/docs/configuration.md#htpasswd). | `harbor_registry_user` |
| `registry.credentials.password` | The password for accessing the registry instance, which is hosted by htpasswd auth mode. More details see [official docs](https://github.com/docker/distribution/blob/master/docs/configuration.md#htpasswd). It is suggested you update this value before installation. | `harbor_registry_password` |
| `registry.credentials.htpasswd` | The content of htpasswd file based on the value of `registry.credentials.username` `registry.credentials.password`. Currently `helm` does not support bcrypt in the template script, if the credential is updated you need to manually generated by calling [htpasswd](https://httpd.apache.org/docs/2.4/programs/htpasswd.html): `htpasswd -nbBC10 $username $password`. More details see [official_docs](https://github.com/docker/distribution/blob/master/docs/configuration.md#htpasswd). | `harbor_registry_user:$2y$10$9L4Tc0DJbFFMB6RdSCunrOpTHdwhid4ktBJmLD00bYgqkkGOvll3m` |
| `registry.relativeurls` | If true, the registry returns relative URLs in Location headers. The client is responsible for resolving the correct URL. Needed if harbor is behind a reverse proxy | `false` |
| **Chartmuseum** | | |
| `chartmuseum.enabled` | Enable chartmusuem to store chart | `true` |
Expand Down
10 changes: 2 additions & 8 deletions docs/High Availability.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Deploy Harbor on K8S via helm to make it highly available, that is, if one of no

## Prerequisites

- Kubernetes cluster 1.16+
- Helm 2.10.0+
- Kubernetes cluster 1.20+
- Helm v3
- High available ingress controller (Harbor does not manage the external endpoint)
- High available PostgreSQL database (Harbor does not handle the deployment of HA of database)
- High available Redis (Harbor does not handle the deployment of HA of Redis)
Expand Down Expand Up @@ -67,12 +67,6 @@ Configure the followings items in `values.yaml`, you can also set them as parame
### Installation

Install the Harbor helm chart with a release name `my-release`:

helm 2:
```bash
helm install --name my-release .
```
helm 3:
```
helm install my-release .
```
2 changes: 1 addition & 1 deletion templates/registry/registry-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ metadata:
{{ include "harbor.labels" . | indent 4 }}
type: Opaque
data:
REGISTRY_HTPASSWD: {{ .Values.registry.credentials.htpasswd | b64enc | quote }}
REGISTRY_HTPASSWD: {{ htpasswd .Values.registry.credentials.username .Values.registry.credentials.password | b64enc | quote }}
6 changes: 3 additions & 3 deletions test/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/goharbor/harbor-helm
go 1.13

require (
github.com/gruntwork-io/terratest v0.28.2
github.com/stretchr/testify v1.6.0
k8s.io/api v0.18.3
github.com/gruntwork-io/terratest v0.38.1
github.com/stretchr/testify v1.7.0
k8s.io/api v0.20.6
)
Loading

0 comments on commit fe58258

Please sign in to comment.