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

no-screen-solution #21

Open
wants to merge 1 commit 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
2 changes: 1 addition & 1 deletion .infrastructure/app/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@ spec:
secretName: app-secret
- name: app-config-volume
configMap:
name: app-config
name: app-config
3 changes: 2 additions & 1 deletion bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ kubectl apply -f .infrastructure/app/clusterIp.yml
kubectl apply -f .infrastructure/app/nodeport.yml
kubectl apply -f .infrastructure/app/hpa.yml
kubectl apply -f .infrastructure/app/deployment.yml
kubectl apply -f .infrastructure/security/rbac.yml

# Install Ingress Controller
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml
# kubectl apply -f .infrastructure/ingress/ingress.yml
kubectl apply -f .infrastructure/ingress/ingress.yml
106 changes: 49 additions & 57 deletions cluster.yml
Original file line number Diff line number Diff line change
@@ -1,61 +1,53 @@
# this config file contains all config fields with comments
# NOTE: this is not a particularly useful config file
apiVersion: kind.x-k8s.io/v1alpha4
kind: Cluster
# patch the generated kubeadm config with some extra settings
apiVersion: kind.x-k8s.io/v1alpha4

# Patch the generated kubeadm config with some extra settings
kubeadmConfigPatches:
- |
apiVersion: kubelet.config.k8s.io/v1beta1
kind: KubeletConfiguration
evictionHard:
nodefs.available: "0%"
# patch it further using a JSON 6902 patch
- |
apiVersion: kubelet.config.k8s.io/v1beta1
kind: KubeletConfiguration
evictionHard:
nodefs.available: "0%"
# Patch it further using a JSON 6902 patch
kubeadmConfigPatchesJSON6902:
- group: kubeadm.k8s.io
version: v1beta3
kind: ClusterConfiguration
patch: |
- op: add
path: /apiServer/certSANs/-
value: my-hostname
# 2 control plane node and 2 workers
- group: kubeadm.k8s.io
version: v1beta3
kind: ClusterConfiguration
patch: |
- op: add
path: /apiServer/certSANs/-
value: my-hostname
# 2 control plane nodes and 2 workers
nodes:
# the control plane node config
- role: control-plane
extraMounts:
- hostPath: /tmp
containerPath: /data
kubeadmConfigPatches:
- |
kind: InitConfiguration
nodeRegistration:
kubeletExtraArgs:
node-labels: "ingress-ready=true"
extraPortMappings:
- containerPort: 30007
hostPort: 30007
- containerPort: 30008
hostPort: 30008
- containerPort: 80
hostPort: 80
protocol: TCP
- containerPort: 443
hostPort: 443
protocol: TCP
# the two workers
- role: worker
extraMounts:
- hostPath: /tmp
containerPath: /data
- role: worker
extraMounts:
- hostPath: /tmp
containerPath: /data
- role: worker
extraMounts:
- hostPath: /tmp
containerPath: /data
- role: worker
extraMounts:
- hostPath: /tmp
containerPath: /data
# The control plane node config
- role: control-plane
extraMounts:
- hostPath: /tmp
containerPath: /data
kubeadmConfigPatches:
- |
kind: InitConfiguration
nodeRegistration:
kubeletExtraArgs:
node-labels: "ingress-ready=true"
extraPortMappings:
- containerPort: 30007
hostPort: 30007
- containerPort: 30008
hostPort: 30008
- containerPort: 80
hostPort: 80
protocol: TCP
- containerPort: 443
hostPort: 443
protocol: TCP

# The worker nodes
- role: worker
extraMounts:
- hostPath: /tmp
containerPath: /data
- role: worker
extraMounts:
- hostPath: /tmp
containerPath: /data
35 changes: 35 additions & 0 deletions security/rbac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: secrets-reader
namespace: todoapp
secrets:
- name: secrets-reader-token

---

apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: secrets-reader
namespace: todoapp
rules:
- apiGroups: [""]
resources: ["secrets"]
verbs: ["list", "get"]

---

apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: secrets-reader-binding
namespace: todoapp
subjects:
- kind: ServiceAccount
name: secrets-reader
namespace: todoapp
roleRef:
kind: Role
name: secrets-reader
apiGroup: rbac.authorization.k8s.io