IBM Sterling: Configurando as imagens no Registry: Difference between revisions

From Wiki
Line 73: Line 73:


  docker login -u $(oc whoami) -p $(oc whoami -t) $MY_IMG_REGISTRY
  docker login -u $(oc whoami) -p $(oc whoami -t) $MY_IMG_REGISTRY
 
   <small>WARNING! Using --password via the CLI is insecure. Use --password-stdin.
   <small>WARNING! Using --password via the CLI is insecure. Use --password-stdin.
   Login Succeeded</small>
   Login Succeeded</small>

Revision as of 14:32, 23 May 2021

Procedimento

Extrair os arquivos

tar -xvf STER_B2B_INT_CERT_CONT_V6.1_ML.tar

Serão extraídos os seguintes arquivos:

x b2bi-6.1.0.0.tar
x purge-6.1.0.0.tar
x ps-6.1.0.0.tar
x ibm-b2bi-prod-2.0.0.tgz


Configurando o OpenShift Registry

O procedimento a seguir é uma configuração única para ativar a rota de registro OpenShift interna.

1) Alterando para o projeto

oc project openshift-image-registry

2) Listando o serviço

$ oc get svc

NAME                      TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)     AGE
image-registry            ClusterIP   172.xx.1.9   <none>        5000/TCP    4h8m
image-registry-operator   ClusterIP   None         <none>        60000/TCP   4h39m

3) Reencriptando

$ oc create route reencrypt --service=image-registry

4) Listando a rota

$ oc get route image-registry

NAME             HOST/PORT      ...                                                                                                                      
image-registry   image-registry-openshift-image-registry.ebasso-roks-demo-sb2bi-...us-south.containers.appdomain.cloud      ... 

5) Agora que temos a url do nosso registry, vamos exportar uma variável

export MY_IMG_REGISTRY=image-registry-openshift-image-registry.ebasso-roks-demo-sb2bi-...us-south.containers.appdomain.cloud

Edite a rota

6) Alterando a route do image-registry

$ oc edit route image-registry

e adicione "haproxy.router.openshift.io/balance: source"

apiVersion: route.openshift.io/v1
kind: Route
metadata:
annotations:
   openshift.io/host.generated: "true"
   haproxy.router.openshift.io/balance: source

Salve e feche o arquivo (sintaxe do vim -- > :wq!). O resultado é os seguinte:

route.route.openshift.io/image-registry edited


Alterando o Projeto e configurando uma variável de ambiente

oc project sterling-b2bi-app
export MY_SB2BI_PROJECT=sterling-b2bi-app

Fazendo o Login no Docker

docker login -u $(oc whoami) -p $(oc whoami -t) $MY_IMG_REGISTRY

 WARNING! Using --password via the CLI is insecure. Use --password-stdin.
 Login Succeeded

Carregando as imagens

docker load -i b2bi-6.1.0.0.tar
docker load -i ps-6.1.0.0.tar
docker load -i purge-6.1.0.0.tar

Rotulando as imagens

docker tag b2bi:6.1.0.0 $MY_IMG_REGISTRY/$MY_SB2BI_PROJECT/b2bi:6.1.0.0
docker tag ps:6.1.0.0 $MY_IMG_REGISTRY/$MY_SB2BI_PROJECT/ps:6.1.0.0
docker tag purge:6.1.0.0 $MY_IMG_REGISTRY/$MY_SB2BI_PROJECT/purge:6.1.0.0
docker push $MY_IMG_REGISTRY/$MY_SB2BI_PROJECT/b2bi:6.1.0.0
docker push $MY_IMG_REGISTRY/$MY_SB2BI_PROJECT/ps:6.1.0.0
docker push $MY_IMG_REGISTRY/$MY_SB2BI_PROJECT/purge:6.1.0.0

See Also