Skip to content

Commit

Permalink
Add adjustments for Jira tutorial
Browse files Browse the repository at this point in the history
* Add Argo ingress
* Add argo, jira-cloud and jira-local domains to /etc/hosts
* Add makefile targets from creating and deleting demo cluster
* Disable montioring
* Add info about helm v3
* Remove building docker images and reuse those already available in gcr
* Enable mocked OCH local and public servers
  • Loading branch information
mszostok committed Dec 7, 2020
1 parent b836ce7 commit 8ecd79a
Show file tree
Hide file tree
Showing 8 changed files with 101 additions and 5 deletions.
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,15 @@ dev-cluster-delete:
fix-lint-issues:
LINT_FORCE_FIX=true ./hack/lint.sh
.PHONY: fix-lint

###############
# Tutorials #
###############

jira-tutorial-cluster:
./hack/jira-tutorial-cluster-create.sh
.PHONY: jira-tutorial-cluster

jira-tutorial-cluster-delete:
./hack/jira-tutorial-cluster-delete.sh
.PHONY: jira-tutorial-cluster
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ metadata:
spec:
rules:
{{- range .Values.server.ingress.hosts }}
- host: {{ . }}
- host: "{{ printf "%s.%s" . $.Values.global.domainName }}"
http:
paths:
{{- if $.Values.server.ingress.paths }}
Expand Down
6 changes: 3 additions & 3 deletions deploy/kubernetes/charts/argo/charts/argo/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ server:
## ref: https://kubernetes.io/docs/user-guide/ingress/
##
ingress:
enabled: false
enabled: true

## Annotations to be added to the web ingress.
##
Expand All @@ -216,8 +216,8 @@ server:
## Hostnames.
## Must be provided if Ingress is enabled.
##
# hosts:
# - argo.domain.com
hosts:
- argo

## Additional Paths for each host
# paths:
Expand Down
3 changes: 3 additions & 0 deletions deploy/kubernetes/charts/argo/values.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
global:
domainName: "voltron.local"

argo:
controller:
containerRuntimeExecutor: pns
Expand Down
1 change: 1 addition & 0 deletions docs/tutorial/jira-installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ The bellow diagrams show possible scenarios:
### Prerequisites

* Install Docker
* Install [Helm v3](https://helm.sh/docs/intro/install/)
* Install [`kind`](https://kind.sigs.k8s.io/docs/user/quick-start/#installation)
* Install [`ocftool`](https://github.com/Project-Voltron/go-voltron/releases/tag/v0.0.1-alpha.1)
* Install [`kubectl`](https://kubernetes.io/docs/tasks/tools/install-kubectl/)
Expand Down
55 changes: 55 additions & 0 deletions hack/jira-tutorial-cluster-create.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/usr/bin/env bash
#
# This script provisions demo cluster for Jira installation using 'kind'(kubernetes-in-docker)
# Add cluster config to a file specified by KUBECONFIG env variable.
#
# It requires Docker to be installed.

# standard bash error handling
set -o nounset # treat unset variables as an error and exit immediately.
set -o errexit # exit immediately when a command fails.
set -E # needs to be set if we want the ERR trap

readonly CURRENT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
readonly REPO_ROOT_DIR=${CURRENT_DIR}/..

# shellcheck source=./hack/lib/utilities.sh
source "${CURRENT_DIR}/lib/utilities.sh" || { echo 'Cannot load CI utilities.'; exit 1; }
# shellcheck source=./hack/lib/const.sh
source "${CURRENT_DIR}/lib/const.sh" || { echo 'Cannot load constant values.'; exit 1; }

main() {
shout "Starting Voltron local cluster..."

export REPO_DIR=$REPO_ROOT_DIR

voltron::validate::tools

export KUBERNETES_VERSION=${KUBERNETES_VERSION:-${STABLE_KUBERNETES_VERSION}}
export KIND_CLUSTER_NAME="jira-tutorial"
kind::create_cluster

export DOCKER_TAG="1863a6f"
export DOCKER_REPOSITORY="gcr.io/projectvoltron"
export CLUSTER_TYPE="KIND"
export MOCK_OCH_GRAPHQL=true
export MOCK_ENGINE_GRAPHQL=false
export DISABLE_MONITORING_INSTALLATION=true
voltron::install_upgrade::charts

if [[ "${DISABLE_HOSTS_UPDATE:-"false"}" == "true" ]]; then
shout "Skipping updating /etc/hosts cause DISABLE_HOSTS_UPDATE is set to true."
else
host::update::voltron_hosts
fi

if [[ "${DISABLE_ADDING_TRUSTED_CERT:-"false"}" == "true" ]]; then
shout "Skipping setting self-signed TLS certificate as trusted cause DISABLE_ADDING_TRUSTED_CERT is set to true."
else
host::install:trust_self_signed_cert
fi

shout "Voltron local cluster created successfully."
}

main
25 changes: 25 additions & 0 deletions hack/jira-tutorial-cluster-delete.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
#
# This script deletes kind cluster.
#

# standard bash error handling
set -o nounset # treat unset variables as an error and exit immediately.
set -o errexit # exit immediately when a command fails.
set -E # needs to be set if we want the ERR trap

readonly CURRENT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )

# shellcheck source=./hack/lib/utilities.sh
source "${CURRENT_DIR}/lib/utilities.sh" || { echo 'Cannot load CI utilities.'; exit 1; }
# shellcheck source=./hack/lib/const.sh
source "${CURRENT_DIR}/lib/const.sh" || { echo 'Cannot load constant values.'; exit 1; }

main() {
export KIND_CLUSTER_NAME="jira-tutorial"
kind::delete_cluster

shout "Voltron local cluster deleted successfully."
}

main
2 changes: 1 addition & 1 deletion hack/lib/utilities.sh
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ voltron::synchronize::minio_secret() {
host::update::voltron_hosts() {
shout "- Updating /etc/hosts..."
readonly DOMAIN="voltron.local"
readonly VOLTRON_HOSTS=("gateway")
readonly VOLTRON_HOSTS=("gateway" "argo" "jira-cloud" "jira-local")

LINE_TO_APPEND="127.0.0.1 $(printf "%s.${DOMAIN} " "${VOLTRON_HOSTS[@]}")"
HOSTS_FILE="/etc/hosts"
Expand Down

0 comments on commit 8ecd79a

Please sign in to comment.