IBM Sterling: Configurando as imagens no Registry: Difference between revisions
No edit summary |
|||
Line 15: | Line 15: | ||
== Configurando o OpenShift Registry== | == 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 | |||
<small>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</small> | |||
apiVersion: route.openshift.io/v1 | 3) Reencriptando | ||
kind: Route | |||
metadata: | $ oc create route reencrypt --service=image-registry | ||
annotations: | |||
4) Listando a rota | |||
$ oc get route image-registry | |||
<small>NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD | |||
image-registry image-registry-openshift-image-registry.ebasso-roks-demo-sb2bi-...us-south.containers.appdomain.cloud image-registry 5000-tcp reencrypt None</small> | |||
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" | openshift.io/host.generated: "true" | ||
haproxy.router.openshift.io/balance: source | '''haproxy.router.openshift.io/balance: source''' | ||
Salve e feche o arquivo (sintaxe do vim -- > ''':wq!'''). O resultado é os seguinte: | |||
<small>route.route.openshift.io/image-registry edited</small> | |||
oc new-project sterling-b2bi-app | oc new-project sterling-b2bi-app | ||
docker login -u $(oc whoami) -p $(oc whoami -t) | export $MY_SB2BI_PROJECT=sterling-b2bi-app | ||
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> | ||
Line 56: | Line 81: | ||
Rotulando as imagens | Rotulando as imagens | ||
docker tag b2bi:6.1.0.0 | 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 | 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 | 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 = | = See Also = |
Revision as of 14:22, 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 PATH SERVICES PORT TERMINATION WILDCARD image-registry image-registry-openshift-image-registry.ebasso-roks-demo-sb2bi-...us-south.containers.appdomain.cloud image-registry 5000-tcp reencrypt None
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
oc new-project sterling-b2bi-app
export $MY_SB2BI_PROJECT=sterling-b2bi-app
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