Skip to content

Commit 7e04e10

Browse files
committed
feat: create setup for azure
1 parent 0c8cd36 commit 7e04e10

File tree

11 files changed

+922
-0
lines changed

11 files changed

+922
-0
lines changed

.editorconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[*.md]
13+
trim_trailing_whitespace = false
14+
15+
[Makefile]
16+
indent_style = tab
17+
indent_size = 4

.env.example

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Create a service principal with the "Group Administrator" AAD role
2+
# https://docs.microsoft.com/en-us/azure/active-directory/develop/howto-create-service-principal-portal
3+
AZURE_SUBSCRIPTION_ID=""
4+
AZURE_TENANT_ID=""
5+
AZURE_CLIENT_ID=""
6+
AZURE_CLIENT_SECRET=""
7+
8+
# The name of the Kubernetes cluster
9+
CLUSTER_NAME=gitpod
10+
11+
# Base domain
12+
DOMAIN=mygitpod.example.com
13+
14+
# Set the location of the cluster's control plane and nodes
15+
# https://azure.microsoft.com/en-us/global-infrastructure/geographies/
16+
LOCATION=northeurope
17+
18+
# The email address for cert-manager wildcard SSL certificate
19+
LETSENCRYPT_EMAIL=my@email
20+
21+
# The name of the Azure MySQL instance - must be globally unique
22+
# Until https://github.com/gitpod-io/gitpod/issues/5508 is fixed, an external
23+
# MySQL database is not supported
24+
MYSQL_INSTANCE_NAME=gitpod
25+
26+
# Set the name of the Azure Docker registry - must be globally unique
27+
# https://docs.microsoft.com/en-us/azure/container-registry/container-registry-get-started-portal
28+
REGISTRY_NAME=gitpod1234
29+
30+
# Name of the resource group. All resources will be created in here
31+
RESOURCE_GROUP=gitpod
32+
33+
# Set if we want to use Azure DNS to manage the DNS service.
34+
# https://azure.microsoft.com/en-gb/pricing/details/dns/
35+
SETUP_MANAGED_DNS=true
36+
37+
# Set the name of the storage account - must be globally unique
38+
# https://docs.microsoft.com/en-us/azure/storage/common/storage-introduction
39+
STORAGE_ACCOUNT_NAME=gitpod1234

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.env
2+
.kube
3+
.idea

Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM mcr.microsoft.com/azure-cli:2.9.1
2+
3+
RUN apk add --no-cache \
4+
gettext \
5+
jq
6+
7+
ARG HELM_VERSION=v3.6.3
8+
9+
RUN curl -fsSL "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl" -o /usr/local/bin/kubectl \
10+
&& chmod +x /usr/local/bin/kubectl
11+
12+
RUN mkdir -p /tmp/helm/ \
13+
&& curl -fsSL https://get.helm.sh/helm-${HELM_VERSION}-linux-amd64.tar.gz | tar -xzvC /tmp/helm/ --strip-components=1 \
14+
&& cp /tmp/helm/helm /usr/local/bin/helm \
15+
&& rm -rf /tmp/helm
16+
17+
WORKDIR /gitpod
18+
19+
COPY . /gitpod
20+
21+
ENTRYPOINT ["/gitpod/setup.sh"]

Makefile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
.DEFAULT_GOAL:=help
2+
3+
# set default shell
4+
SHELL=/bin/bash -o pipefail -o errexit
5+
6+
IMG=ghcr.io/gitpod-io/gitpod-azure-aks-guide:latest
7+
8+
build: ## Build docker image containing the required tools for the installation
9+
@docker build --quiet . -t ${IMG}
10+
11+
DOCKER_RUN_CMD = docker run -it --rm \
12+
--volume $$HOME/.kube:/root/.kube \
13+
--volume $$PWD:/gitpod \
14+
${IMG} $(1)
15+
16+
install: ## Install Gitpod
17+
@echo "Starting install process..."
18+
$(call DOCKER_RUN_CMD, --install)
19+
20+
uninstall: ## Uninstall Gitpod
21+
@echo "Starting uninstall process..."
22+
@$(call DOCKER_RUN_CMD, --uninstall)
23+
24+
auth: ## Install OAuth providers
25+
@echo "Installing auth providers..."
26+
@$(call DOCKER_RUN_CMD, --auth)
27+
28+
help: ## Display this help
29+
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z0-9_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
30+
31+
.PHONY: build install uninstall auth help

auth-providers-patch.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
data:
2+
# Please check the documentation for details the expected format
3+
# https://www.gitpod.io/docs/self-hosted/0.5.0/install/oauth
4+
auth-providers.json: |
5+
[
6+
{
7+
"id": "Public-GitHub",
8+
"host": "github.com",
9+
"type": "GitHub",
10+
"oauth": {
11+
"clientId": "XXXXXXXXXXXXXXXXXX",
12+
"clientSecret": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
13+
"callBackUrl": "https://<my domain>/auth/github.com/callback",
14+
"settingsUrl": "https://github.com/settings/applications/<application ID>"
15+
},
16+
"description": "",
17+
"icon": ""
18+
}
19+
]

0 commit comments

Comments
 (0)