Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(config): create PoC deployment for Clapfire #115

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions blue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: blue
namespace: blue
labels:
app.kubernetes.io/name: blue
spec:
replicas: 3
selector:
matchLabels:
app.kubernetes.io/name: blue
template:
metadata:
labels:
app.kubernetes.io/name: blue
spec:
containers:
- name: nginx
image: gcr.io/kuar-demo/kuard-amd64:blue
ports:
- containerPort: 8080
name: http
resources:
requests:
memory: "64Mi"
cpu: "10m"
limits:
memory: "64Mi"
cpu: "10m"
---
apiVersion: v1
kind: Service
metadata:
name: blue
namespace: blue
labels:
app.kubernetes.io/name: blue
spec:
ports:
- port: 80
targetPort: http
selector:
app.kubernetes.io/name: blue
type: ClusterIP
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: blue
namespace: blue
labels:
app.kubernetes.io/name: blue
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prd
spec:
ingressClassName: traefik
rules:
- host: blue.antelope.nicklasfrahm.dev
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: blue
port:
number: 80
tls:
- secretName: blue-tls
hosts:
- blue.antelope.nicklasfrahm.dev
14 changes: 14 additions & 0 deletions clusterissuer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt-prd
spec:
acme:
server: https://acme-v02.api.letsencrypt.org/directory
email: [email protected]
privateKeySecretRef:
name: letsencrypt-prd-clusterissuer-key
solvers:
- http01:
ingress:
ingressClassName: traefik
13 changes: 11 additions & 2 deletions deploy/helm/cert-manager/values.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
cert-manager:
installCRDs: true
crds:
# This option decides if the CRDs should be installed
# as part of the Helm installation.
enabled: true

# This option makes it so that the "helm.sh/resource-policy": keep
# annotation is added to the CRD. This will prevent Helm from uninstalling
# the CRD when the Helm release is uninstalled.
# WARNING: when the CRDs are removed, all cert-manager custom resources
# (Certificates, Issuers, ...) will be removed too by the garbage collector.
keep: true
39 changes: 39 additions & 0 deletions deploy/k3se/antelope.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Version may either be a specific k3s version or a release channel
# as listed here: https://update.k3s.io/v1-release/channels
version: stable

# Cluster provides cluster-wide settings that should be applied
# to all nodes in the cluster. All options are equivalent to the
# commmand line options of the `k3s` command.
cluster:
server:
# It is highly recommended to always specify this option as it
# is used to determine the server URL of the cluster.
tls-san:
- antelope.nicklasfrahm.dev
https-listen-port: 6443
disable:
- traefik
flannel-iface: eth0
cluster-cidr:
- 172.28.0.0/16
service-cidr:
- 172.29.0.0/16
cluster-dns:
- 172.29.0.10

# A list of all nodes in the cluster and their connection information.
nodes:
- role: server
ssh:
host: 95.216.166.134
fingerprint: SHA256:kMmMHdbvmJs+GRsaBifCbtFTbrj66WaLVVsPojWF34M
user: root
key-file: ~/.ssh/id_ed25519

# An SSH proxy, also known as jumpbox or a bastion host
# can be used to access nodes in a private network.
ssh-proxy:
host: antelope.nicklasfrahm.dev
user: root
key-file: ~/.ssh/id_ed25519
75 changes: 75 additions & 0 deletions deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/name: blue
name: blue
namespace: blue
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: blue
template:
metadata:
labels:
app.kubernetes.io/name: blue
spec:
containers:
- image: gcr.io/kuar-demo/kuard-amd64:blue
imagePullPolicy: IfNotPresent
name: nginx
ports:
- containerPort: 8080
name: http
protocol: TCP
resources:
requests:
cpu: 100m
memory: 64Mi
limits:
memory: 64Mi
topologySpreadConstraints:
- topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: ScheduleAnyway
minDomains: 3
maxSkew: 1
labelSelector:
matchLabels:
app.kubernetes.io/name: blue
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: blue
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: blue
minReplicas: 3
maxReplicas: 20
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 75
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: 75
---
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: blue
spec:
# stateless
maxUnavailable: 50%
selector:
matchLabels:
app.kubernetes.io/name: blue
2 changes: 2 additions & 0 deletions traefik.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
deployment:
replicas: 3