-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #159 from datalab-mi/feat/kubernetes-nginx
Feat/kubernetes nginx
- Loading branch information
Showing
11 changed files
with
280 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Flask>=1.1.1 | ||
Flask>=2.2.2 | ||
#flask-httpauth>=4.2.0 | ||
flask-jwt-extended>=3.25.0 | ||
#flask-cors==3.0.8 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Install helm charts | ||
|
||
## Nginx | ||
```bash | ||
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx | ||
helm repo update | ||
``` | ||
|
||
## Cert manager | ||
```bash | ||
helm repo add jetstack https://charts.jetstack.io | ||
helm repo update | ||
``` | ||
From [docs](https://cert-manager.io/docs/tutorials/acme/nginx-ingress/) | ||
|
||
# Deploy | ||
```bash | ||
helm install \ | ||
cert-manager jetstack/cert-manager \ | ||
--namespace nginx \ | ||
--set installCRDs=true | ||
|
||
helm upgrade --install nginx ingress-nginx/ingress-nginx --namespace nginx --create-namespace --values values.yaml | ||
|
||
kubectl apply -f issuer.yaml | ||
kubectl apply -f ingress.yaml | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: backend | ||
namespace: ridoc # Namespace must be the same as that of target services below. | ||
annotations: | ||
# nginx.ingress.kubernetes.io/ssl-redirect: "false" # Set to true once SSL is set up. | ||
cert-manager.io/cluster-issuer: "letsencrypt-prod" | ||
nginx.ingress.kubernetes.io/use-regex: "true" | ||
nginx.ingress.kubernetes.io/rewrite-target: /$1 | ||
nginx.ingress.kubernetes.io/enable-access-log: "true" | ||
spec: | ||
ingressClassName: nginx | ||
tls: | ||
- hosts: | ||
- kubernetes.ridoc.fr | ||
secretName: letsencrypt-prod | ||
rules: | ||
- host: kubernetes.ridoc.fr | ||
http: | ||
paths: | ||
- path: /backend/(.*) | ||
pathType: ImplementationSpecific | ||
backend: | ||
service: | ||
name: backend | ||
port: | ||
number: 5000 | ||
# - path: / | ||
# pathType: Prefix | ||
# backend: | ||
# service: | ||
# name: frontend | ||
# port: | ||
# number: 3000 | ||
|
||
--- | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: frontend | ||
namespace: ridoc # Namespace must be the same as that of target services below. | ||
annotations: | ||
cert-manager.io/cluster-issuer: "letsencrypt-prod" | ||
nginx.ingress.kubernetes.io/enable-access-log: "false" | ||
# nginx.ingress.kubernetes.io/ssl-redirect: "false" # Set to true once SSL is set up. | ||
spec: | ||
ingressClassName: nginx | ||
tls: | ||
- hosts: | ||
- kubernetes.ridoc.fr | ||
secretName: letsencrypt-prod | ||
rules: | ||
- host: kubernetes.ridoc.fr | ||
http: | ||
paths: | ||
- path: / | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: frontend | ||
port: | ||
number: 3000 | ||
- path: /kibana | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: kibana-kibana | ||
port: | ||
number: 5601 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
apiVersion: cert-manager.io/v1 | ||
kind: ClusterIssuer | ||
metadata: | ||
name: letsencrypt-staging | ||
# namespace: nginx | ||
spec: | ||
acme: | ||
# The ACME server URL | ||
server: https://acme-staging-v02.api.letsencrypt.org/directory | ||
# Email address used for ACME registration | ||
email: [email protected] | ||
# Name of a secret used to store the ACME account private key | ||
privateKeySecretRef: | ||
name: letsencrypt-staging | ||
# Enable the HTTP-01 challenge provider | ||
solvers: | ||
- http01: | ||
ingress: | ||
ingressClassName: nginx | ||
|
||
--- | ||
apiVersion: cert-manager.io/v1 | ||
kind: ClusterIssuer | ||
metadata: | ||
name: letsencrypt-prod | ||
# namespace: nginx | ||
spec: | ||
acme: | ||
# The ACME server URL | ||
server: https://acme-v02.api.letsencrypt.org/directory | ||
# Email address used for ACME registration | ||
email: [email protected] | ||
# Name of a secret used to store the ACME account private key | ||
privateKeySecretRef: | ||
name: letsencrypt-prod | ||
# Enable the HTTP-01 challenge provider | ||
solvers: | ||
- http01: | ||
ingress: | ||
ingressClassName: nginx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# controller: | ||
# service: | ||
# type: NodePort | ||
# publishService: | ||
# enabled: true | ||
|
||
controller: | ||
kind: DaemonSet | ||
hostNetwork: true | ||
dnsPolicy: ClusterFirstWithHostNet | ||
daemonset: | ||
useHostPort: true | ||
service: | ||
type: ClusterIP | ||
config: | ||
access-log-path: "/tmp/nginx/access.log" | ||
log-format-escape-json: true | ||
log-format-upstream: '{"http_x_forwarded_for":"$http_x_forwarded_for","http_referer":"$http_referer","http_user_agent":"$http_user_agent","remote_addr":"$remote_addr","remote_user":"$remote_user","time_local":"$time_local","request":"$request","request_time":$request_time,"request_method":"$request_method","request_uri":"$request_uri","uri":"$uri","status":$status,"body_bytes_sent":$body_bytes_sent,"request_body": "$request_body"}' | ||
|
||
extraVolumes: | ||
- name: nginx-logs | ||
hostPath: | ||
path: /tmp | ||
|
||
extraVolumeMounts: | ||
- name: nginx-logs | ||
mountPath: /tmp/nginx | ||
rbac: | ||
create: true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,8 +30,7 @@ services: | |
#- ${DATA_PATH}:/data | ||
ports: | ||
- "9200:9200" | ||
logging: | ||
driver: none | ||
|
||
|
||
networks: | ||
default: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,8 +30,7 @@ services: | |
#- ${DATA_PATH}:/data | ||
ports: | ||
- "9200:9200" | ||
logging: | ||
driver: none | ||
|
||
|
||
networks: | ||
default: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.