Friday, May 3, 2019

Deploying an addressbook application through kubernetes

not set, default to updating the existing annotation value only if one already exists. -R, --recursive=false: Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory. --save-config=false: If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future. --selector='': A label selector to use for this service. Only equality-based selector requirements are supported. If empty (the default) infer the selector from the replication controller or replica set.) --session-affinity='': If non-empty, set the session affinity for the service to this; legal values: 'None', 'ClientIP' --target-port='': Name or number for the port on the container that the service should direct traffic to. Optional. --template='': Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview]. --type='': Type for this service: ClusterIP, NodePort, LoadBalancer, or ExternalName. Default is 'ClusterIP'.Usage: kubectl expose (-f FILENAME | TYPE NAME) [--port=port] [--protocol=TCP|UDP|SCTP] [--target-port=number-or-name] [--name=name] [--external-ip=external-ip-of-service] [--type=type] [options]Use "kubectl options" for a list of global command-line options (applies to all commands).unknown flag: --type:Nodeportroot@kubemaster:/home/kafleashok1/pod# kubectl expose pod poddemo --port=8080 --type=NodeportThe Service "poddemo" is invalid: spec.type: Unsupported value: "Nodeport": supported values: "ClusterIP", "ExternalName", "LoadBalancer", "NodePort"root@kubemaster:/home/kafleashok1/pod# kubectl expose pod poddemo --port=8080 --type=NodePortservice/poddemo exposedroot@kubemaster:/home/kafleashok1/pod# kubectl get svcNAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGEkubernetes ClusterIP 10.96.0.1 <none> 443/TCP 3d19hpoddemo NodePort 10.104.117.13 <none> 8080:31655/TCP 12sroot@kubemaster:/home/kafleashok1/pod# kubectl get svc -o wideNAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTORkubernetes ClusterIP 10.96.0.1 <none> 443/TCP 3d19h <none>poddemo NodePort 10.104.117.13 <none> 8080:31655/TCP 23s app=addressapproot@kubemaster:/home/kafleashok1/pod# kubectl get pod -o wideNAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATESnginxpod 1/1 Running 2 21h 192.168.2.4 kubeworker2 <none> <none>poddemo 1/1 Running 0 5m51s 192.168.1.2 kubeworker1 <none> <none>root@kubemaster:/home/kafleashok1/pod# kubectl exec -it poddemo /bin/bashroot@poddemo:/usr/local/tomcat# cd webappsroot@poddemo:/usr/local/tomcat/webapps# lsROOT addressbook addressbook.war docs examples host-manager managerroot@poddemo:/usr/local/tomcat/webapps# history 1 cd webapps 2 ls 3 historyroot@poddemo:/usr/local/tomcat/webapps#