docs: updated code in kubernetes guide

Signed-off-by: Sam Alba <sam.alba@gmail.com>
This commit is contained in:
Sam Alba 2021-06-14 18:29:10 +02:00
parent b231c3cb1b
commit 2a36771be0

View File

@ -1,6 +1,6 @@
# Kubernetes # Kubernetes
This tutorial illustrates how to use `dagger` to build, push and deploy Docker This tutorial illustrates how to use dagger to build, push and deploy Docker
images to Kubernetes. images to Kubernetes.
import Tabs from '@theme/Tabs'; import Tabs from '@theme/Tabs';
@ -63,15 +63,13 @@ docker network connect kind registry
<TabItem value="gke"> <TabItem value="gke">
This tutorial can be run against a [GCP GKE](https://cloud.google.com/kubernetes-engine) cluster and [GCR](https://cloud.google.com/container-registry This tutorial can be run against a [GCP GKE](https://cloud.google.com/kubernetes-engine) cluster and [GCR](https://cloud.google.com/container-registry)
)
</TabItem> </TabItem>
<TabItem value="eks"> <TabItem value="eks">
This tutorial can be run against a [AWS EKS](https://aws.amazon.com/eks/ This tutorial can be run against a [AWS EKS](https://aws.amazon.com/eks/) cluster and [ECR](https://aws.amazon.com/ecr/)
) cluster and [ECR](https://aws.amazon.com/ecr/)
</TabItem> </TabItem>
</Tabs> </Tabs>
@ -138,12 +136,13 @@ Next, create `.dagger/env/default/plan/main.cue`.
package main package main
import ( import (
"dagger.io/dagger"
"dagger.io/kubernetes" "dagger.io/kubernetes"
) )
// input: ~/.kube/config file used for deployment // input: ~/.kube/config file used for deployment
// set with `dagger input text kubeconfig -f ~/.kube/config` // set with `dagger input secret kubeconfig -f ~/.kube/config`
kubeconfig: string @dagger(input) kubeconfig: dagger.#Secret @dagger(input)
// deploy uses the `dagger.io/kubernetes` package to apply a manifest to a // deploy uses the `dagger.io/kubernetes` package to apply a manifest to a
// Kubernetes cluster. // Kubernetes cluster.
@ -527,6 +526,7 @@ package main
import ( import (
"encoding/yaml" "encoding/yaml"
"dagger.io/dagger"
"dagger.io/docker" "dagger.io/docker"
) )