From google cloud console, go to IAM & admin > Service accounts > Create Service Account
.
Then create a service account. In the 3rd step (Grant users access to this service account) press the button create key. Then download it in json
format
After that run the following command.
$ pharmer create credential <credential-name> --provider gce --from-file <path-to-the-json-file>
You can view list of credentials you created by running
$ pharmer get credentials
To view the credential you created, run
$ pharmer get credential <credential-name> -o yaml
apiVersion: cloud.pharmer.io/v1
kind: Credential
metadata:
creationTimestamp: "2019-06-26T08:55:54Z"
name: <credential-name>
spec:
data:
projectID: your project id
serviceAccount: your service account json
provider: gce
Here,
- spec.data.projectID
is the project id
- spec.data.serviceAccount
is the service account
You can edit your created credential by running
$ pharmer edit credential <credential-name>
You can delete your credential by running
```console
$ pharmer delete credential