From dd83a88a8385595558e7710c0e5631893d80cc0b Mon Sep 17 00:00:00 2001 From: shokakucarrier Date: Tue, 7 Mar 2023 13:58:33 +0800 Subject: [PATCH] add Readme doc and modify template to be more intuitive --- BuildConfig.yaml | 22 ++++++++++++++++++++++ Readme.md | 18 ++++++++++++++++++ template/template-sidecar.yaml | 8 +++++--- 3 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 BuildConfig.yaml create mode 100644 Readme.md diff --git a/BuildConfig.yaml b/BuildConfig.yaml new file mode 100644 index 0000000..dcb2b12 --- /dev/null +++ b/BuildConfig.yaml @@ -0,0 +1,22 @@ +kind: BuildConfig +apiVersion: build.openshift.io/v1 +metadata: + name: indy-sidecar-init-build +spec: + nodeSelector: null + output: + to: + kind: DockerImage + name: 'quay.io/example/indy-sidecar-init:latest' + pushSecret: + name: example + strategy: + type: Docker + dockerStrategy: + noCache: true + source: + type: Git + git: + uri: 'https://github.com/Commonjava/indy-sidecar-init.git' + ref: master + runPolicy: Serial diff --git a/Readme.md b/Readme.md new file mode 100644 index 0000000..9b33fee --- /dev/null +++ b/Readme.md @@ -0,0 +1,18 @@ +# Indy sidecar init +**Deployment** + +The sidecar init container is meant to be init-container part of builder and sidecar pod, provides sidecar with initial repos downloaded from archive service. + +1. Make sure you have right application.yaml from [indy-sidecar](https://github.com/commonjava/indy-sidecar) container, you must set `sidecar.archive-api` and `sidecar.local-repository` for this to work. + +2. mount the same application.yaml across this sidecar-init container as well as the sidecar container. + +3. Add init-container part to the pod deploymentconfig and mount preSeedRepo volume as the sidecar does (or whatever defined it in application.yaml config file) + +Template of the deployment can be found in template/template-sidecar.yaml + +--- + +**Build container image** + +Use Dockerfile or BuildConfig.yaml(for Openshift) to build the container \ No newline at end of file diff --git a/template/template-sidecar.yaml b/template/template-sidecar.yaml index b67febe..7b1ca63 100644 --- a/template/template-sidecar.yaml +++ b/template/template-sidecar.yaml @@ -6,8 +6,9 @@ metadata: spec: initContainers: - name : sidecar-init - image: quay.io/kaine/indy-sidecar-init:latest + image: quay.io/factory2/indy-sidecar-init:latest volumeMounts: + # Same as the sidecar container has - mountPath: /deployments/config/application.yaml readOnly: true name: sidecar-config @@ -21,13 +22,14 @@ spec: - "sidecar-init" containers: - name: sidecar - image: quay.io/kaine/indy-sidecar:latest + image: quay.io/factory2/indy-sidecar:latest imagePullPolicy: Always volumeMounts: - mountPath: /deployments/config/proxy.yaml readOnly: true name: sidecar-config subPath: proxy.yaml + # Same as the sidecar-init container has - mountPath: /deployments/config/application.yaml readOnly: true name: sidecar-config @@ -46,7 +48,7 @@ spec: limits: cpu: "1" memory: "2Gi" - - name: jnlp + - name: builder image: quay.io/factory2/jenkins-agent:maven-36-rhel7-latest imagePullPolicy: Always tty: true