Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Docz #134

Merged
merged 33 commits into from
Jan 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
ef0f0e1
docs: switch to docz
sh0rez Dec 1, 2019
76bae81
feat: tutorial
sh0rez Dec 17, 2019
ae01a52
doc(tutorial): Using Jsonnet section
sh0rez Dec 17, 2019
9f0fdef
feat: custom theme
sh0rez Dec 17, 2019
9f1980b
wip: parameters
sh0rez Dec 17, 2019
670e02f
feat(docs): collapsing codeblocks
sh0rez Dec 18, 2019
ee1688b
fix(docs): font fixes
sh0rez Dec 18, 2019
1c079f1
feat(docs): description in header
sh0rez Dec 18, 2019
6a26b72
doc(tutorial): Abstraction
sh0rez Dec 18, 2019
24872d3
doc(example): remove vendor/
sh0rez Dec 18, 2019
33833a8
doc(tutorial): Kubernetes library
sh0rez Dec 19, 2019
89a97d0
fix(docs): link fixes
sh0rez Dec 19, 2019
f6e4744
doc(tutorial): environments
sh0rez Dec 19, 2019
ac92b0a
fix(docs): file update
sh0rez Dec 19, 2019
bea6007
doc: introduction
sh0rez Dec 19, 2019
5174756
doc: installation
sh0rez Dec 19, 2019
1efefeb
fix(docs): build using gatsby directly
sh0rez Dec 19, 2019
7fd730e
doc: README fixes
sh0rez Dec 19, 2019
c967a60
doc(tutorial): review feedback
sh0rez Dec 21, 2019
5c2a060
fix(examples): use upstream kausal in prom-grafana
sh0rez Dec 21, 2019
4216ddf
chore: netlify deploy dir
sh0rez Dec 21, 2019
fd857a6
chore(docs): add required vscode extensions in-tree
sh0rez Dec 22, 2019
83e4d91
chore(docs): remove unused files from vscext
sh0rez Dec 22, 2019
c3c472b
chore(docs): vscode highlighter debug
sh0rez Dec 22, 2019
5ffd519
feat(docs): PWA
sh0rez Dec 22, 2019
05101cf
feat(docs): remark enhancements
sh0rez Dec 22, 2019
9d03e61
fix(docs): GitHub button dimensions on mobile
sh0rez Dec 22, 2019
91bfbd0
style(docs): typos
sh0rez Jan 7, 2020
4572ec6
feat(docs): use #140 in tutorial
sh0rez Jan 7, 2020
942e5b2
feat(docs): next/previous buttons in tutorial
sh0rez Jan 7, 2020
7bffbca
style(docs): %s/our/their/g
sh0rez Jan 7, 2020
be8cfac
docs: libraries
sh0rez Jan 7, 2020
4738c27
fix(docs): update k-lib aliasing section
sh0rez Jan 8, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
125 changes: 24 additions & 101 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,118 +1,40 @@
# Overview
# Grafana Tanka

![Tanka Banner](docs/banner.png)
![Tanka Banner](docs/img/banner.png)

[![Build Status](https://cloud.drone.io/api/badges/grafana/tanka/status.svg)](https://cloud.drone.io/grafana/tanka)
![Golang](https://img.shields.io/badge/language-Go-blue)
![GitHub contributors](https://img.shields.io/github/contributors/grafana/tanka)
![GitHub release](https://img.shields.io/github/release/grafana/tanka)
![License](https://img.shields.io/github/license/grafana/tanka)

Tanka is a composable configuration utility for [Kubernetes](https://kubernetes.io/). It
leverages the [Jsonnet](https://jsonnet.org) language to realize flexible, reusable and
Tanka is a composable configuration utility for
[Kubernetes](https://kubernetes.io/). It leverages the
[Jsonnet](https://jsonnet.org) language to realize flexible, reusable and
concise configuration.

- **:repeat: `ksonnet` drop-in replacement**: Tanka aims to provide the same
workflow as `ksonnet`: `show`, `diff` and `apply` are just where you expect
them.
- **:nut_and_bolt: integrates with the ecosystem**: Tanka doesn't re-invent the
wheel. It rather makes heavy use of what is already there:
[`jsonnet-bundler`](https://github.com/jsonnet-bundler/jsonnet-bundler) for
package management and
[`kubectl`](https://kubernetes.io/docs/reference/kubectl/overview/) for
communicating with Kubernetes clusters.
- **:hammer: powerful:** Being a `jsonnet`-compatibility layer for Kubernetes,
it removes the limitations of static (or template-based) configuration languages.
- **:rocket: used in production**: We use Tanka internally at
Grafana Labs for all of our Kubernetes configuration needs.
- **:heart: fully open-source**: This is an open-source project. It is free as
## Highlights

- **:wrench: Flexible**: The
[Jsonnet data templating language](https://jsonnet.org) gives us much smarter
ways to express our Kubernetes configuration than YAML does.
- **:books: Reusable**: Code can be refactored into libraries, they can be
imported wherever you like and even shared on GitHub!
- **:pushpin: Concise**: Using the Kubernetes library and abstraction, you will
never see boilerplate again!
- **:dart: Work with confidence**: `tk diff` allows to check all changes before
they will be applied and `tk apply` makes sure you always select the correct
cluster. Stop guessing and make sure it's all good.
- **:rocket: Used in production**: While still a very young project, Tanka is
used internally at Grafana Labs for all of their Kubernetes configuration needs.
- **:heart: Fully open source**: This is an open-source project. It is free as
in beer and as in speech and this will never change.

## Getting started
Head over to the [Releases](https://github.com/grafana/tanka/releases) section
and download the most latest release of Tanka for your OS and arch.

Then check everything is working correctly with
```bash
$ tk --version
tk version v0.3.0
```

It is also recommended to install Jsonnet bundler:
```bash
$ go get -u github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb
```

### Creating a new project
To start from scratch with the recommended directory structure, do the following:

```bash
# create a directory and enter it
$ mkdir poetry && cd poetry

# initialize the Tanka application
$ tk init
```

### Deploying an application
As an example, [Promtail](https://github.com/grafana/loki/blob/master/docs/promtail/README.md) is being deployed using Tanka now.

After you initialized the directory structure, install the required libraries
using `jb`:
```bash
# Ksonnet kubernetes libraries
$ jb install github.com/ksonnet/ksonnet-lib/ksonnet.beta.4/k.libsonnet
$ jb install github.com/ksonnet/ksonnet-lib/ksonnet.beta.4/k8s.libsonnet

# Promtail library
$ jb install github.com/grafana/loki/production/ksonnet/promtail
```

Then, replace the contents of `environments/default/main.jsonnet` with the
following:

```js
local promtail = import 'promtail/promtail.libsonnet';

promtail + {
_config+:: {
namespace: 'loki',

promtail_config+: {
clients: [
{
scheme:: 'https',
hostname:: 'logs-us-west1.grafana.net',
username:: 'user-id',
password:: 'password',
external_labels: {},
}
],
container_root_path: '/var/lib/docker',
},
},
}

```

As a last step, fill add the correct `spec.apiServer` and `spec.namespace` to
`environments/default/spec.json`:

```json
{
"apiVersion": "tanka.dev/v1alpha1",
"kind": "Environment",
"spec": {
"apiServer": "https://localhost:6443",
"namespace": "default"
}
}
```

Now use `tk show environments/default` to see the `yaml`, and
`tk apply environments/default` to apply it to the cluster.

Congratulations! You have successfully set up your first application using Tanka :tada:
To get started, [install Tanka](https://tanka.dev/install) first, and then
[follow the tutorial](https://tanka.dev/tutorial/overview2). This should get you
on track quickly.

## Additional resources

Expand All @@ -122,4 +44,5 @@ Congratulations! You have successfully set up your first application using Tanka
rich set of configuration examples compatible with Tanka.

## License

Licensed Apache 2.0, see [LICENSE](LICENSE).
75 changes: 75 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
.docz

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
jspm_packages/

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# dotenv environment variable files
.env*

# gatsby files
public
.cache

# Mac files
.DS_Store

# Yarn
yarn-error.log
.pnp/
.pnp.js
# Yarn Integrity file
.yarn-integrity

# gatsby-remark-vscode extensions are required tho
node_modules/*
!/node_modules/vscext
!/node_modules/vscext/*
4 changes: 4 additions & 0 deletions docs/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.cache
package.json
package-lock.json
public
7 changes: 7 additions & 0 deletions docs/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"endOfLine": "lf",
"semi": false,
"singleQuote": false,
"tabWidth": 2,
"trailingComma": "es5"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
<Default Extension=".json" ContentType="application/json"/><Default Extension=".js" ContentType="application/javascript"/><Default Extension=".txt" ContentType="text/plain"/><Default Extension=".png" ContentType="image/png"/><Default Extension=".css" ContentType="text/css"/><Default Extension=".html" ContentType="text/html"/><Default Extension=".md" ContentType="text/markdown"/><Default Extension=".vsixmanifest" ContentType="text/xml"/>
</Types>
42 changes: 42 additions & 0 deletions docs/.vscext/Equinusocio.vsc-material-theme/extension.vsixmanifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Language="en-US" Id="vsc-material-theme" Version="30.0.0" Publisher="Equinusocio"/>
<DisplayName>Material Theme</DisplayName>
<Description xml:space="preserve">The most epic theme now for Visual Studio Code</Description>
<Tags>VSCode,Themes,theme,color-theme</Tags>
<Categories>Themes,Other</Categories>
<GalleryFlags>Public</GalleryFlags>
<Badges><Badge Link="https://github.com/equinusocio/vsc-material-theme/issues" ImgUri="https://camo.githubusercontent.com/d3c6e53aa66426dead24cdedab0e83082103bea6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f657175696e75736f63696f2f7673632d6d6174657269616c2d7468656d652e7376673f7374796c653d666c61742d737175617265" Description="Open issues" /><Badge Link="https://opencollective.com/vsc-material-theme" ImgUri="https://img.shields.io/badge/Support%20this%20project-%F0%9F%92%96%EF%B8%8F-green.svg?style=flat-square" Description="Support us!" /></Badges>
<Properties>
<Property Id="Microsoft.VisualStudio.Code.Engine" Value="&gt;=1.36.0" />
<Property Id="Microsoft.VisualStudio.Code.ExtensionDependencies" Value="" />
<Property Id="Microsoft.VisualStudio.Code.ExtensionPack" Value="" />
<Property Id="Microsoft.VisualStudio.Code.LocalizedLanguages" Value="" />

<Property Id="Microsoft.VisualStudio.Services.Links.Source" Value="https://github.com/equinusocio/vsc-material-theme.git" />
<Property Id="Microsoft.VisualStudio.Services.Links.Getstarted" Value="https://github.com/equinusocio/vsc-material-theme.git" />

<Property Id="Microsoft.VisualStudio.Services.Links.GitHub" Value="https://github.com/equinusocio/vsc-material-theme.git" />


<Property Id="Microsoft.VisualStudio.Services.Links.Support" Value="https://github.com/equinusocio/vsc-material-theme/issues" />
<Property Id="Microsoft.VisualStudio.Services.Links.Learn" Value="https://equinsuocha.io/projects/material-theme/" />
<Property Id="Microsoft.VisualStudio.Services.Branding.Color" Value="#11131C" />
<Property Id="Microsoft.VisualStudio.Services.Branding.Theme" Value="dark" />
<Property Id="Microsoft.VisualStudio.Services.GitHubFlavoredMarkdown" Value="true" />


</Properties>
<License>extension/LICENSE.txt</License>
<Icon>extension/logo.png</Icon>
</Metadata>
<Installation>
<InstallationTarget Id="Microsoft.VisualStudio.Code"/>
</Installation>
<Dependencies/>
<Assets>
<Asset Type="Microsoft.VisualStudio.Code.Manifest" Path="extension/package.json" Addressable="true" />
<Asset Type="Microsoft.VisualStudio.Services.Content.Details" Path="extension/README.md" Addressable="true" /><Asset Type="Microsoft.VisualStudio.Services.Content.License" Path="extension/LICENSE.txt" Addressable="true" /><Asset Type="Microsoft.VisualStudio.Services.Icons.Default" Path="extension/logo.png" Addressable="true" />
</Assets>
</PackageManifest>
Loading