This repository has been archived by the owner on Aug 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
55 changed files
with
2,212 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
apiVersion: v1 | ||
kind: Template | ||
metadata: | ||
creationTimestamp: null | ||
name: lagoon-secret-environment-template | ||
parameters: | ||
- name: HARBOR_CORE_SECRET | ||
description: The secret used to connect to harbor's core service | ||
generate: expression | ||
from: "[a-zA-Z0-9]{16}" | ||
- name: HARBOR_JOBSERVICE_SECRET | ||
description: The secret used to connect to harbor's jobservice service | ||
generate: expression | ||
from: "[a-zA-Z0-9]{16}" | ||
- name: HARBOR_REGISTRY_SECRET | ||
description: The secret used to connect to harbor's registry service | ||
generate: expression | ||
from: "[a-zA-Z0-9]{16}" | ||
- name: HARBOR_ADMIN_PASSWORD | ||
description: Harbor's admin password | ||
generate: expression | ||
from: "[a-zA-Z0-9]{32}" | ||
- name: CLAIR_DB_PASSWORD | ||
description: The password clair should use to talk to the postgres db | ||
generate: expression | ||
from: "[a-zA-Z0-9]{32}" | ||
- name: SAFE_BRANCH | ||
description: Which branch this belongs to, special chars replaced with dashes | ||
required: true | ||
- name: SAFE_PROJECT | ||
description: Which project this belongs to, special chars replaced with dashes | ||
required: true | ||
- name: BRANCH | ||
description: Which branch this belongs to, original value | ||
required: true | ||
- name: PROJECT | ||
description: Which project this belongs to, original value | ||
required: true | ||
- name: LAGOON_GIT_SHA | ||
description: git hash sha of the current deployment | ||
required: true | ||
- name: OPENSHIFT_PROJECT | ||
description: Name of the Project that this service is in | ||
required: true | ||
objects: | ||
- kind: Secret | ||
apiVersion: v1 | ||
metadata: | ||
name: harbor-core-secret | ||
stringData: | ||
HARBOR_CORE_SECRET: ${HARBOR_CORE_SECRET} | ||
- kind: Secret | ||
apiVersion: v1 | ||
metadata: | ||
name: harbor-jobservice-secret | ||
stringData: | ||
HARBOR_JOBSERVICE_SECRET: ${HARBOR_JOBSERVICE_SECRET} | ||
- kind: Secret | ||
apiVersion: v1 | ||
metadata: | ||
name: harborregistry-secret | ||
stringData: | ||
HARBOR_REGISTRY_SECRET: ${HARBOR_REGISTRY_SECRET} | ||
- kind: Secret | ||
apiVersion: v1 | ||
metadata: | ||
name: harbor-admin-password | ||
stringData: | ||
HARBOR_ADMIN_PASSWORD: ${HARBOR_ADMIN_PASSWORD} | ||
- kind: Secret | ||
apiVersion: v1 | ||
metadata: | ||
name: clair-db-password | ||
stringData: | ||
CLAIR_DB_PASSWORD: ${CLAIR_DB_PASSWORD} | ||
- kind: Secret | ||
apiVersion: v1 | ||
metadata: | ||
name: postgresql-password | ||
stringData: | ||
POSTGRESQL_PASSWORD: ${CLAIR_DB_PASSWORD} | ||
- kind: Secret | ||
apiVersion: v1 | ||
metadata: | ||
name: notary-db-url | ||
stringData: | ||
NOTARY_DB_URL: postgres://postgres:${CLAIR_DB_PASSWORD}@harbor-database:5432/notaryserver?sslmode=disable | ||
- apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: harbor-clair | ||
labels: | ||
service: harbor-clair | ||
branch: ${SAFE_BRANCH} | ||
project: ${SAFE_PROJECT} | ||
type: Opaque | ||
data: | ||
config.yaml: | | ||
clair: | ||
database: | ||
type: pgsql | ||
options: | ||
source: "postgres://postgres:${CLAIR_DB_PASSWORD}@harbor-database:5432/postgres?sslmode=disable" | ||
# Number of elements kept in the cache | ||
# Values unlikely to change (e.g. namespaces) are cached in order to save prevent needless roundtrips to the database. | ||
cachesize: 16384 | ||
api: | ||
# API server port | ||
port: 6060 | ||
healthport: 6061 | ||
# Deadline before an API request will respond with a 503 | ||
timeout: 300s | ||
updater: | ||
interval: 1h | ||
notifier: | ||
attempts: 3 | ||
renotifyinterval: 2h | ||
http: | ||
endpoint: "http://harbor-core/service/notifications" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Postgres Image | ||
|
||
# Supported versions | ||
|
||
- 11.x [[Dockerfile]](https://github.com/amazeeio/lagoon/blob/master/images/postgres/Dockerfile) | ||
|
||
# Tips & Tricks | ||
If you have SQL statements that need to be ran immediately after container startup to initalize the database, you can place those `.sql` files in the container's `docker-entrypoint-initdb.d` directory. Any `.sql` files contained in that directory are ran automatically at startup, as part of bringing the Postgres container up. ***Take note that these scripts are only ran if the container is started with an empty database.*** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM goharbor/clair-photon:v2.1.0-v1.9.3 | ||
LABEL maintainer="amazee.io" | ||
|
||
COPY docker-entrypoint.sh / | ||
|
||
USER root | ||
|
||
RUN chmod -R g+w /etc/pki/tls/certs \ | ||
&& chmod +x /clair/clair \ | ||
&& chmod -R g+w /config \ | ||
&& chgrp -R root /clair \ | ||
&& chmod -R g+w /clair \ | ||
&& mkdir -p /etc/clair \ | ||
&& chmod -R g+w /etc/clair \ | ||
&& touch /etc/clair/config.yaml | ||
|
||
USER 10000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
/harbor/install_cert.sh | ||
exec "/dumb-init" "--" "/clair/clair" "-config" "/etc/clair/config.yaml" | ||
set +e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM goharbor/harbor-core:v1.9.3 | ||
LABEL maintainer="amazee.io" | ||
|
||
COPY entrypoint.sh / | ||
|
||
USER root | ||
|
||
RUN chmod +rx /entrypoint.sh | ||
|
||
USER 10000 | ||
|
||
ENTRYPOINT /entrypoint.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
# if HARBOR_NGINX_ENDPOINT is not defined, we try to load it from LAGOON_ROUTES | ||
if [[ -z ${HARBOR_NGINX_ENDPOINT+x} ]]; then | ||
REGEX="(https?://harbor[0-9A-Za-z\.-]+)" | ||
|
||
if [[ $LAGOON_ROUTES =~ $REGEX ]]; then | ||
export HARBOR_NGINX_ENDPOINT=${BASH_REMATCH[1]} | ||
else | ||
echo "Could not load harbor URL from LAGOON_ROUTES, please define via HARBOR_NGINX_ENDPOINT env variable" | ||
exit 1 | ||
fi | ||
fi | ||
|
||
export EXT_ENDPOINT=$HARBOR_NGINX_ENDPOINT | ||
|
||
exec "/harbor/harbor_core" | ||
#sudo -E -u \#10000 "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
ARG IMAGE_REPO | ||
FROM ${IMAGE_REPO:-lagoon}/postgres | ||
LABEL maintainer="amazee.io" | ||
|
||
COPY docker-entrypoint-initdb.d /docker-entrypoint-initdb.d |
4 changes: 4 additions & 0 deletions
4
images/harbor-database/docker-entrypoint-initdb.d/initial-registry.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
CREATE DATABASE registry ENCODING 'UTF8'; | ||
\c registry; | ||
|
||
CREATE TABLE schema_migrations(version bigint not null primary key, dirty boolean not null); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
FROM goharbor/harbor-jobservice:v1.9.3 | ||
LABEL maintainer="amazee.io" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM goharbor/nginx-photon:v1.9.3 | ||
LABEL maintainer="amazee.io" | ||
|
||
COPY nginx.conf /etc/nginx/nginx.conf | ||
|
||
USER root | ||
|
||
RUN chown root:root /etc/nginx/nginx.conf && chmod 744 /etc/nginx/nginx.conf && chmod -R g+r /etc/nginx | ||
|
||
USER nginx |
Oops, something went wrong.