- From the Create menu in the control panel, click Kubernetes.
- Select a Kubernetes version. The latest version is selected by default and is the best choice if you have no specific need for an earlier version.
- Choose a datacenter region.
- Customize the default node pool, choose the node pool names, and add additional node pools.
- Name the cluster, select the project you want the cluster to belong to, and optionally add a tag.
- Click Create Cluster. Provisioning the cluster takes several minutes.
- Download the cluster configuration file by clicking Actions, then Download Config from the cluster home page.
- POST /secrets
- Vars
- message - required - The message to encrypt
- passphrase - required - The passphrase for the message
- expiration_time - optional - How long for the message to persist in seconds. Default is 604800
- Returns JSON
- Vars
- id - unique ID of the secret for retrieval
- success - Boolean
- Vars
- POST /secrets/
- Vars
- passphrase - required - The passphrase to unlock the secret
- Returns JSON
- Vars
- message - The decrypted message
- success - Boolean
- Vars
- Vars
- Vars
- If the message doesn't exist, has already been read, or has expired
{ "message": "This secret either never existed or it was already read", "success": "False" }
-
Find the IP address of your pod and copy one address to your clipboard
kubectl get pods -n secrets-app -o wide
-
Create a utilities pod
kubectl apply -f kubernetes/utilities.yaml
- Get the unique id of the pod and copy that to your clipboard.
kubectl get pods -n secrets-app
You will see something like this:
NAME READY STATUS RESTARTS AGE one-time-secret-5b757b96f-6nbm7 1/1 Running 0 10m one-time-secret-5b757b96f-b9t54 1/1 Running 0 10m one-time-secret-5b757b96f-cjtsx 1/1 Running 0 10m utilities-6d8f574894-kt59m 1/1 Running 0 10s
-
Exec into that pod
kubectl exec -it <utilities_pod_name> -n secrets-app -- /bin/sh
-
Install
httpie
curl -SsL https://packages.httpie.io/deb/KEY.gpg | apt-key add - && curl -SsL -o /etc/apt/sources.list.d/httpie.list https://packages.httpie.io/deb/httpie.list && apt update && apt install httpie
The installation will take a minute or two.
-
Test write
http POST <pod_ip_address>:8080/secrets message="YOUR_MESSAGE" passphrase="YOUR_PASSPHRASE"
- Sample Response
{ "id": "ea54d2701885400cafd0c11279672c8f", "success": "True" }
-
Test read, using the id from above
http POST <pod_ip_address>:8080/secrets/<id> passphrase="YOUR_PASSPHRASE"
- Sample Response
{ "message": "Hello there", "success": "True" }
-
Exit out of the utilities pod
exit
- Go to the Kubernetes page in the control panel. From the cluster’s More menu, select Destroy and click Destroy.
- In the Destroy Kubernetes cluster dialog box, select the resources, such as load balancers and block storage volumes, associated with the cluster to delete them automatically when the cluster is deleted. Enter the name of the cluster, then click Destroy to confirm.