Skip to content

Commit

Permalink
Start K8S Deployment Configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
victorlane committed Dec 30, 2024
1 parent fa265c6 commit 66f72f4
Show file tree
Hide file tree
Showing 49 changed files with 9,785 additions and 12 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
# TODO
1. Automatic K8S Deployment
2. Authenticate to private registry automatically
3. Load Deploy secrets during build step and apply to cluster

Testing out https://sanic.dev/.

41 changes: 41 additions & 0 deletions deploy/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: sanic-app
labels:
app: sanic
spec:
replicas: 3
selector:
matchLabels:
app: sanic
template:
metadata:
labels:
app: sanic
spec:
containers:
- name: sanic
image: git.victorbrink.dev/victor/sanic-server:latest
ports:
- containerPort: 8080
args:
- "--host=0.0.0.0"
- "--port=8080"
- "--no-access-log"
- "--motd=False"
- "--fast"
---
apiVersion: v1
kind: Service
metadata:
name: sanic-service
spec:
selector:
app: sanic
ports:
- protocol: TCP
port: 80
targetPort: 8001
type: ClusterIP

34 changes: 34 additions & 0 deletions deploy/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: sanic-ingress
annotations:
nginx.ingress.kubernetes.io/proxy-buffering: "off"
nginx.ingress.kubernetes.io/proxy-request-buffering: "off"
nginx.ingress.kubernetes.io/proxy-http-version: "1.1"
nginx.ingress.kubernetes.io/connection-proxy-header: "keep-alive"
nginx.ingress.kubernetes.io/rewrite-target: /
nginx.ingress.kubernetes.io/configuration-snippet: |
map $remote_addr $for_addr {
~^[0-9.]+$ "for=$remote_addr"; # IPv4 client address
~^[0-9A-Fa-f:.]+$ "for=\"[$remote_addr]\""; # IPv6 bracketed and quoted
default "for=unknown"; # Unix socket
}
proxy_set_header forwarded 'by="_hostname";$for_addr;proto=$scheme;host="$http_host"';
spec:
tls:
- hosts:
- example.com
secretName: sanic-tls
rules:
- host: example.com
http:
paths:
- path: /
pathType: ImplementationSpecific
backend:
service:
name: sanic-service
port:
number: 80

2 changes: 2 additions & 0 deletions deploy/nginx-ingress/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Patterns to ignore when building packages.
*.png
17 changes: 17 additions & 0 deletions deploy/nginx-ingress/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v2
appVersion: 4.0.0
description: NGINX Ingress Controller
home: https://github.com/nginxinc/kubernetes-ingress
icon: https://raw.githubusercontent.com/nginxinc/kubernetes-ingress/v4.0.0/charts/nginx-ingress/chart-icon.png
keywords:
- ingress
- nginx
kubeVersion: '>= 1.23.0-0'
maintainers:
- email: kubernetes@nginx.com
name: nginxinc
name: nginx-ingress
sources:
- https://github.com/nginxinc/kubernetes-ingress/tree/v4.0.0/charts/nginx-ingress
type: application
version: 2.0.0
3 changes: 3 additions & 0 deletions deploy/nginx-ingress/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Helm Documentation

Please refer to the [Installation with Helm](https://docs.nginx.com/nginx-ingress-controller/installation/installing-nic/installation-with-helm/) guide in the NGINX Ingress Controller documentation site.
83 changes: 83 additions & 0 deletions deploy/nginx-ingress/crds/appprotect.f5.com_aplogconfs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.13.0
name: aplogconfs.appprotect.f5.com
spec:
group: appprotect.f5.com
names:
kind: APLogConf
listKind: APLogConfList
plural: aplogconfs
singular: aplogconf
preserveUnknownFields: false
scope: Namespaced
versions:
- name: v1beta1
schema:
openAPIV3Schema:
description: APLogConf is the Schema for the APLogConfs API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: APLogConfSpec defines the desired state of APLogConf
properties:
content:
properties:
escaping_characters:
items:
properties:
from:
type: string
to:
type: string
type: object
type: array
format:
enum:
- splunk
- arcsight
- default
- user-defined
- grpc
type: string
format_string:
type: string
list_delimiter:
type: string
list_prefix:
type: string
list_suffix:
type: string
max_message_size:
pattern: ^([1-9]|[1-5][0-9]|6[0-4])k$
type: string
max_request_size:
pattern: ^([1-9]|[1-9][0-9]|[1-9][0-9]{2}|[1-9][0-9]{3}|10[0-2][0-9][0-9]|[1-9]k|10k|any)$
type: string
type: object
filter:
properties:
request_type:
enum:
- all
- illegal
- blocked
type: string
type: object
type: object
type: object
served: true
storage: true
Loading

0 comments on commit 66f72f4

Please sign in to comment.