Creating a PKS Kubernetes Cluster
Prerequisites
Note:
- Refer to the PKS documentation to configure pks and kubectl clients.
- For other useful links, refer to:
Note: If you have modified the
k8s_deploy_namespace to a specific namespace in k8s cluster, you need to configure kubectl again for the given namespace. After running the above command, the kube config file (~/.kube/config) will have an entry for the PKS k8s cluster and user as below.
Note down the value of cluster and user.
apiVersion: v1 clusters: - cluster: certificate-authority-data: abc server: <k8s master url> name: ml52pks1 contexts: - context: cluster: ml52-system user: 3d128617-ba6c-4764-886a-27db12dde826 name: ml52-system current-context: ml52-system kind: Config preferences: {} users: - name: ml52pks1 user: client-certificate-data: xyz
Creating a new context for namespace in kubectl
Execute below commands to create a new context for the namespace you want to deploy and configure kubectl for the new context.
Procedure
Log into the Docker registry
To confirm login credentials after successful login:
- Check the
~/.docker/config.json file for the login credentials under
auth.
cat ~/.docker/config.json { "auths": { "<docker-registry>": { "auth": "XXXXXXX" } }, "HttpHeaders": { "User-Agent": "Docker-Client/17.12.0-ce (darwin)" }
- Login to PKS:
pks login -k -a <pks host vm> -u <pks user> -p <password>
- Check PKS clusters:
pks clusters
- Get PKS credential for the running cluster:
pks get-credentials <cluster name>
Copyright © Cloud Software Group, Inc. All rights reserved.