IBM Sterling: Configurando as imagens no Registry

From Wiki

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


Carregando as imagens

1) Alterando o Projeto e configurando uma variável de ambiente

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

2) 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

3) 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

4) 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

5) Push das imagens

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

Validando o resultado

oc get imagestream

NAME    IMAGE REPOSITORY                                                           TAGS      UPDATED
b2bi    image-registry.openshift-image-registry.svc:5000/sterling-b2bi-app/b2bi    6.1.0.0   4 minutes ago
ps      image-registry.openshift-image-registry.svc:5000/sterling-b2bi-app/ps      6.1.0.0   About a minute ago
purge   image-registry.openshift-image-registry.svc:5000/sterling-b2bi-app/purge   6.1.0.0   45 seconds ago

See Also