homework 12.2: complete rest tasks

This commit is contained in:
2022-11-09 10:22:11 +07:00
parent b1b8546066
commit 71e0b53442
6 changed files with 72 additions and 16 deletions

View File

@@ -0,0 +1,20 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello-node-deployment
labels:
app: hello-node
spec:
replicas: 2
selector:
matchLabels:
app: hello-node
template:
metadata:
labels:
app: hello-node
spec:
containers:
- name: hello-node
image: k8s.gcr.io/echoserver:1.4

View File

@@ -0,0 +1,9 @@
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: readonlyrole
rules:
- apiGroups: [""]
resources: ["pods", "pods/log"]
verbs: ["get", "list", "watch"]

View File

@@ -0,0 +1,12 @@
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: readonlybinding
subjects:
- kind: ServiceAccount
name: readonlyuser
namespace: default
roleRef:
kind: ClusterRole
name: readonlyrole

View File

@@ -0,0 +1,9 @@
---
apiVersion: v1
kind: Secret
metadata:
name: oke-kubeconfig-sa-token
namespace: default
annotations:
kubernetes.io/service-account.name: readonlyuser
type: kubernetes.io/service-account-token

View File

@@ -0,0 +1,6 @@
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: readonlyuser
automountServiceAccountToken: false