forked from github/plane
k8s
This commit is contained in:
parent
82f8b6d387
commit
ed42050549
Binary file not shown.
66
kubernetes/deployment.yaml
Normal file
66
kubernetes/deployment.yaml
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: plane-sandbox
|
||||||
|
namespace: plane-sandbox
|
||||||
|
labels:
|
||||||
|
app: plane-sandbox
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: plane-sandbox
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: plane-sandbox
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: planefrontend
|
||||||
|
image: makeplane/plane-frontend:0.2.1
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
env:
|
||||||
|
- name: NEXT_PUBLIC_API_BASE_URL
|
||||||
|
value: "http://planebackend:8000"
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
memory: 512Mi
|
||||||
|
cpu: "1"
|
||||||
|
requests:
|
||||||
|
memory: 256Mi
|
||||||
|
cpu: "0.2"
|
||||||
|
command: ["/bin/sh","-c"]
|
||||||
|
args: ["node apps/app/server.js"]
|
||||||
|
ports:
|
||||||
|
- containerPort: 3000
|
||||||
|
- name: planebackend
|
||||||
|
image: makeplane/plane-backend:0.2.1
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
env:
|
||||||
|
- name: WEB_URL
|
||||||
|
value: planebackend:8000
|
||||||
|
- name: DISABLE_COLLECTSTATIC
|
||||||
|
value: "1"
|
||||||
|
- name: DOCKERIZED
|
||||||
|
value: "1"
|
||||||
|
- name: SECRET_KEY
|
||||||
|
value: "praro1^m%c607u4_1z%&_ubf@rm(u-t@asnqkykecz6l^dxlzf"
|
||||||
|
- name: DATABASE_URL
|
||||||
|
value: postgres://plane:plane@plane.cdivnhdawh0f.ap-south-1.rds.amazonaws.com:5432/plane
|
||||||
|
- name: REDIS_URL
|
||||||
|
value: "redis://redis:6379/"
|
||||||
|
- name: DJANGO_SETTINGS_MODULE
|
||||||
|
value: plane.settings.production
|
||||||
|
command: ["/bin/sh","-c"]
|
||||||
|
args: ["./bin/takeoff"]
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
memory: 1Gi
|
||||||
|
cpu: "1"
|
||||||
|
requests:
|
||||||
|
memory: 1Gi
|
||||||
|
cpu: "0.2"
|
||||||
|
ports:
|
||||||
|
- containerPort: 8000
|
||||||
|
|
21
kubernetes/ingress.yaml
Normal file
21
kubernetes/ingress.yaml
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: plane-ingress
|
||||||
|
namespace: plane-sandbox
|
||||||
|
annotations:
|
||||||
|
kubernetes.io/ingress.class: alb
|
||||||
|
alb.ingress.kubernetes.io/scheme: internet-facing
|
||||||
|
alb.ingress.kubernetes.io/tags: Environment=sandbox,Team=plane**
|
||||||
|
spec:
|
||||||
|
rules:
|
||||||
|
- host: "*.example.com"
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
pathType: Prefix
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: plane-sandbox-service
|
||||||
|
port:
|
||||||
|
number: 3000
|
109
kubernetes/main.tf
Normal file
109
kubernetes/main.tf
Normal file
@ -0,0 +1,109 @@
|
|||||||
|
|
||||||
|
module "eks" {
|
||||||
|
source = "terraform-aws-modules/eks/aws"
|
||||||
|
version = "19.5.1"
|
||||||
|
|
||||||
|
cluster_name = "sandbox"
|
||||||
|
cluster_version = "1.25"
|
||||||
|
|
||||||
|
cluster_addons = {
|
||||||
|
coredns = {
|
||||||
|
preserve = true
|
||||||
|
most_recent = true
|
||||||
|
|
||||||
|
timeouts = {
|
||||||
|
create = "25m"
|
||||||
|
delete = "10m"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
kube-proxy = {
|
||||||
|
most_recent = true
|
||||||
|
}
|
||||||
|
vpc-cni = {
|
||||||
|
most_recent = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
iam_role_additional_policies = {
|
||||||
|
additional = "arn:aws:iam::aws:policy/AmazonEC2FullAccess"
|
||||||
|
}
|
||||||
|
vpc_id = "vpc-0e355d290b274b86f"
|
||||||
|
subnet_ids = ["subnet-050c9e36bda3e6b62","subnet-0bd81c09f00d0607a","subnet-03396584886320a18"]
|
||||||
|
cluster_endpoint_public_access = true
|
||||||
|
|
||||||
|
eks_managed_node_group_defaults = {
|
||||||
|
ami_type = "AL2_x86_64"
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
eks_managed_node_groups = {
|
||||||
|
one = {
|
||||||
|
name = "node-group-1"
|
||||||
|
|
||||||
|
instance_types = ["t3.large"]
|
||||||
|
|
||||||
|
min_size = 1
|
||||||
|
max_size = 2
|
||||||
|
desired_size = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
two = {
|
||||||
|
name = "node-group-2"
|
||||||
|
|
||||||
|
instance_types = ["t3.large"]
|
||||||
|
|
||||||
|
min_size = 1
|
||||||
|
max_size = 2
|
||||||
|
desired_size = 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
########################################
|
||||||
|
terraform {
|
||||||
|
required_providers {
|
||||||
|
aws = {
|
||||||
|
source = "hashicorp/aws"
|
||||||
|
version = "~> 4.47.0"
|
||||||
|
}
|
||||||
|
|
||||||
|
random = {
|
||||||
|
source = "hashicorp/random"
|
||||||
|
version = "~> 3.4.3"
|
||||||
|
}
|
||||||
|
|
||||||
|
tls = {
|
||||||
|
source = "hashicorp/tls"
|
||||||
|
version = "~> 4.0.4"
|
||||||
|
}
|
||||||
|
|
||||||
|
cloudinit = {
|
||||||
|
source = "hashicorp/cloudinit"
|
||||||
|
version = "~> 2.2.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
required_version = "~> 1.3"
|
||||||
|
}
|
||||||
|
|
||||||
|
#########################################
|
||||||
|
|
||||||
|
output "cluster_endpoint" {
|
||||||
|
description = "Endpoint for EKS control plane"
|
||||||
|
value = module.eks.cluster_endpoint
|
||||||
|
}
|
||||||
|
|
||||||
|
output "cluster_security_group_id" {
|
||||||
|
description = "Security group ids attached to the cluster control plane"
|
||||||
|
value = module.eks.cluster_security_group_id
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
output "cluster_name" {
|
||||||
|
description = "Kubernetes Cluster Name"
|
||||||
|
value = module.eks.cluster_name
|
||||||
|
}
|
||||||
|
|
||||||
|
#########################################
|
||||||
|
|
||||||
|
provider "aws" {
|
||||||
|
region = "ap-south-1"
|
||||||
|
}
|
9
kubernetes/secret.yaml
Normal file
9
kubernetes/secret.yaml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
namespace: plane-sandbox
|
||||||
|
name: plane-secret
|
||||||
|
type: kubernetes.io/tls
|
||||||
|
data:
|
||||||
|
tls.crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURMakNDQWhZQ0NRREFPRjl0THNhWFdqQU5CZ2txaGtpRzl3MEJBUXNGQURCYU1Rc3dDUVlEVlFRR0V3SlYKVXpFTE1Ba0dBMVVFQ0F3Q1EwRXhJVEFmQmdOVkJBb01HRWx1ZEdWeWJtVjBJRmRwWkdkcGRITWdVSFI1SUV4MApaREViTUJrR0ExVUVBd3dTWTJGbVpTNWxlR0Z0Y0d4bExtTnZiU0FnTUI0WERURTRNRGt4TWpFMk1UVXpOVm9YCkRUSXpNRGt4TVRFMk1UVXpOVm93V0RFTE1Ba0dBMVVFQmhNQ1ZWTXhDekFKQmdOVkJBZ01Ba05CTVNFd0h3WUQKVlFRS0RCaEpiblJsY201bGRDQlhhV1JuYVhSeklGQjBlU0JNZEdReEdUQVhCZ05WQk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VnMGtKVzNzeWhwVTl6WkxPN2x0QjBLSWtPOVpSY21Vam84UQpjcExsSE1BcWJMSjhXWUdKQ2toaVd4eWFsNmhZVHlXWTRjVmtDMHh0VGwvaFVFOUllTktvCi0tLS0tRU5EIFJTQSBQUklWQVRFIEtFWS0tLS0tCg==
|
14
kubernetes/service.yaml
Normal file
14
kubernetes/service.yaml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: plane-sandbox-service
|
||||||
|
namespace: plane-sandbox
|
||||||
|
labels:
|
||||||
|
app: plane-sandbox
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: plane-sandbox
|
||||||
|
ports:
|
||||||
|
- protocol: TCP
|
||||||
|
port: 3000
|
||||||
|
targetPort: 3000
|
2339
kubernetes/terraform.tfstate
Normal file
2339
kubernetes/terraform.tfstate
Normal file
File diff suppressed because it is too large
Load Diff
2316
kubernetes/terraform.tfstate.backup
Normal file
2316
kubernetes/terraform.tfstate.backup
Normal file
File diff suppressed because it is too large
Load Diff
@ -2,7 +2,9 @@ upstream plane {
|
|||||||
server localhost:80;
|
server localhost:80;
|
||||||
}
|
}
|
||||||
|
|
||||||
error_log /var/log/nginx/error.log;
|
error_log /var/log/nginx/error.log;
|
||||||
|
server_tokens off;
|
||||||
|
access_log /var/log/nginx/access.log;
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
@ -16,7 +18,6 @@ server {
|
|||||||
location /api/ {
|
location /api/ {
|
||||||
proxy_pass http://planebackend:8000/api/;
|
proxy_pass http://planebackend:8000/api/;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
}
|
}
|
||||||
error_page 500 502 503 504 /50x.html;
|
error_page 500 502 503 504 /50x.html;
|
||||||
location = /50x.html {
|
location = /50x.html {
|
||||||
|
Loading…
Reference in New Issue
Block a user