diff --git a/hack/helm-up.sh b/hack/helm-up.sh deleted file mode 100755 index d167357..0000000 --- a/hack/helm-up.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -set -e - -echo "Adding the Helm incubator repo as some of our optional dependencies live here....." -helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com/ - -echo "Applying RBAC policies for Helm....." -kubectl apply -f ./hack/helm-rbac.yaml - -echo "Bootstrapping Helm....." -helm init --service-account tiller - -echo "Waiting for Helm to become ready....." -kubectl rollout status -w deployment/tiller-deploy --namespace=kube-system - -echo "Installing our optional dependencies....." -helm dep up ./helm - -echo "Deploying Kanali....." -helm install ./helm --name kanali - -echo "Helm deployment of Kanali successful!" \ No newline at end of file diff --git a/helm/kanali/templates/configmap-kanali.yaml b/helm/kanali/templates/configmap-kanali.yaml index 8810124..a835a3a 100644 --- a/helm/kanali/templates/configmap-kanali.yaml +++ b/helm/kanali/templates/configmap-kanali.yaml @@ -12,10 +12,10 @@ data: [plugins.apiKey] decryption_key_file = "/etc/pki/key.pem" - header_key = {{default "apikey" .Values.kanali.gateway.plugins.apikey.headerKey}} + header_key = {{default "apikey" .Values.kanali.gateway.plugins.apikey.headerKey | quote}} [process] - log_level = {{default "info" .Values.kanali.logLevel}} + log_level = {{default "info" .Values.kanali.logLevel | quote}} [profiling] insecure_port = {{.Values.kanali.profiler.insecurePort}} @@ -29,11 +29,11 @@ data: [proxy] enable_cluster_ip = true - header_mask_Value = omitted + header_mask_Value = "omitted" enable_mock_responses = true upstream_timeout = "0h0m10s" mask_header_keys = [ - {{default "apikey" .Values.kanali.gateway.plugins.apikey.headerKey}} + {{default "apikey" .Values.kanali.gateway.plugins.apikey.headerKey | quote}} ] tls_common_name_validation = true diff --git a/hugo/content/docs/v2/contributing.md b/hugo/content/docs/v2/contributing.md deleted file mode 100644 index c9f3fd7..0000000 --- a/hugo/content/docs/v2/contributing.md +++ /dev/null @@ -1,16 +0,0 @@ -+++ -date = "2017-04-10T16:41:54+01:00" -weight = 110 -description = "Learn how to contribute to Kanali" -title = "Contributing" -draft = false -bref= "Learn how to contribute to Kanali" -toc = true -+++ - -### Getting Started -### Testing -### Project Structure -### Imports Grouping -### Making a Change -### License \ No newline at end of file diff --git a/hugo/content/docs/v2/deployment.md b/hugo/content/docs/v2/deployment.md index ce485d1..3c11ffa 100644 --- a/hugo/content/docs/v2/deployment.md +++ b/hugo/content/docs/v2/deployment.md @@ -8,4 +8,76 @@ bref= "Learn how to deploy Kanali" toc = true +++ -### Coming soon \ No newline at end of file +### Helm + +> This is the recommended deployment option. + +[Helm](https://helm.sh) is a package manager for Kubernetes. Helm makes it easy to deploy all the components of an application and its dependencies. + +Kanali's Helm chart can be found [here](https://github.com/northwesternmutual/kanali/tree/master/helm/kanali). Before demonstrating how to use this chart, let's bootstrap a local Kubernetes environment so that you can follow along. + +``` +# Start a local Kubernetes cluster. +$ minikube start --kubernetes-version=v1.9.4 --feature-gates CustomResourceValidation=true + +# Update a potentially stale kubeconfig context. +$ minikube update-context +Kubeconfig IP correctly configured, pointing at 192.168.64.24 + +# Verify that our cluster is ready. +$ kubectl get nodes +NAME STATUS ROLES AGE VERSION +minikube Ready 17h v1.9.4 +``` + +Now that we have have a running cluster, the Kanali Helm chart can be deployed by executing the following commands. + +``` +# Retrieve a local copy of Kanali. This is necessary because Kanali does not +# yet live in a chart repository. +$ git clone https://github.com/northwesternmutual/kanali.git + +# To ensure that Helm has the appropriate permissions to deploy our chart, +# we need to create an RBAC policy and a service account. +$ kubectl apply -f kanali/hack/helm-rbac.yaml + +# Bootstrap helm using the service account created in the previous step. +$ helm init --service-account tiller + +# One of the optional dependencies for Kanali is Jaeger, whose chart lives in the following repo. +$ helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com/ + +# Install any required dependencies. +$ helm dep up kanali/helm/kanali + +# Install the Kanali chart (note the relative path to the chart). +$ helm install --name kanali kanali/helm/kanali +``` + +Kanali is now deployed. Note that the default set of Helm values were used. You will probably want to overwrite some of these values for your deployment. All of the values that you can customize can be found [here](https://github.com/northwesternmutual/kanali/tree/master/helm/kanali). Instructions on how to set your custom values can be found [here](https://docs.helm.sh/developing_charts/#charts). + +We can wait for it to complete its bootstrapping process with the following command. + +``` +$ kubectl rollout status -w deployment/kanali --namespace=default +``` + +Now that Kanali is ready to be used, we can test our installation with the following command. By default, Kanali will bootstrap itself with a set of self signed certificates which is why our https request is insecure. + +``` +$ curl --insecure $(minikube service kanali-gateway --url --format="https://{{.IP}}:{{.Port}}") +{ + "status": 404, + "message": "No ApiProxy resource was not found that matches the request.", + "code": 0, + "details": "Visit https://kanali.io/docs/v2/errorcodes for more details." +} +``` + +**Configurations!** You have successfully bootstrapped Kanali using Helm. To learn more, visit the [tutorial](https://kanali.io/tutorial). + +### Manual + +If you like to deploy Kanali a different way, there are just a few things you need to know. + +Kanali's artifact is a [Docker](https://www.docker.com/) image. When starting this container, you will need to specify your own configuration arguments if you would like to overwrite the defaults. This can be accomplished by specifying one or more flags, environment variables and/or configuration file updates. Specific details for these configuration items can be found [here](https://kanali.io/docs/v2/flags). diff --git a/hugo/content/docs/v2/flags.md b/hugo/content/docs/v2/flags.md new file mode 100644 index 0000000..8e035ab --- /dev/null +++ b/hugo/content/docs/v2/flags.md @@ -0,0 +1,11 @@ ++++ +description = "Configuration flags" +title = "Flags" +date = "2017-04-10T16:43:08+01:00" +draft = false +weight = 100 +bref="Configuration flags" +toc = true ++++ + +### foo \ No newline at end of file diff --git a/hugo/content/docs/v2/quick-start.md b/hugo/content/docs/v2/quick-start.md deleted file mode 100644 index 9a9c7c9..0000000 --- a/hugo/content/docs/v2/quick-start.md +++ /dev/null @@ -1,11 +0,0 @@ -+++ -description = "tl;dr" -title = "Quick Start" -date = "2017-04-10T16:43:08+01:00" -draft = false -weight = 10 -bref="Minimal docs to get up and running" -toc = true -+++ - -### Coming soon \ No newline at end of file diff --git a/hugo/content/docs/v2/security.md b/hugo/content/docs/v2/security.md new file mode 100644 index 0000000..b7715eb --- /dev/null +++ b/hugo/content/docs/v2/security.md @@ -0,0 +1,11 @@ ++++ +description = "Securing Kanali" +title = "Security" +date = "2017-04-10T16:43:08+01:00" +draft = false +weight = 100 +bref="Securing Kanali" +toc = true ++++ + +### foo \ No newline at end of file diff --git a/hugo/content/docs/v2/tools.md b/hugo/content/docs/v2/tools.md new file mode 100644 index 0000000..0a5cf2e --- /dev/null +++ b/hugo/content/docs/v2/tools.md @@ -0,0 +1,11 @@ ++++ +date = "2017-04-10T16:41:16+01:00" +weight = 70 +description = "Developer tooling" +title = "Tools" +draft = false +bref = "Developer tooling" +toc = true ++++ + +### Coming soon \ No newline at end of file diff --git a/pkg/errors/errors.go b/pkg/errors/errors.go index 1669175..de13b1c 100644 --- a/pkg/errors/errors.go +++ b/pkg/errors/errors.go @@ -40,7 +40,7 @@ func (e Error) String() string { } const ( - moreDetails = "Visit https://kanali.io/docs/errorcodes for more details." + moreDetails = "Visit https://kanali.io/docs/v2/errorcodes for more details." ) var (