Skip to main content

Push image to Docker https registry

 Setup remote https registry

docker container stop registry
docker container rm -v registry
ls /var/lib/
cd
mkdir certs
cd certs
openssl req   -newkey rsa:4096 -nodes -sha256 -keyout certs/domain.key   -addext "subjectAltName = DNS:myregistry.jankester.com"   -x509 -days 365 -out certs/domain.crt
cd ..
openssl req   -newkey rsa:4096 -nodes -sha256 -keyout certs/domain.key   -addext "subjectAltName = DNS:myregistry.jankester.com"   -x509 -days 365 -out certs/domain.crt
ls -ltr
ls
cd certificate_authority
history | grep import
ls -ltr ../
ls -ltr ../certs
cd
docker run -d   --restart=always   --name registry   -v "$(pwd)"/certs:/certs   -e REGISTRY_HTTP_ADDR=0.0.0.0:5443   -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt   -e REGISTRY_HTTP_TLS_KEY=/certs/domain.key   -p 5443:5443   registry:2
docker container ls
history | grep allow
sudo ufw allow 5443
docker images ls
curl -X GET http://localhost:5000/v2/_catalogs
curl -X GET https://localhost:443/v2/_catalogs
curl -X GET https://localhost:5443/v2/_catalogs
curl -X GET -k https://localhost:5443/v2/_catalogs
ping myregistry.jankester.com



Push image

docker pull hello-world
docker tag hello-world:latest myregistry.jankester.com:5443/my-hello-world
docker push myregistry.jankester.com:5443/my-hello-world
curl -X GET -k https://localhost:5443/v2/_catalog
ls
cd source
ls
cd microservices-in-dotnet-book-second-edition/
ls
cd Chapter03/
ls -lt
vi shopping-cart-local.yaml
history | grep apply
kubectl apply -f shopping-cart-local.yaml
kubectl get all
kubectl delete all
kubectl get all
kubectl delete pod/shopping-cart-7dbc5f55b-vv2wv pod/shopping-cart-d6c9bd467-wr5xz service/kubernetes service/shopping-cart deployment.apps/shopping-cart replicaset.apps/shopping-cart-7dbc5f55b replicaset.apps/shopping-cart-d6c9bd467
kubectl get all
kubectl apply -f shopping-cart-local.yaml
kubectl get all
ls
cat shopping-cart-local.yaml
ls -ltr
vi shopping-cart.yaml
vi shopping-cart-local.yaml
kubectl get all
sudo apt-get base64
sudo apt-get install base64
wget localhost:8080
wget localhost:8080/shopping-cart/123
wget localhost:8080/shoppingcart/123
man wget
wget -O - localhost:8080/shoppingcart/123
wget -O localhost:8080/shoppingcart/123
wget -o localhost:8080/shoppingcart/123
curl localhost:8080/shoppingcart/123
curl -X POST http://localhost:8080/shoppingcart/123/items -H "Content-Type: application/json" -d '[1,2]'
curl localhost:8080/shoppingcart/123
kubectl -n kube-system describe secret default
kubectl get all
cd source/microservices-in-dotnet-book-second-edition/Chapter03/
vi shopping-cart-local.yaml
ls -ltr
kubectl apply -f shopping-cart-local.yaml
ping www.jankester.com
vi shopping-cart-local.yaml
kubectl apply -f shopping-cart-local.yaml
kubectl get all
wget localhost:5001
wget 192.55.14.78:5001
wget 192.55.14.78:5001/shoppingcart/123
netstat -an | grep -w LISTEN
wget http://192.55.14.78:5001/shoppingcart/123
vi shopping-cart-local.yaml
kubectl apply -f shopping-cart-local.yaml
vi shopping-cart-local.yaml
cat shopping-cart-local.yaml
kubectl port-forward shopping-cart 80:8080
kubectl get all
kubectl port-forward pod/shopping-cart-d6c9bd467-2qxmf 80:8080
kubectl port-forward pod/shopping-cart-d6c9bd467-2qxmf 8080:80
ls -ltr
cd certificate_authority
ls
ls pki/
ls pki/private/
cd
cd cert
cd certs/
ls
cat domain.crt
sudo cp domain.crt /usr/local/share/ca-certificates/domain.crt
sudo update-ca-certficates
sudo update-ca-certificates
microk8s stop
microk8s start
kubectl get all
kubectl delete pod/shopping-cart-d6c9bd467-lnqp7
history | grep mic
cd source/microservices-in-dotnet-book-second-edition/Chapter03/
ls
kubectl apply -f shopping-cart-local.yaml
kubectl get all

 


Test kubectl

wget http://localhost:5001/v2/search?
curl -X GET -k https://localhost:5443/v2/_catalog
history | grep curl
curl -X POST http://localhost:5000/shoppingcart/123/items -H "Content-Type: application/json" -d '[5,15,29]'
curl -X POST http://localhost:5001/shoppingcart/123/items -H "Content-Type: application/json" -d '[5,15,29]'
kubectl get all
cat shopping-cart-local.yaml
view shopping-cart-local.yaml
netstat -an | grep -w LISTEN
kubectl get all
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.2.0/aio/deploy/recommended.yaml
kubectl proxy
microk8s stop


Comments

Popular posts from this blog

SSL handshake failed: Secure connection truncated

Got this problem on Ubuntu 9.10 and 10.10. svn co --username=xx https:/yy zz “SSL handshake failed: Secure connection truncated” According to this link bug-ubuntu The solution is: sudo apt-get install libneon27 cd /usr/lib/ sudo rm libneon-gnutls.so.27 sudo ln -s /usr/lib/libneon.so.27 libneon-gnutls.so.27

Junit4 running parallel junit classes

To run junit testcases parallel, you can create your own class to run junit with: Add this tag to your class declaration. @RunWith(Parallelized.class) Implementation of this class looks like: package mypackage; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import org.junit.runners.Parameterized; import org.junit.runners.model.RunnerScheduler; public class Parallelized extends Parameterized {         private static class ThreadPoolScheduler implements RunnerScheduler     {         private ExecutorService executor;                 public ThreadPoolScheduler()         {             String threads = System.getProperty("junit.parallel.threads", "16");    ...

Interactive selenium testing

The problem Location of elements When I started using selenium, I noticed that it is not easy to do it right. First you start with IDE, but you notice, that the IDE does not really record a lot. In a next step I added firebug, and started analyzing how the elements where to be located: either by tag, id, class etc. Junit testcase With this information I could then create my junit testcase: @Test public void testMapView() throws Exception { //assert that we cannot see submenu of MapCreator elem = driver.findElement(By.className(SeleniumConstants.MAP_SUB_MENU)); String style = elem.getAttribute("style"); assertTrue("Element must have style display off.",style.matches("display: none.*")); logger.debug("Located element " + SeleniumConstants.MAP_SUB_MENU); //find menu and click on mapview elem = driver.findElement(By.id(SeleniumConstants.MAP_CONTROL)); actions.moveToElement(elem).click().perform(); //assert su...