issue: For one of the automation task for vmware vidm get attribute api, for admin user the code was failing. It was giving error message “User is not authorized to perform the task”
Steps: After creating the Remote App Access client, generate an OAuth bearer token.
Problem statement: In multi node docker environment, make private registry as default registry
Environment detail: Oracle virtual box has two centos 7 instance installed.
- node 1: docker and docker registry setup
yum install docker*
enable the docker service and start it:
systemctl enable docker
systemctl start docker
running a registry in container form:
docker run -d -p 5000:5000 --restart=always --name registry registry:2
push any local image to local registry [below is the example to setup image from docker.io to private registry]
docker pull ubuntu:16.04 /*it will pull from docker.io*/
docker tag ubuntu:16.04 localhost:5000/my-ubuntu
docker push localhost:5000/my-ubuntu
docker image remove ubuntu:16.04
docker image remove localhost:5000/my-ubuntu
- node 2: only docker installed
yum install docker*
Note: we will pull local image from node1
Steps to make private registry default registry and accessible remotely
Stop docker service : systemclt stop docker
- Check docker info command: docker info /* check for registry and insecure registry)
- Add entry in /etc/sysconfig/docker file on all the node(node1 and node 2 in this case)
vi /etc/sysconfig/docker
ADD_REGISTRY='--add-registry 192.168.0.108:5000'
- Add entry in /etc/docker/daemon.json
vi /etc/docker/daemon.json
{
"insecure-registries" : [ "192.168.0.108:5000" ]
}
- start the docker service
systemctl start docker
check the docker info command
docker info
Registry: https://192.168.0.108:5000/v1/
Experimental: false
Insecure Registries:
192.168.0.108:5000
127.0.0.0/8
from node 2 pull the image
docker pull my-ubuntu
[root@target-2 /]# docker pull my-ubuntu
Using default tag: latest
Trying to pull repository 192.168.0.108:5000/my-ubuntu ...
latest: Pulling from 192.168.0.108:5000/my-ubuntu
7b378fa0f908: Pull complete
4d77b1b29f2e: Pull complete
7c793be88bae: Pull complete
ecc05c8a19c0: Pull complete
Step 1: login to docker from command line: “docker login”. It will prompt for username and password. Provide that, it will create on json file “~/.docker/config.json”
Output of json : cat ~/.docer/config.json
We will use that json file and create the secret
kubectl create secret generic regcred \
--from-file=.dockerconfigjson=<path/to/.docker/config.json> \
--type=kubernetes.io/dockerconfigjson
once it create the secret, we can just check the output
kubectl get secret regcred -o yaml
If you created a private registry, and want to pull the image in k8s deployment. So how to use username/password for registry in k8s deployment or pod.
It would be great to use secret, Documented in k8s as well
This blog we will talk about vsphere development center. This is for vsphere admin, those who want to automate day to day task, they can make use of it. Development center is integrated with vSphere, and it has record facility. Whenever we start activity, we have to start recording. Development center convert into the code.
vSphere 7 it provides to convert the task in the following: PowerCli, vRO Javascript, python and go
vSphere 6.7 it was having the option to convert the code for powercli only.
As you can see in below screenshot, we need to enable code capture and start recording. Then start capturing using development center.
I have started code capturing using powercli and created datacenter called test.
This blog I will be sharing the screenshots, once we sign-up the google cloud platform. We get the option go to the console. Once we go to console we get the below screen
On the console screen we get lot of option, As we need to start we need to create a project.
We have created one project, “ow-project”. As we are just starting, its good to go in “getting started option” of the panel.
This getting started option has option regarding compute,storage,billing,api etc.
We need to enable billing, provide your credit card info to create vm instances, I will me covering vm instances in next part