From 2a36771be035449693f4258521f0d37e6bcdfd12 Mon Sep 17 00:00:00 2001 From: Sam Alba Date: Mon, 14 Jun 2021 18:29:10 +0200 Subject: [PATCH] docs: updated code in kubernetes guide Signed-off-by: Sam Alba --- docs/programming/guides/kubernetes.md | 70 +++++++++++++-------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/docs/programming/guides/kubernetes.md b/docs/programming/guides/kubernetes.md index 2c0e83e6..04b3463f 100644 --- a/docs/programming/guides/kubernetes.md +++ b/docs/programming/guides/kubernetes.md @@ -1,6 +1,6 @@ # 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. import Tabs from '@theme/Tabs'; @@ -11,13 +11,13 @@ import TabItem from '@theme/TabItem'; For this tutorial, you will need a Kubernetes cluster. +defaultValue="kind" +groupId="provider" +values={[ +{label: 'kind', value: 'kind'}, +{label: 'GKE', value: 'gke'}, +{label: 'EKS', value: 'eks'}, +]}> @@ -63,15 +63,13 @@ docker network connect kind 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 -) +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 [AWS EKS](https://aws.amazon.com/eks/ -) cluster and [ECR](https://aws.amazon.com/ecr/) +This tutorial can be run against a [AWS EKS](https://aws.amazon.com/eks/) cluster and [ECR](https://aws.amazon.com/ecr/) @@ -124,13 +122,13 @@ used to create a _nginx_ deployment. Next, create `.dagger/env/default/plan/main.cue`. +defaultValue="kind" +groupId="provider" +values={[ +{label: 'kind', value: 'kind'}, +{label: 'GKE', value: 'gke'}, +{label: 'EKS', value: 'eks'}, +]}> @@ -138,12 +136,13 @@ Next, create `.dagger/env/default/plan/main.cue`. package main import ( + "dagger.io/dagger" "dagger.io/kubernetes" ) // input: ~/.kube/config file used for deployment -// set with `dagger input text kubeconfig -f ~/.kube/config` -kubeconfig: string @dagger(input) +// set with `dagger input secret kubeconfig -f ~/.kube/config` +kubeconfig: dagger.#Secret @dagger(input) // deploy uses the `dagger.io/kubernetes` package to apply a manifest to a // Kubernetes cluster. @@ -256,13 +255,13 @@ You can inspect the list of inputs (both required and optional) using `dagger in --> +defaultValue="kind" +groupId="provider" +values={[ +{label: 'kind', value: 'kind'}, +{label: 'GKE', value: 'gke'}, +{label: 'EKS', value: 'eks'}, +]}> @@ -307,13 +306,13 @@ eksConfig.clusterName string EKS cluster name Let's provide the missing inputs: +defaultValue="kind" +groupId="provider" +values={[ +{label: 'kind', value: 'kind'}, +{label: 'GKE', value: 'gke'}, +{label: 'EKS', value: 'eks'}, +]}> @@ -527,6 +526,7 @@ package main import ( "encoding/yaml" + "dagger.io/dagger" "dagger.io/docker" )