ajnouri / google-certified-professional-cloud-architect Goto Github PK
View Code? Open in Web Editor NEWGoogler Cloud Platform
License: MIT License
Googler Cloud Platform
License: MIT License
gcloud container clusters create gns3-data-cluster1 --zone us-east1-d --num-nodes=1
ERROR: (gcloud.container.clusters.create) ResponseError: code=503, message=The Container Engine API is not enabled for project gns3-data. Please ensure it is enabled in the Google Cloud Console at https://console.cloud.google.com/apis/api/container.googleapis.com/overview?project=gns3-data and try again.
Looks like
- gcloud beta container images describe
- gcloud container images describe
do not exist anymore:
1- I created an image with special licence to enable nested virtualization from the existing disk:
2- Started a new instance with custom cpu (Haswel or later) on the appropriate zone that support by defautl haswell cpu's
3- Connected to the instance through SSH, the processor shows Haswell, but no vmx support !!!
docker doesn't support "docker login -e" (email) option anymore
docker login -e <email> -u oauth2accesstoken -p "$(gcloud auth print-access-token)" https://gcr.io
When tryinig to delete a cluster:
gcloud container clusters delete helloworld --zone us-east1-d
The following clusters will be deleted. - [helloworld] in [us-east1-d] Do you want to continue (Y/n)? Y
ERROR: (gcloud.container.clusters.delete) ResponseError: code=404, message=The resource "projects/linuxacademy-traininig" was not found.
For testing purposes I'am running a pod (SSHFS container: port 22) mounted to a persistent disk.
I would like to be able to connect to it from outside, I succesfully created a pod and a service lb that maps container port 22 to outside 2222, but I am unable to connect to it from outside (Internet).
Below is the steps I undertook to build and troubleshoot it.
Any hint?
$ cat sshfs-server-pod.yaml
apiVersion: v1
kind: Pod
metadata:
name: sshfsserver
spec:
containers:
- image: ajnouri/sshfs-server
name: sshfsserver
ports:
- containerPort: 22
name: sshfs
volumeMounts:
- mountPath: /data
name: gns3-persistent-data
volumes:
- name: gns3-persistent-data
gcePersistentDisk:
pdName: gns3-data-disk1
fsType: ext4
$ cat sshfs-server-service.yaml
apiVersion: v1
kind: Service
metadata:
labels:
app: sshfsserver
name: sshfsserver
spec:
type: LoadBalancer
ports:
- port: 22
targetPort: 2222
protocol: TCP
selector:
name: sshfsserver
$ kubectl get services
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes 10.51.240.1 443/TCP 1d
sshfsserver 10.51.248.10 35.196.251.4 2222:30550/TCP 25m
$ ping 35.196.251.4
PING 35.196.251.4 (35.196.251.4) 56(84) bytes of data.
64 bytes from 35.196.251.4: icmp_seq=1 ttl=42 time=89.9 ms
64 bytes from 35.196.251.4: icmp_seq=2 ttl=42 time=89.9 ms
64 bytes from 35.196.251.4: icmp_seq=3 ttl=42 time=89.8 ms
^C
--- 35.196.251.4 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 89.884/89.906/89.923/0.016 ms
Cannot connect to the container from outside (Internet host)
$ ssh [email protected] -p 2222
$ ssh [email protected] -p 22
$ ssh [email protected] -p 30550
Even though I could verify that the container is running the sshd process and port 22 is opened and I could SSH to connect to the container from the cluster pod:
$ kubectl get pods -o wide
NAME READY STATUS RESTARTS AGE IP NODE
sshfsserver 1/1 Running 0 20h 10.48.0.10 gke-gns3-data-cluster1-default-pool-8754d417-s9tz
user@gke-gns3-data-cluster1-default-pool-8754d417-s9tz ~ $ docker exec aee37c04226a ps -aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.2 29336 10976 ? Ss 02:39 0:00 /usr/bin/python3 -u /sbin/my_init
root 7 0.0 0.0 196 40 ? S 02:39 0:00 /usr/bin/runsvdir -P /etc/service
root 8 0.0 0.0 176 4 ? Ss 02:39 0:00 runsv cron
root 9 0.0 0.0 176 4 ? Ss 02:39 0:00 runsv syslog-ng
root 10 0.0 0.0 176 4 ? Ss 02:39 0:00 runsv sshd
root 11 0.0 0.0 176 4 ? Ss 02:39 0:00 runsv syslog-forwarder
root 12 0.0 0.0 7484 1852 ? S 02:39 0:04 tail -f -n 0 /var/log/syslog
root 13 0.0 0.1 61372 5420 ? S 02:39 0:00 /usr/sbin/sshd -D
root 14 0.0 0.1 65756 6796 ? S 02:39 0:00 syslog-ng -F -p /var/run/syslog-ng.pid --no-caps
root 15 0.0 0.0 18324 1820 ? S 02:39 0:00 /usr/sbin/cron -f
root 24 0.0 0.0 15576 2084 ? Rs 22:49 0:00 ps -aux
user@gke-gns3-data-cluster1-default-pool-8754d417-s9tz ~ $ docker exec aee37c04226a ip a s eth0@if13
3: eth0@if13: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1460 qdisc noqueue state UP group
default
link/ether 0a:58:0a:30:00:0a brd ff:ff:ff:ff:ff:ff
inet 10.48.0.10/24 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::4c5f:3fff:fe65:890d/64 scope link
valid_lft forever preferred_lft forever
user@gke-gns3-data-cluster1-default-pool-8754d417-s9tz ~ $ ssh [email protected]
Warning: Permanently added '10.48.0.10' (ECDSA) to the list of known hosts.
[email protected]'s password:
root@sshfsserver:~#
Each time I install a new SDK node, it doesn't recognize the path "/usr/lib/google-cloud-sdk/bin" to (kubectl, ...)
I have to add it manually to PATH.
It even asks me after component update (gcloud components update), to remove the "old" path "/usr/lib/google-cloud-sdk/bin":
# gcloud container clusters create ...
Creating cluster cluster1...done.
Created [https://container.googleapis.com/v1/projects/gns3-data/zones/us-east1-d/clusters/cluster1].
kubeconfig entry generated for cluster1.
NAME ZONE MASTER_VERSION MASTER_IP MACHINE_TYPE NODE_VERSION NUM_NODES STATUS
cluster1 us-east1-d 1.6.7 X.X.X.X n1-standard-1 1.6.7 1 RUNNINGUpdates are available for some Cloud SDK components. To install them,
please run:
$ gcloud components update
Run gcloud update:
# gcloud components update
...
Update done!
...
Updates are available for some Cloud SDK components. To install them,
please run:
...
WARNING: There are older versions of Google Cloud Platform tools on your system PATH.
Please remove the following to avoid accidentally invoking these old tools:/usr/lib/google-cloud-sdk/bin/dev_appserver.py
/usr/lib/google-cloud-sdk/bin/docker-credential-gcloud
/usr/lib/google-cloud-sdk/bin/git-credential-gcloud.sh
/usr/lib/google-cloud-sdk/bin/bq
/usr/lib/google-cloud-sdk/bin/gcloud
/usr/lib/google-cloud-sdk/bin/gsutil
/usr/lib/google-cloud-sdk/bin/endpointscfg.py
Knowing that, after update these commands are nowhere but in "/usr/lib/google-cloud-sdk/bin/kubectl"
find / -name 'kubectl'
/usr/lib/google-cloud-sdk/bin/kubectl
# lsb_release -a
Distributor ID: Ubuntu
Description: Ubuntu 14.04.5 LTS
Release: 14.04
Codename: trusty
# gcloud --version
Google Cloud SDK 167.0.0
beta 2017.03.24
bq 2.0.25
core 2017.08.11
gcloud
gsutil 4.27
Each time I install a new SDK node, it doesn't recognize the path "/usr/lib/google-cloud-sdk/bin" to (kubectl, ...)
I have to add it manually to PATH.
It even asks me after component update (gcloud components update), to remove the "old" path "/usr/lib/google-cloud-sdk/bin":
# gcloud container clusters create ...
Creating cluster cluster1...done.
Created [https://container.googleapis.com/v1/projects/gns3-data/zones/us-east1-d/clusters/cluster1].
kubeconfig entry generated for cluster1.
NAME ZONE MASTER_VERSION MASTER_IP MACHINE_TYPE NODE_VERSION NUM_NODES STATUS
cluster1 us-east1-d 1.6.7 X.X.X.X n1-standard-1 1.6.7 1 RUNNINGUpdates are available for some Cloud SDK components. To install them,
please run:
$ gcloud components update
Run gcloud update:
# gcloud components update
...
Update done!
...
Updates are available for some Cloud SDK components. To install them,
please run:
...
WARNING: There are older versions of Google Cloud Platform tools on your system PATH.
Please remove the following to avoid accidentally invoking these old tools:/usr/lib/google-cloud-sdk/bin/dev_appserver.py
/usr/lib/google-cloud-sdk/bin/docker-credential-gcloud
/usr/lib/google-cloud-sdk/bin/git-credential-gcloud.sh
/usr/lib/google-cloud-sdk/bin/bq
/usr/lib/google-cloud-sdk/bin/gcloud
/usr/lib/google-cloud-sdk/bin/gsutil
/usr/lib/google-cloud-sdk/bin/endpointscfg.py
Knowing that, after update these commands are nowhere but in "/usr/lib/google-cloud-sdk/bin/kubectl"
find / -name 'kubectl'
/usr/lib/google-cloud-sdk/bin/kubectl
# lsb_release -a
Distributor ID: Ubuntu
Description: Ubuntu 14.04.5 LTS
Release: 14.04
Codename: trusty
# gcloud --version
Google Cloud SDK 167.0.0
beta 2017.03.24
bq 2.0.25
core 2017.08.11
gcloud
gsutil 4.27
ERROR: (gcloud.components.install) The component manager is disabled for this installation
kubectl create -f sshfs-server-pod.yaml
The connection to the server localhost:8080 was refused - did you specify the right host or port?
With a container cluster already created
gcloud container clusters list
error: failed to discover supported resources: Get http://localhost:8080/api: dial tcp [::1]:8080: getsockopt: connection refused
How to roubleshoot a pod successfully created, but container doesn't start?
kubectl create -f sshfs-server-pod.yaml
pod "sshfsserver" created
# kubectl get pods
NAME READY STATUS RESTARTS AGE
sshfsserver 0/1 ContainerCreating 0 24s
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.