-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Protected harbor with sealed secrets.
- Loading branch information
Showing
7 changed files
with
64 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Harbor `Application` | ||
|
||
The deployment of `harbor` relies mostly upon the harbor helm chart. | ||
|
||
## Admin Credentials Sealed Secret | ||
|
||
The harbor admin credentials are provided via a `Secret` that is maintained securely in git as a `SealedSecret`. | ||
|
||
This `SealedSecret` is defined as an element with the `parts/`, and is generated via the script `ss-harbor-auth.sh` via the `sealed-secrets-controller` that is running in the live cluster. | ||
|
||
The `<rootUser>` and `<rootPassword>` are supplied as positional cmdline arguments (with built-in defaults). |
File renamed without changes.
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,3 @@ | ||
|
||
resources: | ||
- app-harbor.yaml |
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,3 @@ | ||
|
||
resources: | ||
- ss-harbor-auth.yaml |
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,15 @@ | ||
apiVersion: bitnami.com/v1alpha1 | ||
kind: SealedSecret | ||
metadata: | ||
creationTimestamp: null | ||
name: harbor-auth | ||
namespace: infra | ||
spec: | ||
encryptedData: | ||
rootPassword: AgCtSw9RdovqoEc2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zLrUZwh/koO3I/awSF4b4bLGQTRHAUZ5D6eJx4Iml4wM9gT8RnA6yoJpPhcgtblO/Ky22EZWXREK2SHmtaTDakOErfQRL/j3CSjoVipfOuxFEY0yhGVipQLnLjVivzlcFI3c5cb0LGMWAgbL5RwPeKGKEYWywizhskxPJeZsR6GNDQaM/mEmIKMYSeP6Bt1uoCVMVyqoBQGZ7/im6Ojcas6R6Rt1NNOR01+YuxZhX1sYDalg90xwwtLNrUK7zWJugvyeQMNn4FeJYtQa6ztrLk6GOdprEjQ6flU75umPtvnS028HPJoN/r1DtuvZnvhfuqvuI/EvV1vTFNZwxbeoT3fpewE3k4FuzloM= | ||
template: | ||
metadata: | ||
creationTimestamp: null | ||
name: harbor-auth | ||
namespace: infra |
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,30 @@ | ||
#!/usr/bin/env bash | ||
|
||
ORIG_DIR="$(pwd)" | ||
cd "$(dirname "$0")" | ||
BIN_DIR="$(pwd)" | ||
|
||
onExit() { | ||
cd "${ORIG_DIR}" | ||
} | ||
trap onExit EXIT | ||
|
||
# Optional local .env file for secret values as env vars | ||
source .env 2>/dev/null | ||
|
||
SECRET_NAME="harbor-auth" | ||
NAMESPACE="infra" | ||
|
||
ROOT_USER="${1:-${ROOT_USER:-admin}}" | ||
ROOT_PASSWORD="${2:-${ROOT_PASSWORD:-changeme}}" | ||
|
||
secretYaml() { | ||
kubectl -n "${NAMESPACE}" create secret generic "${SECRET_NAME}" \ | ||
--from-literal="rootUser=${ROOT_USER}" \ | ||
--from-literal="rootPassword=${ROOT_PASSWORD}" \ | ||
--dry-run=client -o yaml | ||
} | ||
|
||
# Create Secret and then pipe to kubeseal to create the SealedSecret | ||
secretYaml \ | ||
| kubeseal -o yaml --controller-name sealed-secrets --controller-namespace infra > parts/ss-${SECRET_NAME}.yaml |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
|
||
resources: | ||
- app-sealed-secrets.yaml | ||
- minio | ||
- app-harbor.yaml | ||
- cert-manager | ||
- harbor | ||
- minio |