Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_preview
11 changes: 11 additions & 0 deletions _distro_map.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
atomic_host_docs:
name: Atomic Host
author: Project Atomic Documentation Project <atomic@projectatomic.io>
site: main
site_name: Atomic Host Documentation
site_url: http://docs.projectatomic.io/
branches:
master:
name: Latest
dir: latest
Binary file added _images/project_atomic_horizontal_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file added _javascripts/.gitkeep
Empty file.
6 changes: 6 additions & 0 deletions _javascripts/bootstrap-offcanvas.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$(document).ready(function () {
$('[data-toggle="offcanvas"]').click(function () {
$('.sidebar').show();
$('.row-offcanvas').toggleClass('active');
});
});
568 changes: 568 additions & 0 deletions _stylesheets/asciibinder.css

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions _templates/_css.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<%- Dir.glob("_stylesheets/*").sort.each do |sheet| -%>
<link href="<%= File.join(css_path, File.basename(sheet)) %>" rel="stylesheet" />
<%- end -%>
31 changes: 31 additions & 0 deletions _templates/_nav.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<ul class="nav nav-sidebar">
<%- navigation.each.with_index do |topic_group, groupidx| -%>
<%- current_group = topic_group[:id] == group_id -%>
<li class="nav-header">
<a class="" href="#" data-toggle="collapse" data-target="#topicGroup<%= groupidx %>">
<span id="tgSpan<%= groupidx %>" class="fa <%= current_group ? 'fa-angle-down' : 'fa-angle-right' %>"></span><%= topic_group[:name] %>
</a>
<ul id="topicGroup<%= groupidx %>" class="collapse <%= current_group ? 'in' : '' %> list-unstyled">
<%- topic_group[:topics].each.with_index do |topic, topicidx| -%>
<%- if not topic.has_key?(:topics) -%>
<%- current_topic = current_group && (topic[:id] == topic_id) -%>
<li><a class="<%= current_topic ? ' active' : '' %>" href="<%= subtopic_shim %><%= topic[:path] %>"><%= topic[:name] %></a></li>
<%- else -%>
<%- current_subgroup = topic[:id] == subgroup_id -%>
<li class="nav-header">
<a class="" href="#" data-toggle="collapse" data-target="#topicSubGroup-<%= groupidx %>-<%= topicidx %>">
<span id="sgSpan-<%= groupidx %>-<%= topicidx %>" class="fa <%= current_subgroup ? 'fa-caret-down' : 'fa-caret-right' %>"></span>&nbsp;<%= topic[:name] %>
</a>
<ul id="topicSubGroup-<%= groupidx %>-<%= topicidx %>" class="nav-tertiary list-unstyled collapse<%= current_subgroup ? ' in' : '' %>">
<%- topic[:topics].each do |subtopic| -%>
<%- current_subtopic = current_group && current_subgroup && (subtopic[:id] == topic_id) %>
<li><a class="<%= current_subtopic ? ' active' : '' %>" href="<%= subtopic_shim %><%= subtopic[:path] %>"><%= subtopic[:name] %></a></li>
<%- end -%>
</ul>
</li>
<%- end -%>
<%- end -%>
</ul>
</li>
<%- end -%>
</ul>
84 changes: 84 additions & 0 deletions _templates/page.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta content="IE=edge" http-equiv="X-UA-Compatible">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<title><%= distro %> <%= version %> | <%= [group_title, subgroup_title, topic_title].compact.join(' | ') %></title>

<!-- Bootstrap -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">

<%= render("_templates/_css.html.erb", :css_path => css_path) %>
<script src="<%= File.join(javascripts_path, "bootstrap-offcanvas.js") %>" type="text/javascript"></script>

<meta content="AsciiBinder" name="application-name">
</head>
<body>
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="http://www.projectatomic.io/"><img alt="ProjectAtomic" src="<%= File.join(images_path, "project_atomic_horizontal_logo.png") %>" height="100"></a>
</div>
</div>
</div>
<div class="container">
<p class="toggle-nav visible-xs pull-left">
<button class="btn btn-default btn-sm" type="button" data-toggle="offcanvas">Toggle nav</button>
</p>
<ol class="breadcrumb">
<li class="sitename">
<a href="<%= site_home_path %>"><%= site_name %></a>
</li>
<li class="hidden-xs active">
<%= breadcrumb_root %>
</li>
<li class="hidden-xs active">
<%= breadcrumb_group %>
</li>
<%= breadcrumb_subgroup_block %>
<li class="hidden-xs active">
<%= breadcrumb_topic %>
</li>
</ol>
<div class="row row-offcanvas row-offcanvas-left">
<div class="col-xs-8 col-sm-3 col-md-3 sidebar sidebar-offcanvas">
<%= render("_templates/_nav.html.erb", :navigation => navigation, :group_id => group_id, :topic_id => topic_id, :subgroup_id => subgroup_id, :subtopic_shim => subtopic_shim) %>
</div>
<div class="col-xs-12 col-sm-9 col-md-9 main">
<div class="page-header">
<h2><%= article_title %></h2>
</div>
<%= content %>
</div>
</div>
</div>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script type="text/javascript">
/*<![CDATA[*/
$(document).ready(function() {
$("[id^='topicGroup']").on('show.bs.collapse', function (event) {
if (!($(event.target).attr('id').match(/^topicSubGroup/))) {
$(this).parent().find("[id^='tgSpan']").toggleClass("fa-angle-right fa-angle-down");
}
});
$("[id^='topicGroup']").on('hide.bs.collapse', function (event) {
if (!($(event.target).attr('id').match(/^topicSubGroup/))) {
$(this).parent().find("[id^='tgSpan']").toggleClass("fa-angle-right fa-angle-down");
}
});
$("[id^='topicSubGroup']").on('show.bs.collapse', function () {
$(this).parent().find("[id^='sgSpan']").toggleClass("fa-caret-right fa-caret-down");
});
$("[id^='topicSubGroup']").on('hide.bs.collapse', function () {
$(this).parent().find("[id^='sgSpan']").toggleClass("fa-caret-right fa-caret-down");
});
});
/*]]>*/
</script>
</body>
</html>
42 changes: 42 additions & 0 deletions _topic_map.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# This configuration file dictates the organization of the topic groups and
# topics on the main page of the doc site for this branch. Each record
# consists of the following:
#
# --- <= Record delimiter
# Name: Origin of the Species <= Display name of topic group
# Dir: origin_of_the_species <= Directory name of topic group
# Topics:
# - Name: The Majestic Marmoset <= Topic name
# File: the_majestic_marmoset <= Topic file under group dir +/- .adoc
# - Name: The Curious Crocodile <= Topic 2 name
# File: the_curious_crocodile <= Topic 2 file
# - Name: The Numerous Nematodes <= Sub-topic group name
# Dir: the_numerous_nematodes <= Sub-topic group dir
# Topics:
# - Name: The Wily Worm <= Sub-topic name
# File: the_wily_worm <= Sub-topic file under <group dir>/<subtopic dir>
# - Name: The Acrobatic Ascarid <= Sub-topic 2 name
# File: the_acrobatic_ascarid <= Sub-topic 2 file under <group dir>/<subtopic dir>
#
# The ordering of the records in this document determines the ordering of the
# topic groups and topics on the main page.
---
Name: About
Dir: welcome
Topics:
- Name: Welcome
File: index

---
Name: Tools
Dir: atomic-host-guide
Topics:
- Name: Cockpit
Dir: cockpit
Topics:
- Name: Overview
File: overview
- Name: Installation
File: installing_cockpit
- Name: How to Use
File: using_cockpit
94 changes: 94 additions & 0 deletions atomic-host-guide/cockpit/installing_cockpit.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
=== Setting up a Cockpit server

A Cockpit server is the machine that is running the cockpit service and exposes the user interface. Depending on the operating system, you need to install the _cockpit_ packages or the _cockpit-ws_ container. You can then open the interface in a browser by typing _localhost:9090_, or use any other machine and type in the IP address of the Cockpit server. Through Cockpit, you can also add more secondary hosts to this primary server. They need to have the cockpit packages installed on them. This document refers to the Cockpit server as the primary server and the added hosts as secondary.

==== Installing Cockpit

*A.* On Red Hat Enterprise Linux Atomic Host

1. Run the *cockpit-ws* image. Use this command:
+
....
-bash-4.2# atomic run rhel7/cockpit-ws
....

Afterwards, you can log into Cockpit. Go to xref:opening_the_interface[Opening The Interface]

*B.* On Red Hat Enterprise Linux

1. Once you have Red Hat Enterprise Linux installed and with enabled networking, you need to register the system and enable the Extras and Optional repositories:
+
....
# subscription-manager register --auto-attach --username=<rhnuser> --password=<rhnpasswd>
# subscription-manager repos --enable=rhel-7-server-extras-rpms
# subscription-manager repos --enable=rhel-7-server-optional-rpms
....

1. Allow external connections to port 9090 through the firewall:
+
....
# firewall-cmd --add-port=9090/tcp
# firewall-cmd --permanent --add-port=9090/tcp
....

1. Install the _cockpit_ packages:
+
....
$ sudo yum install cockpit
....

1. Enable and start the cockpit.socket service:
+
....
$ sudo systemctl enable cockpit.socket
$ sudo systemctl start cockpit.socket
....

==== Opening The Interface

[[opening_the_interface]]

1. Open a web browser and enter the server's IP address with port 9090 in the address bar. If the web browser is on the Cockpit server, open _localhost:9090_ or _hostname:9090_. If you get a security warning by the browser, you will need to add this connection to the security exceptions. Click *Advanced* -> *Add Exception* -> *Confirm Security Exception*. After that, you will see the login screen:
+
image:cockpit_login_rhel.png[caption="Cockpit login screen", title="Cockpit Login Screen", alt="Sunset"]

1. Log into the Cockpit interface with the same user name and password that you would use to log into the Atomic system.

==== Changing Expired Passwords

If there is an account on your Atomic system that has an expired password, you can change it from Cockpit. For example, if you have provisioned your system using *cloud-init* to set up an expired password, you will be prompted to change it the first time you log into the system. It can also be used by system administrators who want to make sure the user changes his password on the first login.

// image:password_login.png[caption="Cockpit Login", title="Cockpit Login", alt="Sunset"]

When you try to log in with the usual password and that password has expired, Cockpit will prompt you to enter the current password again. Enter your current password and click *Login*.

image:password_current.png[caption="Current Password", title="Current Password", alt="Sunset"]

Choose a new password and click *Login*.

image:password_new.png[caption="New Password", title="New Password", alt="Sunset"]


[NOTE]
If you can't log into Cockpit and you are not redirected to the changing password screen, check the `/etc/ssh/sshd_config` file on the Cockpit Server and make sure the `ChallengeResponseAuthentication` line is set to `yes`. After that, restart `sshd` with the `systemctl restart sshd` command.

==== SSH two-factor authentication with Cockpit

Cockpit now supports two-factor authentication so if you have protected your SSH server with such configuration, the Cockpit login screen will prompt you to enter your password and PIN pair. To set up SSH for two-factor authentication you need two components:

* Your company's authenticator application that provides one-time passwords or PIN numbers. An example application is the `Google Authenticator`, which also has its own PAM (Pluggable Authentication Module).
* A server that validates the PINs from your dongle.

These two components can be built in many different ways depending on the infrastructure of your particular company. When you have these two set up, you will need to do the following things:

1. Enter the following line in the `/etc/pam.d/sshd` file as the last `auth` line:
+
....
auth required <your_PAM_module>
....

2. Edit the `/etc/ssh/sshd_config` file so that the `ChallengeResponseAuthentication` line is set to `yes`.

3. Restart the `sshd` service with the `systemctl restart shhd` command.

When you open Cockpit's interface, and enter your password, you will then be prompted to enter your Verification code:
22 changes: 22 additions & 0 deletions atomic-host-guide/cockpit/overview.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Cockpit is a system administration tool that provides a user interface for monitoring and administering servers through a web browser. It allows you to monitor current values and adjust limits on system resources, control life cycle on container instances, and manipulate container images. Here are a few important facts about Cockpit:

* Cockpit does not add a layer of other functionalities that are not present on your systems. It exposes user interface elements that enable you to interact with the system.

* Cockpit does not take control over your servers, in a way that when you configure something from Cockpit, you can only manage it from there. You can effectively move away from Cockpit to the command-line and come back to it at any point.

* Cockpit does not require configuration or infrastructure, and once you install it, it is ready for use. You could, however, configure it to make use of the authentication infrastructure that is available to you, for example a single sign-on system like Kerberos.

* Cockpit has zero memory and process footprint on the server when not in use.

* Cockpit does not store data or policy. This also means it does not have its own users. The users from the systems can authenticate in Cockpit using their system credentials and they keep the same permissions.

* Cockpit dynamically updates itself to reflect the current state of the server, within a time frame of a few seconds.

* Cockpit is not intended for configuration management. This means that Cockpit itself does not have a predefined template or state for the server that it then imposes on the server. Cockpit can interact with other configuration management systems or custom tools that are manipulating server configuration.

This document provides instructions on how to install and enable Cockpit so you can monitor your servers, describes basic configuration, and walks you through the interface.

Both Red Hat Enterprise Linux and Red Hat Enterprise Linux Atomic Host can be used for the role of a Cockpit server and that of a secondary server. In this document, all monitored systems are Atomic, but the instructions also cover how to set up Red Hat Enterprise Linux as a primary server.

[NOTE]
Cockpit does not yet have support for Kubernetes on Red Hat Enterprise Linux or Red Hat Enterprise Linux Atomic Host servers.
Loading