Google Containers Engine(GKE)

https://cloud.google.com/container-engine/docs/

https://cloud.google.com/container-engine/docs/quickstart

https://cloud.google.com/sdk/docs/quickstarts

https://cloud.google.com/sdk/docs/quickstart-debian-ubuntu

########################################################
# Create an environment variable for the correct distribution
export CLOUD_SDK_REPO=”cloud-sdk-$(lsb_release -c -s)”

# Add the Cloud SDK distribution URI as a package source
echo “deb http://packages.cloud.google.com/apt $CLOUD_SDK_REPO main” | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list

# Import the Google Cloud Platform public key
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add –

# Update the package list and install the Cloud SDK
sudo apt-get update && sudo apt-get install google-cloud-sdk
##########################################################
mohammedrafi@NOC-RAFI:~$ export CLOUD_SDK_REPO=”cloud-sdk-$(lsb_release -c -s)”

mohammedrafi@NOC-RAFI:~$ echo “deb http://packages.cloud.google.com/apt $CLOUD_SDK_REPO main” | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
deb http://packages.cloud.google.com/apt cloud-sdk-trusty main

mohammedrafi@NOC-RAFI:~$ curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add –
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 663 100 663 0 0 707 0 –:–:– –:–:– –:–:– 706
OK

mohammedrafi@NOC-RAFI:~$ sudo apt-get update && sudo apt-get install google-cloud-sdk

mohammedrafi@NOC-RAFI:~$ gcloud init
Welcome! This command will take you through the configuration of gcloud.

Your current configuration has been set to: [default]

You can skip diagnostics next time by using the following flag:
gcloud init –skip-diagnostics

Network diagnostic detects and fixes local network connection issues.
Checking network connection…done.
Reachability Check passed.
Network diagnostic (1/1 checks) passed.

You must log in to continue. Would you like to log in (Y/n)? y

Your browser has been opened to visit:

https://accounts.google.com/o/oauth2/auth?redirect_uri=http%3A%2F%2Flocalhost%3A8085%2F&prompt=select_account&response_type=code&client_id=32555940559.apps.googleusercontent.com&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloud-platform+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fappengine.admin+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcompute+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Faccounts.reauth&access_type=offline

gcloud1gcloud1

 

Created new window in existing browser session.
You are logged in as: [mshaikdevops@gmail.com].

Pick cloud project to use:
[1] rising-artifact-164906
[2] Create a new project
Please enter numeric choice or text value (must exactly match list
item): 1

Your current project has been set to: [rising-artifact-164906].

Do you want to configure Google Compute Engine
(https://cloud.google.com/compute) settings (Y/n)? y

Which Google Compute Engine zone would you like to use as project
default?
If you do not specify a zone via a command line flag while working
with Compute Engine resources, the default is assumed.
[1] asia-east1-b
[2] asia-east1-a
[3] asia-east1-c
[4] asia-northeast1-c
[5] asia-northeast1-a
[6] asia-northeast1-b
[7] asia-southeast1-a
[8] asia-southeast1-b
[9] europe-west1-b
[10] europe-west1-c
[11] europe-west1-d
[12] us-central1-c
[13] us-central1-f
[14] us-central1-b
[15] us-central1-a
[16] us-east1-d
[17] us-east1-c
[18] us-east1-b
[19] us-east4-b
[20] us-east4-a
[21] us-east4-c
[22] us-west1-a
[23] us-west1-b
[24] Do not set default zone
Please enter numeric choice or text value (must exactly match list
item): 1

Your project default Compute Engine zone has been set to [asia-east1-b].
You can change it by running [gcloud config set compute/zone NAME].

Your project default Compute Engine region has been set to [asia-east1].
You can change it by running [gcloud config set compute/region NAME].

Created a default .boto configuration file at [/home/mohammedrafi/.boto]. See this file and
[https://cloud.google.com/storage/docs/gsutil/commands/config] for more
information about configuring Google Cloud Storage.
Your Google Cloud SDK is configured and ready to use!

* Commands that require authentication will use mshaikdevops@gmail.com by default
* Commands will reference project `rising-artifact-164906` by default
* Compute Engine commands will use region `asia-east1` by default
* Compute Engine commands will use zone `asia-east1-b` by default

Run `gcloud help config` to learn how to change individual settings

This gcloud configuration is called [default]. You can create additional configurations if you work with multiple accounts and/or projects.
Run `gcloud topic configurations` to learn more.

Some things to try next:

* Run `gcloud –help` to see the Cloud Platform services you can interact with. And run `gcloud help COMMAND` to get help on any gcloud command.
* Run `gcloud topic -h` to learn about advanced features of the SDK like arg files and output formatting

mohammedrafi@NOC-RAFI:~$ gcloud auth list
Credentialed Accounts:
– mshaikdevops@gmail.com ACTIVE
To set the active account, run:
$ gcloud config set account `ACCOUNT`

mohammedrafi@NOC-RAFI:~$ gcloud config list
[compute]
region = asia-east1
zone = asia-east1-b
[core]
account = mshaikdevops@gmail.com
disable_usage_reporting = True
project = rising-artifact-164906

Your active configuration is: [default]

mohammedrafi@NOC-RAFI:~$ gcloud info
Google Cloud SDK [155.0.0]

Platform: [Linux, x86_64] (‘Linux’, ‘NOC-RAFI’, ‘4.4.0-75-generic’, ‘#96~14.04.1-Ubuntu SMP Thu Apr 20 11:06:30 UTC 2017’, ‘x86_64’, ‘x86_64’)
Python Version: [2.7.6 (default, Oct 26 2016, 20:30:19) [GCC 4.8.4]]
Python Location: [/usr/bin/python2]
Site Packages: [Disabled]

Installation Root: [/usr/lib/google-cloud-sdk]
Installed Components:
core: [2017.05.10]
gcloud: []
beta: [2017.05.10]
gsutil: [4.26]
bq: [2.0.24]
alpha: [2017.05.10]
System PATH: [/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games]
Python PATH: [/usr/bin/../lib/google-cloud-sdk/lib/third_party:/usr/lib/google-cloud-sdk/lib:/usr/lib/python2.7/:/usr/lib/python2.7/plat-x86_64-linux-gnu:/usr/lib/python2.7/lib-tk:/usr/lib/python2.7/lib-old:/usr/lib/python2.7/lib-dynload]
Cloud SDK on PATH: [False]
Kubectl on PATH: [False]

Installation Properties: [/usr/lib/google-cloud-sdk/properties]
User Config Directory: [/home/mohammedrafi/.config/gcloud]
Active Configuration Name: [default]
Active Configuration Path: [/home/mohammedrafi/.config/gcloud/configurations/config_default]

Account: [mshaikdevops@gmail.com]
Project: [rising-artifact-164906]

Current Properties:
[core]
project: [rising-artifact-164906]
account: [mshaikdevops@gmail.com]
disable_usage_reporting: [True]
[compute]
region: [asia-east1]
zone: [asia-east1-b]

Logs Directory: [/home/mohammedrafi/.config/gcloud/logs]
Last Log File: [/home/mohammedrafi/.config/gcloud/logs/2017.05.19/18.55.27.736722.log]

mohammedrafi@NOC-RAFI:~$ gcloud components install kubectl
You cannot perform this action because this Cloud SDK installation is
managed by an external package manager. If you would like to get the
latest version, please see our main download page at:

https://cloud.google.com/sdk/

ERROR: (gcloud.components.install) The component manager is disabled for this installation

mohammedrafi@NOC-RAFI:~$ cat vim /usr/lib/google-cloud-sdk/lib/googlecloudsdk/core/config.json
{
“config_suffix”: “”,
“disable_updater”: true,
“disable_usage_reporting”: false,
“documentation_url”: “https://cloud.google.com/sdk/”,
“release_channel”: “rapid”,
“release_notes_url”: “https://cloud.google.com/sdk/release_notes”,
“revision”: 20170510080748,
“snapshot_schema_version”: 3,
“snapshot_url”: “https://dl.google.com/dl/cloudsdk/channels/rapid/components-2.json”,
“user_agent”: “google-cloud-sdk”,
“version”: “155.0.0”
}

mohammedrafi@NOC-RAFI:~$ sudo vim /usr/lib/google-cloud-sdk/lib/googlecloudsdk/core/config.json
“disable_updater”: flase,

mohammedrafi@NOC-RAFI:~$ sudo gcloud components install kubectl
Your current Cloud SDK version is: 155.0.0
Installing components from version: 155.0.0

┌──────────────────────────────────────────────┐
│ These components will be installed. │
├─────────────────────────┬─────────┬──────────┤
│ Name │ Version │ Size │
├─────────────────────────┼─────────┼──────────┤
│ kubectl │ │ │
│ kubectl (Linux, x86_64) │ 1.6.2 │ 14.9 MiB │
└─────────────────────────┴─────────┴──────────┘

For the latest full release notes, please visit:
https://cloud.google.com/sdk/release_notes

Do you want to continue (Y/n)? y

╔════════════════════════════════════════════════════════════╗
╠═ Creating update staging area ═╣
╠════════════════════════════════════════════════════════════╣
╠═ Installing: kubectl ═╣
╠════════════════════════════════════════════════════════════╣
╠═ Installing: kubectl (Linux, x86_64) ═╣
╠════════════════════════════════════════════════════════════╣
╠═ Creating backup and activating new installation ═╣
╚════════════════════════════════════════════════════════════╝

Performing post processing steps…done.

Update done!
mohammedrafi@NOC-RAFI:~$ gcloud config list
[compute]
region = asia-east1
zone = asia-east1-b
[core]
account = mshaikdevops@gmail.com
disable_usage_reporting = True
project = rising-artifact-164906

Your active configuration is: [default]

#############################################################################

mohammedrafi@NOC-RAFI:~$ gcloud compute instances list
NAME ZONE MACHINE_TYPE PREEMPTIBLE INTERNAL_IP EXTERNAL_IP STATUS
docker us-central1-c n1-standard-1 10.128.0.2 104.197.74.126 RUNNING

mohammedrafi@NOC-RAFI:~$ gcloud config list project
[core]
project = rising-artifact-164906
mohammedrafi@NOC-RAFI:~$ gcloud config set project rising-artifact-164906
Updated property [core/project].

Your active configuration is: [default]
mohammedrafi@NOC-RAFI:~$ gcloud compute zones list
NAME REGION STATUS NEXT_MAINTENANCE TURNDOWN_DATE
asia-east1-b asia-east1 UP
asia-east1-a asia-east1 UP
asia-east1-c asia-east1 UP
asia-northeast1-c asia-northeast1 UP
asia-northeast1-a asia-northeast1 UP
asia-northeast1-b asia-northeast1 UP
asia-southeast1-a asia-southeast1 UP
asia-southeast1-b asia-southeast1 UP
europe-west1-b europe-west1 UP
europe-west1-c europe-west1 UP
europe-west1-d europe-west1 UP
us-central1-c us-central1 UP
us-central1-f us-central1 UP
us-central1-b us-central1 UP
us-central1-a us-central1 UP
us-east1-d us-east1 UP
us-east1-c us-east1 UP
us-east1-b us-east1 UP
us-east4-b us-east4 UP
us-east4-a us-east4 UP
us-east4-c us-east4 UP
us-west1-a us-west1 UP
us-west1-b us-west1 UP

mohammedrafi@NOC-RAFI:~$ gcloud config set compute/zone asia-east1-b
Updated property [compute/zone].
mohammedrafi@NOC-RAFI:~$ gcloud container clusters create my-app
Creating cluster my-app…done.
Created [https://container.googleapis.com/v1/projects/rising-artifact-164906/zones/asia-east1-b/clusters/my-app].
kubeconfig entry generated for my-app.
NAME ZONE MASTER_VERSION MASTER_IP MACHINE_TYPE NODE_VERSION NUM_NODES STATUS
my-app asia-east1-b 1.5.7 104.199.130.29 n1-standard-1 1.5.7 3 RUNNING
mohammedrafi@NOC-RAFI:~$ gcloud auth application-default login
Your browser has been opened to visit:

https://accounts.google.com/o/oauth2/auth?redirect_uri=http%3A%2F%2Flocalhost%3A8085%2F&prompt=select_account&response_type=code&client_id=764086051850-6qr4p6gpi6hn506pt8ejuq83di341hur.apps.googleusercontent.com&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloud-platform&access_type=offline
Created new window in existing browser session.

Credentials saved to file: [/home/mohammedrafi/.config/gcloud/application_default_credentials.json]

These credentials will be used by any library that requests
Application Default Credentials.

mohammedrafi@NOC-RAFI:~$ gcloud container clusters describe my-app
clusterIpv4Cidr: 10.0.0.0/14
createTime: ‘2017-05-19T18:31:40+00:00’
currentMasterVersion: 1.5.7
currentNodeCount: 3
currentNodeVersion: 1.5.7
endpoint: 104.199.130.29
initialClusterVersion: 1.5.7
instanceGroupUrls:
https://www.googleapis.com/compute/v1/projects/rising-artifact-164906/zones/asia-east1-b/instanceGroupManagers/gke-my-app-default-pool-b58b895e-grp
labelFingerprint: a9dc16a7
legacyAbac:
enabled: true
locations:
– asia-east1-b
loggingService: logging.googleapis.com
masterAuth:
clientCertificate: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUMyekNDQWNPZ0F3SUJBZ0lSQUtzanBtWVpyOUx3ZjdkTlg3dGNDU2N3RFFZSktvWklodmNOQVFFTEJRQXcKTHpFdE1Dc0dBMVVFQXhNa09XRmpObUk1WlRZdE5qTTVOeTAwWlRkakxXSTBaamN0T1RNMk1HUm1PRGN3WVdaaQpNQjRYRFRFM01EVXhPVEU0TXpFME1Wb1hEVEl5TURVeE9ERTRNekUwTVZvd0VURVBNQTBHQTFVRUF4TUdZMnhwClp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R3AxQWdNQkFBR2pJekFoTUE0R0ExVWQKRHdFQi93UUVBd0lDQkRBUEJnTlZIUk1CQWY4RUJUQURBUUgvTUEwR0NTcUdTSWIzRFFFQkN3VUFBNElCQVFBTgowWGlmWHFLTDA3N0pvSE40MjFKTTV2N2RkTkFZYXhzWDExOFp0MUZIVk1tRXNja3dJd0FXd0pFZmNGRDg4UGlMCnhkdVUvVnVvUFpOSHBlZjJnK2pzT2YrbndnNWl5WDNuaDIyZVYzdE1kY1MyakVFakp3UXh2Zi9KaDVaa3MvRHIKM1UrWE1EMExvc3JHdjFJY3Q3eWN0SUs5c21CNXlZaUxaQjhsRzFXcXMxT2NKUHd2Ym1qcXlLY0xMMnEycEFJMwp3U2g5aEFRVHExY2RkSEIxZ2o3d0hIcVo3S2pDNzV3NVpTSGo3Mm5hL1dTcXVncndHMFJURk14eW1adHVQYlU1ClZWaU5jeGRQT3psT3cyTFYwa1RNa2E0MEpoQndLNFNCdlZHcFFSdExWMGtwNFlXRGp6TGNNRUw0OThtVEZIQXEKZG11ZCtBMWRRYm9WYUplSXdEbnEKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
password: AkoZOAajDrrAlgyF
username: admin
monitoringService: monitoring.googleapis.com
name: my-app
network: default
nodeConfig:
diskSizeGb: 100
imageType: COS
machineType: n1-standard-1
oauthScopes:
https://www.googleapis.com/auth/compute
https://www.googleapis.com/auth/devstorage.read_only
https://www.googleapis.com/auth/service.management.readonly
https://www.googleapis.com/auth/servicecontrol
https://www.googleapis.com/auth/logging.write
https://www.googleapis.com/auth/monitoring
serviceAccount: default
nodeIpv4CidrSize: 24
nodePools:
– config:
diskSizeGb: 100
imageType: COS
machineType: n1-standard-1
oauthScopes:
https://www.googleapis.com/auth/compute
https://www.googleapis.com/auth/devstorage.read_only
https://www.googleapis.com/auth/service.management.readonly
https://www.googleapis.com/auth/servicecontrol
https://www.googleapis.com/auth/logging.write
https://www.googleapis.com/auth/monitoring
serviceAccount: default
initialNodeCount: 3
instanceGroupUrls:
https://www.googleapis.com/compute/v1/projects/rising-artifact-164906/zones/asia-east1-b/instanceGroupManagers/gke-my-app-default-pool-b58b895e-grp
management: {}
name: default-pool
selfLink: https://container.googleapis.com/v1/projects/rising-artifact-164906/zones/asia-east1-b/clusters/my-app/nodePools/default-pool
status: RUNNING
version: 1.5.7
selfLink: https://container.googleapis.com/v1/projects/rising-artifact-164906/zones/asia-east1-b/clusters/my-app
servicesIpv4Cidr: 10.3.240.0/20
status: RUNNING
zone: asia-east1-b
mohammedrafi@NOC-RAFI:~$ sudo apt-get install kubectl

mohammedrafi@NOC-RAFI:~$ kubectl run hello-node –image=gcr.io/google-samples/node-hello:1.0 –port=8080
deployment “hello-node” created

mohammedrafi@NOC-RAFI:~$ kubectl expose deployment hello-node –type=”LoadBalancer”
service “hello-node” exposed

mohammedrafi@NOC-RAFI:~$ kubectl get service hello-node
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
hello-node 10.3.254.221 <pending> 8080:31283/TCP 25s

mohammedrafi@NOC-RAFI:~$ kubectl get service hello-node
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
hello-node 10.3.254.221 35.185.175.78 8080:31283/TCP 1m

mohammedrafi@NOC-RAFI:~$ kubectl get pods
NAME READY STATUS RESTARTS AGE
hello-node-3526609615-qm0fn 1/1 Running 0 3m

mohammedrafi@NOC-RAFI:~$ kubectl get service
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
hello-node 10.3.254.221 35.185.175.78 8080:31283/TCP 2m
kubernetes 10.3.240.1 <none> 443/TCP 23m
mohammedrafi@NOC-RAFI:~$ kubectl cluster-info
Kubernetes master is running at https://104.199.130.29
GLBCDefaultBackend is running at https://104.199.130.29/api/v1/proxy/namespaces/kube-system/services/default-http-backend
Heapster is running at https://104.199.130.29/api/v1/proxy/namespaces/kube-system/services/heapster
KubeDNS is running at https://104.199.130.29/api/v1/proxy/namespaces/kube-system/services/kube-dns
kubernetes-dashboard is running at https://104.199.130.29/api/v1/proxy/namespaces/kube-system/services/kubernetes-dashboard

To further debug and diagnose cluster problems, use ‘kubectl cluster-info dump’.
https://104.199.130.29/ui

https://104.199.130.29/api/v1/proxy/namespaces/kube-system/services/kubernetes-dashboard/#/workload?namespace=default

image 6

mohammedrafi@NOC-RAFI:~$ kubectl run wordpress –image=tutum/wordpress –port=80
deployment “wordpress” created

mohammedrafi@NOC-RAFI:~$ kubectl expose deployment wordpress –type=LoadBalancer
service “wordpress” exposed

mohammedrafi@NOC-RAFI:~$ kubectl describe services wordpress
Name: wordpress
Namespace: default
Labels: run=wordpress
Annotations: <none>
Selector: run=wordpress
Type: LoadBalancer
IP: 10.3.247.147
Port: <unset> 80/TCP
NodePort: <unset> 31537/TCP
Endpoints: <none>
Session Affinity: None
Events:
FirstSeen LastSeen Count From SubObjectPath Type Reason Message
——— ——– —– —- ————- ——– —— ——-
17s 17s 1 service-controller Normal CreatingLoadBalancer Creating load balancer

mohammedrafi@NOC-RAFI:~$ kubectl describe services hello-node
Name: hello-node
Namespace: default
Labels: run=hello-node
Annotations: <none>
Selector: run=hello-node
Type: LoadBalancer
IP: 10.3.254.221
LoadBalancer Ingress: 35.185.175.78
Port: <unset> 8080/TCP
NodePort: <unset> 31283/TCP
Endpoints: 10.0.2.3:8080
Session Affinity: None
Events:
FirstSeen LastSeen Count From SubObjectPath Type Reason Message
——— ——– —– —- ————- ——– —— ——-
23m 23m 1 service-controller Normal CreatingLoadBalancer Creating load balancer
22m 22m 1 service-controller Normal CreatedLoadBalancer Created load balancer
mohammedrafi@NOC-RAFI:~$ kubectl describe services wordpress
Name: wordpress
Namespace: default
Labels: run=wordpress
Annotations: <none>
Selector: run=wordpress
Type: LoadBalancer
IP: 10.3.247.147
LoadBalancer Ingress: 104.199.172.229
Port: <unset> 80/TCP
NodePort: <unset> 31537/TCP
Endpoints: 10.0.2.4:80
Session Affinity: None
Events:
FirstSeen LastSeen Count From SubObjectPath Type Reason Message
——— ——– —– —- ————- ——– —— ——-
4m 4m 1 service-controller Normal CreatingLoadBalancer Creating load balancer
3m 3m 1 service-controller Normal CreatedLoadBalancer Created load balancer
gke-my-app-default-pool-b58b895e-7515 ~ # ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1460 qdisc pfifo_fast state UP group default qlen 1000
link/ether 42:01:0a:8c:00:03 brd ff:ff:ff:ff:ff:ff
inet 10.140.0.3/32 brd 10.140.0.3 scope global dynamic eth0
valid_lft 82861sec preferred_lft 82861sec
inet6 fe80::4001:aff:fe8c:3/64 scope link
valid_lft forever preferred_lft forever
3: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
link/ether 02:42:bd:d0:61:d0 brd ff:ff:ff:ff:ff:ff
inet 169.254.123.1/24 scope global docker0
valid_lft forever preferred_lft forever
4: cbr0: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 1460 qdisc htb state UP group default qlen 1000
link/ether 0a:58:0a:00:00:01 brd ff:ff:ff:ff:ff:ff
inet 10.0.0.1/24 scope global cbr0
valid_lft forever preferred_lft forever
inet6 fe80::8853:caff:fe11:d091/64 scope link
valid_lft forever preferred_lft forever
5: veth126a3e05@if3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1460 qdisc noqueue master cbr0 state UP group default
link/ether d6:95:4c:95:a2:a9 brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet6 fe80::d495:4cff:fe95:a2a9/64 scope link
valid_lft forever preferred_lft forever
6: vethc7f272bd@if3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1460 qdisc noqueue master cbr0 state UP group default
link/ether ea:95:54:53:01:c5 brd ff:ff:ff:ff:ff:ff link-netnsid 1
inet6 fe80::e895:54ff:fe53:1c5/64 scope link
valid_lft forever preferred_lft forever

gke-my-app-default-pool-b58b895e-7515 ~ # curl ifconfig.me
35.185.149.197

gke-my-app-default-pool-b58b895e-7515 ~ # netstat -tlpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:10248 0.0.0.0:* LISTEN 1234/kubelet
tcp 0 0 127.0.0.1:10249 0.0.0.0:* LISTEN 1419/kube-proxy
tcp 0 0 0.0.0.0:5355 0.0.0.0:* LISTEN 671/systemd-resolve
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 751/sshd
tcp6 0 0 :::4194 :::* LISTEN 1234/kubelet
tcp6 0 0 :::30378 :::* LISTEN 1419/kube-proxy
tcp6 0 0 :::10250 :::* LISTEN 1234/kubelet
tcp6 0 0 :::5355 :::* LISTEN 671/systemd-resolve
tcp6 0 0 :::10255 :::* LISTEN 1234/kubelet
tcp6 0 0 :::31537 :::* LISTEN 1419/kube-proxy
tcp6 0 0 :::31283 :::* LISTEN 1419/kube-proxy

gke-my-app-default-pool-b58b895e-7515 ~ # systemctl status docker
● docker.service – Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/docker.service.d
└─01network.conf
Active: active (running) since Fri 2017-05-19 18:33:42 UTC; 55min ago
Docs: https://docs.docker.com
Process: 1171 ExecStartPre=/bin/sh -x -c rm -rf /var/lib/docker/network (code=exited, status=0/SUCCESS)
Process: 1166 ExecStartPre=/bin/sh -x -c if [ ! -s /var/lib/docker/repositories-overlay ]; then rm -f /var/lib/docker/repositories-overlay; fi (code=exited, status=0/SUCCESS)
Main PID: 1174 (docker)
Memory: 1.6G
CPU: 1min 23.927s
CGroup: /system.slice/docker.service

gke-my-app-default-pool-b58b895e-7515 ~ # docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
gcr.io/google_containers/kube-proxy 690a68ee4bacc47b0115413489185f3d 0cdeac571785 3 weeks ago 173.5 MB
asia.gcr.io/google_containers/fluentd-gcp 1.28.3 dc76aa4842cd 6 weeks ago 347.7 MB
asia.gcr.io/google_containers/addon-resizer 1.7 9b0815c87118 3 months ago 38.98 MB
asia.gcr.io/google_containers/heapster v1.2.0 7cd51f2f6a97 8 months ago 177.8 MB
gcr.io/google_containers/pause-amd64 3.0 99e59f495ffa 12 months ago 746.9 kB
tutum/wordpress latest 7e7f97a602ff 14 months ago 476.4 MB

gke-my-app-default-pool-b58b895e-7515 ~ # docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
8b07e908fa32 asia.gcr.io/google_containers/addon-resizer:1.7 “/pod_nanny –cpu=80m” 54 minutes ago Up 53 minutes k8s_heapster-nanny.5c942c75_heapster-v1.2.0.1-4251020826-x5qfk_kube-system_007e865c-3cc2-11e7-a82b-42010af00151_932dce89
c7e715ee2e9f asia.gcr.io/google_containers/heapster:v1.2.0 “/heapster –source=k” 54 minutes ago Up 54 minutes k8s_heapster.fc62b2c1_heapster-v1.2.0.1-4251020826-x5qfk_kube-system_007e865c-3cc2-11e7-a82b-42010af00151_c85e8ddc
97947347fe6a gcr.io/google_containers/pause-amd64:3.0 “/pause” 54 minutes ago Up 54 minutes k8s_POD.d8dbe16c_heapster-v1.2.0.1-4251020826-x5qfk_kube-system_007e865c-3cc2-11e7-a82b-42010af00151_808b58a4
dd70288a40ce asia.gcr.io/google_containers/fluentd-gcp:1.28.3 “/bin/sh -c ‘rm /lib/” 54 minutes ago Up 54 minutes k8s_fluentd-cloud-logging.32d4c705_fluentd-cloud-logging-gke-my-app-default-pool-b58b895e-7515_kube-system_1edecfbf5237e94d78f1261c18b6b026_01950581
08f4a8cac82d gcr.io/google_containers/pause-amd64:3.0 “/pause” 54 minutes ago Up 54 minutes k8s_POD.d8dbe16c_fluentd-cloud-logging-gke-my-app-default-pool-b58b895e-7515_kube-system_1edecfbf5237e94d78f1261c18b6b026_31f4ced0
ee82bdaaf1cc gcr.io/google_containers/kube-proxy:690a68ee4bacc47b0115413489185f3d “/bin/sh -c ‘kube-pro” 56 minutes ago Up 56 minutes k8s_kube-proxy.a6642e81_kube-proxy-gke-my-app-default-pool-b58b895e-7515_kube-system_82eedf6b119bef7c206d1a7f2e17542a_edec04a4
c1bd7b1583eb gcr.io/google_containers/pause-amd64:3.0 “/pause” 56 minutes ago Up 56 minutes k8s_POD.d8dbe16c_kube-proxy-gke-my-app-default-pool-b58b895e-7515_kube-system_82eedf6b119bef7c206d1a7f2e17542a_eef4b1b3

gcloud1gcloud2gloud3gcloud4gcloud5gcloud6gcloud7gcloud8gcloud9gcloud10gcloud11
mohammedrafi@NOC-RAFI:~$ kubectl get services
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
hello-node 10.3.254.221 35.185.175.78 8080:31283/TCP 49m
kubernetes 10.3.240.1 <none> 443/TCP 1h
wordpress 10.3.247.147 104.199.172.229 80:31537/TCP 30m

mohammedrafi@NOC-RAFI:~$ kubectl get pods
NAME READY STATUS RESTARTS AGE
hello-node-3526609615-qm0fn 1/1 Running 0 51m
wordpress-2410004867-n89nb 1/1 Running 0 30m

mohammedrafi@NOC-RAFI:~$ kubectl delete service hello-node
service “hello-node” deleted
mohammedrafi@NOC-RAFI:~$ kubectl delete service wordpress
service “wordpress” deleted
mohammedrafi@NOC-RAFI:~$ kubectl get services
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes 10.3.240.1 <none> 443/TCP 1h
mohammedrafi@NOC-RAFI:~$ kubectl get pods
NAME READY STATUS RESTARTS AGE
hello-node-3526609615-qm0fn 1/1 Running 0 57m
wordpress-2410004867-n89nb 1/1 Running 0 36m
mohammedrafi@NOC-RAFI:~$ kubectl delete pods hello-node-3526609615-qm0fn
pod “hello-node-3526609615-qm0fn” deleted
mohammedrafi@NOC-RAFI:~$ kubectl delete pods wordpress-2410004867-n89nb
pod “wordpress-2410004867-n89nb” deleted
mohammedrafi@NOC-RAFI:~$ gcloud container clusters delete my-app
The following clusters will be deleted.
– [my-app] in [asia-east1-b]

Do you want to continue (Y/n)? y

Deleting cluster my-app…done.
Deleted [https://container.googleapis.com/v1/projects/rising-artifact-164906/zones/asia-east1-b/clusters/my-app].

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s