Commit 425e1687 authored by Arie Peterson's avatar Arie Peterson

Add website CI and first website contents

parent 4a0a5c47
Pipeline #7224 passed with stage
in 36 seconds
docs/_build
stages:
- build
- deploy
image: library/python:3.6-alpine
variables:
FTP_USER: 'webmaster_greenhost_nl'
DOMAIN_NAME: 'greenhost.net'
build:
stage: build
script:
# Install sphinx
- pip install sphinx recommonmark
- apk update
- apk add make
# Build the website
- cd docs && make html
artifacts:
paths:
- docs/_build/html
expire_in: 1 week
deploy-master:
stage: deploy
environment:
name: master
url: ghost.greenhost.net
only:
- '/^master$/'
variables:
SUBDOMAIN: 'ghost'
script:
- apk update
- apk add openssh-client rsync bash
- cd docs && ./deploy.sh
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = python3 -msphinx
SPHINXPROJ = Ghost
SOURCEDIR = .
BUILDDIR = _build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Ghost documentation build configuration file.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
from recommonmark.parser import CommonMarkParser
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = []
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# Support writing in Markdown
source_parsers = {
'.md': CommonMarkParser,
}
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = ['.rst', '.md']
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = 'Ghost'
copyright = '2019, <a href="https://greenhost.net"/>Greenhost</a>'
author = 'Greenhost'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '0.1'
# The full version, including alpha/beta/rc tags.
release = '0.1'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = 'en'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False
# -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# This is required for the alabaster theme
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
html_sidebars = {
'**': [
'about.html',
'navigation.html',
'relations.html', # needs 'show_related': True theme option to display
'searchbox.html',
'donate.html',
]
}
# -- Options for HTMLHelp output ------------------------------------------
# Output file base name for HTML help builder.
htmlhelp_basename = 'Ghostdoc'
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'Ghost.tex', 'Ghost Documentation',
'Greenhost', 'manual'),
]
# -- Options for manual page output ---------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'cryptops', 'Ghost Documentation',
[author], 1)
]
# -- Options for Texinfo output -------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'Ghost', 'Ghost Documentation',
author, 'Ghost', 'One line description of project.',
'Miscellaneous'),
]
#!/bin/bash
# Deploy HTML documentation directory. Must be run from docs directory.
# Run ssh-agent and add ssh key.
eval $(ssh-agent -s)
echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
# Add server's ssh host key to known hosts.
mkdir -p ~/.ssh
chmod 700 ~/.ssh
[[ -f /.dockerenv ]] && echo "$SSH_SERVER_HOSTKEYS" > ~/.ssh/known_hosts
# Upload site.
rsync -r --verbose --compress --delete ./_build/html/* \
"${FTP_USER}@ftp.greenhost.nl:${DOMAIN_NAME}/${SUBDOMAIN}"
.. Ghost documentation master file.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Ghost: Greenhost cloud storage engine for Kubernetes
====================================================
Greenhost cloud and eclips.is
-----------------------------
Greenhost operates two cloud platforms:
* `eclips.is`_ is free (funded by Open
Technology Fund) for Internet freedom and liberation technology developers,
administrators and digital rights activists.
* the `Greenhost cloud`_ is a paid cloud platform, open to anyone.
Storage in our platforms is provided by our own fully redundant Ceph-based
storage system, so you don't need to use one of the big commercial cloud
companies.
Kubernetes at Greenhost
-----------------------
Besides regular stand-alone VPSs, you can also use any of our cloud platforms
to create a Kubernetes cluster spanning multiple virtual machines.
``ghost`` is a custom Kubernetes component that allows your cluster to
seemlessly provision persistent volumes on our cloud storage platform.
It consists of two components:
* a storage provisioner that detects requests for
storage (so-called Persistent Volume Claims, or PVCs) and creates Ceph-backed
virtual disks on the fly to meet the storage demands;
* a storage driver that is called by Kubernetes at the right moments to attach
these virtual disks to the virtual machines that need them, and mount the
filesystems to the right Kubernetes pod.
See the :doc:`setup instructions <setup>` to get started.
The code is available at `<https://code.greenhost.net/open/kubernetes-ghost>`_.
.. _Greenhost: https://greenhost.net
.. _Greenhost cloud: https://greenhost.net/products/vps/
.. _eclips.is: https://eclips.is
.. toctree::
:maxdepth: 2
:caption: Contents:
setup
.. Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
Setup
=====
This page provides information to help you set up ghost for your Kubernetes
cluster on the Greenhost cloud. Currently this process requires a manual
confirmation by Greenhost employees, so you will need our support at some
point.
Prerequisites
-------------
* a Kubernetes platform running on the Greenhost cloud platform, or on eclips.is;
* a functioning `Helm`_ install for that cluster.
Set permissions
---------------
The ghost storage provisioner will need to use Greenhost's API to create (and
delete) virtual disks, based on requests by the Kubernetes cluster. Because
this has obvious implications for security, and also incurs costs for the
virtual disks to the account owner, this needs special permissions to be set
for the machines that make up the cluster. We made this a manual step for now
that needs to be taken by Greenhost employees.
Please contact `our support team <Greenhost support_>`_ to request these
changes, including a list of VPSs that make up the cluster, and optionally a
label we use internally to identify the cluster for future reference.
Install ghost
-------------
1. Clone the ghost repository to the machine that you run Helm from, typically
your workstation or laptop:
::
git clone https://code.greenhost.net/open/kubernetes-ghost.git
cd kubernetes-ghost
2. (optional) Review the ``values.yaml`` in the top-level directory, and change as you see fit. The defaults should give you a working setup.
3. Install the ghost components to your cluster:
::
helm install --name=my-personal-ghost .
Check installation
------------------
You can check that the provisioner and driver are running:
::
kubectl get pod -n kube-system
Should list among other things a single ``greenhost-provisioner`` pod, and one
``ghost-driver`` pod on per worker node.
If you now create a Persistent Volume Claim, the provisioner should pick this up and create a corresponding Persistent Volume. You can also check that virtual disks appear in the `listing <Greenhost cloud disk listing_>`_.
.. _Helm: https://helm.sh
.. _Greenhost support: mailto:support@greenhost.net
.. _Greenhost cloud disk listing: https://service.greenhost.net/cloud/DiskImage
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment