Skip to content

Commit

Permalink
📖 Add Netlify book
Browse files Browse the repository at this point in the history
  • Loading branch information
Cecile Robert-Michon committed Aug 20, 2020
1 parent 6fb7fc1 commit ec590aa
Show file tree
Hide file tree
Showing 25 changed files with 900 additions and 2 deletions.
36 changes: 36 additions & 0 deletions docs/book/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright 2020 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Directories.
ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
TOOLS_DIR := ../../hack/tools
TOOLS_BIN_DIR := $(TOOLS_DIR)/bin
BIN_DIR := bin

# Binaries.
TABULATE := $(TOOLS_BIN_DIR)/mdbook-tabulate
$(TABULATE): $(TOOLS_DIR)/go.mod
cd $(TOOLS_DIR); go build -tags=tools -o $(BIN_DIR)/mdbook-tabulate ./mdbook/tabulate

EMBED := $(TOOLS_BIN_DIR)/mdbook-embed
$(EMBED): $(TOOLS_DIR)/go.mod
cd $(TOOLS_DIR); go build -tags=tools -o $(BIN_DIR)/mdbook-embed ./mdbook/embed

RELEASELINK := $(TOOLS_BIN_DIR)/mdbook-releaselink
$(RELEASELINK): $(TOOLS_DIR)/go.mod
cd $(TOOLS_DIR); go build -tags=tools -o $(BIN_DIR)/mdbook-releaselink ./mdbook/releaselink

.PHONY: serve
serve:
mdbook serve
5 changes: 5 additions & 0 deletions docs/book/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# See the OWNERS docs at https://go.k8s.io/owners

reviewers:
- cluster-api-azure-maintainers
- cluster-api-azure-reviewers
19 changes: 19 additions & 0 deletions docs/book/book.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[book]
authors = ["The Cluster API Provider Azure Maintainers"]
language = "en"
multilingual = false
src = "src"
title = "The Cluster API Provider Azure Book"

[output.html]
curly-quotes = true
git-repository-url = "https://sigs.k8s.io/cluster-api-provider-azure"

[preprocessor.tabulate]
command = "./util-tabulate.sh"

[preprocessor.embed]
command = "./util-embed.sh"

[preprocessor.releaselink]
command = "./util-releaselink.sh"
64 changes: 64 additions & 0 deletions docs/book/install-and-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/bin/bash

# Copyright 2020 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -o errexit
set -o nounset
set -o pipefail

KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/../..
cd "${KUBE_ROOT}" || exit 1

os=$(go env GOOS)
arch=$(go env GOARCH)

# translate arch to rust's conventions (if we can)
if [[ ${arch} == "amd64" ]]; then
arch="x86_64"
elif [[ ${arch} == "x86" ]]; then
arch="i686"
fi

# translate os to rust's conventions (if we can)
ext="tar.gz"
cmd="tar -C /tmp -xzvf"
case ${os} in
windows)
target="pc-windows-msvc"
ext="zip"
cmd="unzip -d /tmp"
;;
darwin)
target="apple-darwin"
;;
linux)
# works for linux, too
target="unknown-${os}-gnu"
;;
*)
target="unknown-${os}"
;;
esac

# grab mdbook
# we hardcode linux/amd64 since rust uses a different naming scheme
echo "downloading mdBook-v0.3.1-${arch}-${target}.${ext}"
set -x
curl -sL -o /tmp/mdbook.${ext} "https://github.com/rust-lang-nursery/mdBook/releases/download/v0.3.1/mdBook-v0.3.1-${arch}-${target}.${ext}"
${cmd} /tmp/mdbook.${ext}
chmod +x /tmp/mdbook

# Finally build the book.
(cd docs/book && /tmp/mdbook build)
15 changes: 15 additions & 0 deletions docs/book/src/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Summary

[Introduction](./introduction.md)
- [Topics](./topics/topics.md)
- [Cloud Provider Config](./topics/cloud-provider-config.md)
- [Custom Images](./topics/custom-images.md)
- [Data Disks](./topics/data-disks.md)
- [Ephemeral OS](./topics/ephemeral-os.md)
- [External Cloud Provider](./topics/external-cloud-provider.md)
- [Failure Domains](./topics/failure-domains.md)
- [Identity](./topics/identity.md)
- [Machine Pools (VMSS)](./topics/machinepools.md)
- [Managed Clusters (AKS)](./topics/managedcluster.md)
- [Spot Virtual Machines](./topics/spot-vms.md)
- [Virtual Networks](./topics/custom-vnet.md)
1 change: 1 addition & 0 deletions docs/book/src/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{#include ../../../README.md}}
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Custom Vnets
# Custom Virtual Networks

## Pre-existing vnet and subnets

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ corresponding error on the AzureMachine object.

## Example

The below example shows how to enable ephemeral OS for a machine template. For control plane nodes, we strongly recommend using [etcd data disks](./data-disks.md)to avoid data loss.
The below example shows how to enable ephemeral OS for a machine template. For control plane nodes, we strongly recommend using [etcd data disks](data-disks.md)to avoid data loss.

````yaml
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions docs/book/src/topics/topics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Topics

This section contains information about enable and configure various Azure features with Cluster API Provider Azure.
Loading

0 comments on commit ec590aa

Please sign in to comment.