This is an automated email from the ASF dual-hosted git repository.
squakez pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git
The following commit(s) were added to refs/heads/main by this push:
new d2d6a7c47 feat(ci): use secure registry
d2d6a7c47 is described below
commit d2d6a7c470c55dabdda528e62f049003840f7ee0
Author: Pasquale Congiusti <[email protected]>
AuthorDate: Fri Sep 18 08:48:23 2026 +0200
feat(ci): use secure registry
Closes #6757
---
.github/actions/registry-setting/action.yml | 4 +++-
.github/actions/registry-setting/registry.yaml | 16 ++++++++++++++++
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/.github/actions/registry-setting/action.yml
b/.github/actions/registry-setting/action.yml
index 4453ef12b..b0a6cade9 100644
--- a/.github/actions/registry-setting/action.yml
+++ b/.github/actions/registry-setting/action.yml
@@ -27,6 +27,9 @@ runs:
shell: bash
run: |
kubectl create ns registry
+ # Create a self-signed certificate
+ openssl req -x509 -newkey rsa:2048 -nodes -keyout registry.key -out
registry.crt -days 7 -subj "/CN=registry"
+ kubectl create secret tls registry-tls --cert=registry.crt
--key=registry.key -n registry
kubectl apply -f .github/actions/registry-setting/registry.yaml -n
registry
kubectl wait --for=condition=available deployment/registry -n registry
--timeout=60s
KAMEL_INSTALL_REGISTRY="$(kubectl -n registry get service registry -o
jsonpath='{.spec.clusterIP}')"
@@ -39,7 +42,6 @@ runs:
-n camel-k
kubectl create configmap camel-k-operator-configmap-configuration \
--from-literal=REGISTRY_ADDRESS="$KAMEL_INSTALL_REGISTRY" \
- --from-literal=REGISTRY_INSECURE="true" \
--from-literal=REGISTRY_SECRET="my-registry" \
--from-literal=MAVEN_REPOSITORIES_ALLOWED="https://maven.repository.redhat.com/ga@id=redhat"
\
-n camel-k
diff --git a/.github/actions/registry-setting/registry.yaml
b/.github/actions/registry-setting/registry.yaml
index 257f0b510..f8a1ba5bd 100644
--- a/.github/actions/registry-setting/registry.yaml
+++ b/.github/actions/registry-setting/registry.yaml
@@ -61,8 +61,16 @@ spec:
- name: registry
image: registry:3
env:
+ - name: REGISTRY_HTTP_ADDR
+ value: 0.0.0.0:443
+ - name: REGISTRY_HTTP_TLS_CERTIFICATE
+ value: /certs/tls.crt
+ - name: REGISTRY_HTTP_TLS_KEY
+ value: /certs/tls.key
- name: REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY
value: /registry-data
+ # Required to include a secret credential
+ # We can skip them in case we want an open access
- name: REGISTRY_AUTH
value: htpasswd
- name: REGISTRY_AUTH_HTPASSWD_REALM
@@ -72,12 +80,17 @@ spec:
ports:
- containerPort: 5000
name: registry
+ - containerPort: 443
+ name: https
volumeMounts:
- name: registry-data
mountPath: /registry-data
- name: registry-auth
mountPath: /auth
readOnly: true
+ - name: registry-tls
+ mountPath: /certs
+ readOnly: true
resources:
requests:
cpu: "100m"
@@ -91,3 +104,6 @@ spec:
- name: registry-auth
secret:
secretName: registry-auth
+ - name: registry-tls
+ secret:
+ secretName: registry-tls