Skip to content

Instantly share code, notes, and snippets.

@jzaccone
Last active June 11, 2019 15:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save jzaccone/0cdc321e5dc8adb0dca98ca861284c01 to your computer and use it in GitHub Desktop.
Save jzaccone/0cdc321e5dc8adb0dca98ca861284c01 to your computer and use it in GitHub Desktop.

Run these steps inside the console-in-a-browser environment provided by your instructor.

Login to the IBM Cloud. When asked to select an account, select "Eric Andersen's Account". Select 'us-east' as the region.

~$ ibmcloud login -a https://cloud.ibm.com

API endpoint: https://cloud.ibm.com

Email> john.zaccone@ibm.com

Password> 
Authenticating...
OK

Select an account:
1. John H. Zaccone's Account (12345)
2. Eric Andersen's Account (7d4e885b10101b041e651b1ff087a387) <-> 1757519
Enter a number> 2
Targeted account Eric Andersen's Account (7d4e885b10101b041e651b1ff087a387) <-> 1757519


Select a region (or press enter to skip):
1. au-syd
2. jp-tok
3. eu-de
4. eu-gb
5. us-south
6. us-east
Enter a number> 6
Targeted region us-east

                      
API endpoint:      https://cloud.ibm.com   
Region:            us-east   
User:              John.Zaccone@ibm.com   
Account:           Eric Andersen's Account (7d4e885b10101b041e651b1ff087a387) <-> 1757519     
Resource group:    No resource group targeted, use 'ibmcloud target -g RESOURCE_GROUP'   
CF API endpoint:      
Org:                  
Space:                

Tip: If you are managing Cloud Foundry applications and services
- Use 'ibmcloud target --cf' to target Cloud Foundry org/space interactively, or use 'ibmcloud target --cf-api ENDPOINT -o ORG -s SPACE' to target the org/space.
- Use 'ibmcloud cf' if you want to run the Cloud Foundry CLI with current IBM Cloud CLI context.

Target the IKS-RG1 namespace:

ibmcloud target -g IKS-RG1

List the clusters and locate the cluster corresponding to the userId you used to login to the console-in-a-browser environment. For example, if you are user028, your cluster will be user028-cluster.

~$ ibmcloud ks clusters
Clusters at version 1.11 and later run containerd instead of Docker as the Kubernetes container runtime. For more information and update actions, see <https://ibm.biz/Bd22hF>

OK
Name              ID                                 State    Created      Workers   Location          Version       Resource Group Name   
user001-cluster   707f162b19cc4c3bbb28bfbfe85ee873   normal   2 days ago   2         Washington D.C.   1.11.8_1547   IKS-RG1   
user026-cluster   dcfb22a45c8e410e8d6f7a8269c2d0c3   normal   1 day ago    2         Washington D.C.   1.11.8_1547   IKS-RG1   
user028-cluster   1b3398b985d84e9b8e9544a91d61428a   normal   1 day ago    2         Washington D.C.   1.11.8_1547   IKS-RG1   
user029-cluster   6d267a184154407d873f0b02159feb84   normal   1 day ago    2         Washington D.C.   1.11.8_1547   IKS-RG1   

Configure your Kubernetes client using this command. This will also configure your Kubernetes client for future login sessions by adding the command into your .bash_profile. Note $USER automatically resolves to the user logged into the terminal environment.

~$ eval $(ibmcloud ks cluster-config --cluster $USER-cluster --export | tee -a ~/.bash_profile) 

You should be able to use kubectl to list kubernetes resources. Try getting the list of pods (there should be none yet)

~$ kubectl get pods
No resources found.

Verify that you have the appmod_sst namespace.

~$ ibmcloud cr namespaces
Listing namespaces...

Namespace   
appmod_sst   

OK

Login to the registry service

~$ ibmcloud cr login
Logging in to 'registry.ng.bluemix.net'...
Logged in to 'registry.ng.bluemix.net'.

IBM Cloud Container Registry is adopting new icr.io domain names to align with the rebranding of IBM Cloud for a better user experience. The existing bluemix.net domain names are deprecated, but you can continue to use them for the time being, as an unsupported date will be announced later. For more information about registry domain names, see https://cloud.ibm.com/docs/services/Registry?topic=registry-registry_overview#registry_regions_local

Logging in to 'us.icr.io'...
Logged in to 'us.icr.io'.

IBM Cloud Container Registry is adopting new icr.io domain names to align with the rebranding of IBM Cloud for a better user experience. The existing bluemix.net domain names are deprecated, but you can continue to use them for the time being, as an unsupported date will be announced later. For more information about registry domain names, see https://cloud.ibm.com/docs/services/Registry?topic=registry-registry_overview#registry_regions_local

OK

Verify you can list the images in the registry. You should see at least guestbook and mariadb, maybe a couple others.

~$ ibmcloud cr images
Listing images...

REPOSITORY                                    TAG        DIGEST         NAMESPACE    CREATED        SIZE     SECURITY STATUS   
us.icr.io/appmod_sst/user001/guestbook        v1         d4777e5bfffd   appmod_sst   2 months ago   7.5 MB   No Issues   
us.icr.io/appmod_sst/user001/pbw-mariadb-web  1.0.0      1a21d270342c   appmod_sst   2 days ago     282 MB   11 Issues   


OK

That's it! Return to the lab instructions. Run the commands in the lab in this environment you just set up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment