Skip to content

Commit f777492

Browse files
committed
init
1 parent 19984fe commit f777492

8 files changed

Lines changed: 169 additions & 2 deletions

File tree

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
patreon: bretfisher

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
updates:
3+
# Maintain dependencies for GitHub Actions
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "monthly"

.github/linters/.markdown-lint.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# MD013/line-length - Line length
2+
MD013:
3+
# Number of characters, default is 80
4+
# I'm OK with long lines. All editors now have wordwrap
5+
line_length: 9999
6+
# Number of characters for headings
7+
heading_line_length: 100
8+
# check code blocks?
9+
code_blocks: false

.github/linters/.yaml-lint.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
###########################################
3+
# These are the rules used for #
4+
# linting all the yaml files in the stack #
5+
# NOTE: #
6+
# You can disable line with: #
7+
# # yamllint disable-line #
8+
###########################################
9+
rules:
10+
braces:
11+
level: warning
12+
min-spaces-inside: 0
13+
max-spaces-inside: 0
14+
min-spaces-inside-empty: 0
15+
max-spaces-inside-empty: 5
16+
brackets:
17+
level: warning
18+
min-spaces-inside: 0
19+
max-spaces-inside: 0
20+
min-spaces-inside-empty: 0
21+
max-spaces-inside-empty: 5
22+
colons:
23+
level: warning
24+
max-spaces-before: 0
25+
max-spaces-after: 1
26+
commas:
27+
level: warning
28+
max-spaces-before: 0
29+
min-spaces-after: 1
30+
max-spaces-after: 1
31+
comments: disable
32+
comments-indentation: disable
33+
document-end: disable
34+
document-start: disable
35+
empty-lines:
36+
level: warning
37+
max: 2
38+
max-start: 0
39+
max-end: 0
40+
hyphens:
41+
level: warning
42+
max-spaces-after: 1
43+
indentation:
44+
level: warning
45+
spaces: consistent
46+
indent-sequences: true
47+
check-multi-line-strings: false
48+
key-duplicates: enable
49+
line-length: disable
50+
new-line-at-end-of-file: disable
51+
new-lines:
52+
type: unix
53+
trailing-spaces: disable
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
# template source: https://github.com/bretfisher/super-linter-workflow/blob/main/templates/call-super-linter.yaml
3+
name: Lint Code Base
4+
5+
on:
6+
7+
push:
8+
branches: [main]
9+
10+
pull_request:
11+
12+
jobs:
13+
call-super-linter:
14+
15+
name: Call Super-Linter
16+
17+
permissions:
18+
contents: read # clone the repo to lint
19+
statuses: write #read/write to repo custom statuses
20+
21+
### use Reusable Workflows to call my workflow remotely
22+
### https://docs.github.com/en/actions/learn-github-actions/reusing-workflows
23+
### you can also call workflows from inside the same repo via file path
24+
25+
#FIXME: customize uri to point to your own linter repository
26+
uses: bretfisher/super-linter-workflow/.github/workflows/reusable-super-linter.yaml@main
27+
28+
### Optional settings examples
29+
30+
# with:
31+
### For a DevOps-focused repository. Prevents some code-language linters from running
32+
### defaults to false
33+
# devops-only: false
34+
35+
### A regex to exclude files from linting
36+
### defaults to empty
37+
# filter-regex-exclude: html/.*

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.dccache
2+
.DS_Store

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1-
# podspec
2-
Kubernetes Pod Specification Good Defaults
1+
# Kubernetes Pod Specification Good Defaults
2+
3+
The Pod spec for your apps can be the most complex part of your Kubernetes manifest design, and needs many features enabled to be a save and reasonably secure default
4+
5+
This single-file repo is meant to be a starting point for your Pod specs, to add to Deployments, DaemonSets, StatefulSets, initContainers, etc.
6+

pod.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# generic pod spec that's usable inside a deployment or other higher level k8s spec
2+
# via https://github.com/BretFisher/podspec
3+
4+
apiVersion: v1
5+
kind: Pod
6+
metadata:
7+
name: mypod
8+
9+
spec:
10+
11+
containers:
12+
13+
# basic container details
14+
- name: my-container-name
15+
# never use reusable tags like latest or stable
16+
image: my-image:tag
17+
# hardcode the listening port if Dockerfile isn't set with EXPOSE
18+
ports:
19+
- containerPort: 8080
20+
protocol: TCP
21+
22+
readinessProbe: # only needed if your pod has a service and listening port
23+
httpGet: # Lots of timeout values with defaults, be sure they are ideal for your workload
24+
path: /ready
25+
port: 8080
26+
livenessProbe: # only needed if your app becomes unresponsive or you don't have a readinessProbe, but this is up for debate.
27+
httpGet: # Lots of timeout values with defaults, be sure they are ideal for your workload
28+
path: /ready
29+
port: 8080
30+
31+
resources: # Because if limits = requests then QoS is set to "Guaranteed"
32+
limits:
33+
memory: "500Mi" # If container uses over 500MB it is killed (OOM)
34+
cpu: "2" # If container uses over 2 vCPU it is throttled
35+
requests:
36+
memory: "500Mi" # Scheduler finds a node where 500MB is available
37+
cpu: "1" # Scheduler finds a node where 1 vCPU is available
38+
39+
# per-container security context
40+
# lock down privileges inside the container
41+
securityContext:
42+
allowPrivilegeEscalation: false # prevent sudo, etc.
43+
privileged: false # prevent acting like host root
44+
45+
# per-pod security context
46+
# enable seccomp and force non-root user
47+
securityContext:
48+
49+
seccompProfile:
50+
type: RuntimeDefault # enable seccomp and the runtimes default profile
51+
52+
runAsUser: 1001 # hardcode user to non-root if not set in Dockerfile
53+
runAsGroup: 1001 # hardcode group to non-root if not set in Dockerfile
54+
runAsNonRoot: true # hardcode to non-root. Redundant to above if Dockerfile is set USER 1000

0 commit comments

Comments
 (0)