This project allows you to connect your Google Home to your Kubernetes cluster and control it via voice commands. It's not a public Google Home Action, since you have to configure Kubernetes access manually for your cluster.
This repository contains Dialogflow configuration as well, which can be imported into existing project. It can be customized later.
Example conversation:
[you] Hey Google, talk to Kubernetes Manager
[assistant] Welcome to Kubernetes Manager. How can I help you?
[you] Scale statefulset "redis"
[assistant] Got it. Currently, there are 3 replicas of the "redis" statefulset. To how many replicas do you want to scale?
[you] 5
[assistant] Statefulset has been updated. Anything else?
Scale statefulset "name"
Scale deployment "name"
Scale replicaset "name"
What is the size of the cluster?
Contribute to add more voice commands :)
To generate kubeconfig
you have to install the following tools:
kubectl
cfssl
cfssljson
Then run the following command to generate build/kubeconfig
file.
./generate-kubeconfig.sh
Requirements:
gcloud
Set environment variables in env.yaml
(cp env.sample.yaml env.yaml
).
gcloud app deploy
Save URL, you will need to use it later in Dialogflow.
API deployed to App Engine is protected by static API Key which should be set in env.yaml
. To access API, client should send Authorization: Bearer ${API_KEY}
header.
- Go to Dialogflow Console
- Select or create a new agent
- Go to Settings -> Export and Import
- Select Import From Zip (import this file google-home-k8s.zip)
- Go to Fulfillment
- Enable Webhook
- Paste URL to API deployed to App Engine
- Add Header. Key:
Authorization
, Value:Bearer API_KEY
(replaceAPI_KEY
with the value fromenv.yaml
)
go test -race -v ./pkg/...