Skip to content

Commit 1b7b582

Browse files
committed
Committing docs hashnode ssl proxy
1 parent f9f3526 commit 1b7b582

File tree

8 files changed

+206
-0
lines changed

8 files changed

+206
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*~
18+
# Various IDEs
19+
.project
20+
.idea/
21+
*.tmproj
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
apiVersion: v1
2+
appVersion: "1.0"
3+
description: A Helm chart for Kubernetes
4+
name: docs-hashnode-ssl-proxy
5+
version: 0.1.0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# docs-hashnode-ssl-proxy
2+
3+
This helm chart is just using a subchart of our standardized deployment helm charts
4+
5+
## Introduction
6+
7+
This chart bootstraps a highly available deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
8+
9+
## Prerequisites
10+
11+
- Kubernetes 1.10+ with Beta APIs enabled
12+
- The kubectl binary
13+
- The helm binary
14+
- Helm diff plugin installed
15+
16+
## Installing the Chart
17+
18+
To install the chart...
19+
20+
```bash
21+
# dev
22+
export SERVICE_NAME="docs-hashnode-ssl-proxy"
23+
export CI_ENVIRONMENT_SLUG="dev"
24+
export K8S_NAMESPACE=$CI_ENVIRONMENT_SLUG
25+
export HELM_CHART=$SERVICE_NAME
26+
export CURRENT_HELM_CHART=$SERVICE_NAME
27+
28+
# prod
29+
export SERVICE_NAME="docs-hashnode-ssl-proxy"
30+
export CI_ENVIRONMENT_SLUG="prod"
31+
export K8S_NAMESPACE=$CI_ENVIRONMENT_SLUG
32+
export HELM_CHART=$SERVICE_NAME
33+
export CURRENT_HELM_CHART=$SERVICE_NAME
34+
35+
# Go into our deployment folder
36+
cd deployment
37+
# Update our helm subchart...
38+
helm dependencies update $SERVICE_NAME/
39+
# View the diff of what you want to do
40+
helm diff upgrade --namespace $K8S_NAMESPACE --allow-unreleased $CURRENT_HELM_CHART $HELM_CHART -f $CURRENT_HELM_CHART/values.yaml -f $CURRENT_HELM_CHART/values-${CI_ENVIRONMENT_SLUG}.yaml --set global.namespace="$K8S_NAMESPACE"
41+
# Actually do it...
42+
helm upgrade --namespace $K8S_NAMESPACE --install $CURRENT_HELM_CHART $HELM_CHART -f $CURRENT_HELM_CHART/values.yaml -f $CURRENT_HELM_CHART/values-${CI_ENVIRONMENT_SLUG}.yaml --set global.namespace="$K8S_NAMESPACE"
43+
```
44+
45+
## Configuration
46+
47+
For configuration options possible, please see our [helm-charts](#todo) repository
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
dependencies:
2+
- alias: deployment
3+
repository: https://devops-nirvana.s3.amazonaws.com/helm-charts/
4+
name: deployment
5+
version: ~1.0.0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: docs-hashnode-ssl-proxy
5+
labels:
6+
app.kubernetes.io/managed-by: Helm
7+
meta.helm.sh/release-name: docs-hashnode-ssl-proxy
8+
data:
9+
kubernetes.conf: |
10+
Options FollowSymLinks ExecCGI
11+
ProxyPreserveHost off
12+
13+
<VirtualHost *:80>
14+
ServerName docs-hashnode-ssl-proxy-80
15+
ServerAlias *
16+
17+
# Add X-Forwarded-Proto header
18+
# RequestHeader set X-Forwarded-Proto "https"
19+
20+
SSLProxyEngine On
21+
SSLProxyCheckPeerCN off
22+
SSLProxyCheckPeerExpire off
23+
SSLVerifyClient none
24+
SSLVerifyDepth 0
25+
26+
# Proxy requests to backend server, but "fake" a different hostname (mindsdb.com) needed because of how webflow works
27+
# ProxyRemote "*" "https://mindsdb-docs.hashnode.space"
28+
ProxyPass / "https://mindsdb-docs.hashnode.space/"
29+
ProxyPassReverse / "https://mindsdb-docs.hashnode.space/"
30+
</VirtualHost>
31+
# IMPLEMENTATION NOTE: Uncomment below to debug raw any requests sent to proxies and such
32+
# zz-debug.conf: |
33+
# LoadModule dumpio_module modules/mod_dumpio.so
34+
# LogLevel dumpio:trace7
35+
# DumpIOInput On
36+
# DumpIOOutput On
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
# Default values for dev
3+
deployment:
4+
5+
# This is setup to route from the nginx-ingress controller which is the actual public interface
6+
ingress:
7+
hosts:
8+
- host: 'docs.dev.mindsdb.com'
9+
paths:
10+
- /
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
# Default values for prod
3+
deployment:
4+
5+
# Only on prod we want high-availability & scalability
6+
autoscaling:
7+
enabled: true
8+
9+
# This is setup to route from the nginx-ingress controller which is the actual public interface
10+
ingress:
11+
hosts:
12+
- host: 'docs.mdb.ai'
13+
paths:
14+
- /
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Default values for deployment, this is necessary because we're using a unified helm subchart
2+
deployment:
3+
# This is the name of the deployment, this is used in a _lot_ of places in the helm charts so lets just specify it
4+
name: docs-hashnode-ssl-proxy
5+
6+
replicaCount: 1
7+
8+
# This runs on Linux only
9+
nodeSelector:
10+
kubernetes.io/os: linux
11+
12+
# Where our ECR registry is and what tag to use, along with the command/arguments if desired. See helm chart
13+
image:
14+
repository: andrewfarley/docker-kubernetes-apache-proxy
15+
tag: latest
16+
17+
# livenessProbes are used to determine when to restart a container
18+
# Only specify the values you need to override from the defaults
19+
livenessProbe:
20+
enabled: false
21+
initialDelaySeconds: 30
22+
path: /robots.txt
23+
24+
# readinessProbes are used to determine when a container is ready to start accepting traffic
25+
# Only specify the values you need to override from the defaults
26+
readinessProbe:
27+
enabled: false
28+
initialDelaySeconds: 1
29+
path: /robots.txt
30+
31+
# deployment container resource requests/limits
32+
# this is set VERY low by default, to be aggressive above resource limiting, please override this if necessary
33+
# Note: Limits are HARD Limits
34+
# Requests are "soft" limits and are what affects HPA (autoscaling) aggressiveness if HPA is enabled
35+
resources:
36+
limits:
37+
cpu: 1
38+
memory: 100Mi
39+
requests:
40+
cpu: 50m
41+
memory: 100Mi
42+
43+
# Enable autoscaling (prod only)
44+
autoscaling:
45+
enabled: false
46+
minReplicas: 3
47+
48+
ingress:
49+
enabled: true
50+
ingressClassName: "infrastructure"
51+
annotations:
52+
# support large file uploads
53+
nginx.ingress.kubernetes.io/proxy-body-size: "1000m"
54+
nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
55+
nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
56+
hosts:
57+
- host: REPLACE_HOSTNAME_IN_ENV_VALUES
58+
paths:
59+
- /(/+)?(.*)
60+
61+
volumes:
62+
- name: config-volume
63+
configMap:
64+
name: docs-hashnode-ssl-proxy
65+
66+
volumeMounts:
67+
- name: config-volume
68+
mountPath: /usr/local/apache2/conf/kubernetes

0 commit comments

Comments
 (0)