This commit is contained in:
2024-02-20 17:15:27 +08:00
committed by huty
parent 6706e1a633
commit 34158042ad
1529 changed files with 177765 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
apiVersion: v1
kind: Service
metadata:
name: buildkitd
labels:
kiamol: ch11
spec:
ports:
- port: 1234
targetPort: buildkitd
selector:
app: buildkitd
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: buildkitd
labels:
kiamol: ch11
spec:
replicas: 1
selector:
matchLabels:
app: buildkitd
template:
metadata:
labels:
app: buildkitd
spec:
containers:
- name: buildkitd
image: moby/buildkit:v0.7.1
args:
- --addr
- unix:///run/buildkit/buildkitd.sock
- --addr
- tcp://0.0.0.0:1234
securityContext:
privileged: true
ports:
- name: buildkitd
containerPort: 1234

View File

@@ -0,0 +1,35 @@
apiVersion: v1
kind: Service
metadata:
name: gogs
labels:
kiamol: ch11
spec:
ports:
- port: 3000
targetPort: gogs
selector:
app: gogs
type: LoadBalancer
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: gogs
labels:
kiamol: ch11
spec:
selector:
matchLabels:
app: gogs
template:
metadata:
labels:
app: gogs
spec:
containers:
- name: gogs
image: kiamol/ch11-gogs
ports:
- name: gogs
containerPort: 3000

View File

@@ -0,0 +1,94 @@
apiVersion: v1
kind: Service
metadata:
name: jenkins
labels:
kiamol: ch11
spec:
ports:
- port: 8080
targetPort: jenkins
selector:
app: jenkins
type: LoadBalancer
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: jenkins
labels:
kiamol: ch11
spec:
selector:
matchLabels:
app: jenkins
template:
metadata:
labels:
app: jenkins
spec:
serviceAccountName: jenkins
containers:
- name: jenkins
image: kiamol/ch11-jenkins
ports:
- name: jenkins
containerPort: 8080
volumeMounts:
- name: registry-creds
mountPath: /root/.docker
readOnly: true
volumes:
- name: registry-creds
secret:
secretName: registry-creds
defaultMode: 0400
items:
- key: .dockerconfigjson
path: config.json
---
# RBAC configuration - ignore this until we get to chapter 17 :)
apiVersion: v1
kind: ServiceAccount
metadata:
name: jenkins
labels:
kiamol: ch11
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: jenkins
labels:
kiamol: ch11
rules:
- apiGroups: [""]
resources: [pods"]
verbs: ["create","delete","get","list","patch","update","watch"]
- apiGroups: [""]
resources: [pods/exec"]
verbs: ["create","delete","get","list","patch","update","watch"]
- apiGroups: [""]
resources: [pods/log"]
verbs: [get","list","watch"]
- apiGroups: [""]
resources: ["services","secrets","configmaps"]
verbs: ["get","list","create","delete"]
- apiGroups: ["apps"]
resources: ["deployments"]
verbs: ["get","list","create","delete"]
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: jenkins
labels:
kiamol: ch11
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: jenkins
subjects:
- kind: ServiceAccount
name: jenkins
namespace: default