Skip to content

Commit 3344045

Browse files
committed
Init Persian localization - Part 29
1 parent 3264ef6 commit 3344045

File tree

386 files changed

+9730
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

386 files changed

+9730
-0
lines changed

content/fa/examples/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
برای اجرای تست‌های محلی‌سازی، از دستور زیر استفاده کنید:
2+
3+
```
4+
go test k8s.io/website/content/<lang>/examples
5+
```
6+
7+
where `<lang>` is the two character representation of a language. For example:
8+
9+
```
10+
go test k8s.io/website/content/en/examples
11+
```
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: ClusterRole
3+
metadata:
4+
name: csr-approver
5+
rules:
6+
- apiGroups:
7+
- certificates.k8s.io
8+
resources:
9+
- certificatesigningrequests
10+
verbs:
11+
- get
12+
- list
13+
- watch
14+
- apiGroups:
15+
- certificates.k8s.io
16+
resources:
17+
- certificatesigningrequests/approval
18+
verbs:
19+
- update
20+
- apiGroups:
21+
- certificates.k8s.io
22+
resources:
23+
- signers
24+
resourceNames:
25+
- example.com/my-signer-name # example.com/* can be used to authorize for all signers in the 'example.com' domain
26+
verbs:
27+
- approve
28+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: ClusterRole
3+
metadata:
4+
name: csr-creator
5+
rules:
6+
- apiGroups:
7+
- certificates.k8s.io
8+
resources:
9+
- certificatesigningrequests
10+
verbs:
11+
- create
12+
- get
13+
- list
14+
- watch
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: ClusterRole
3+
metadata:
4+
name: csr-signer
5+
rules:
6+
- apiGroups:
7+
- certificates.k8s.io
8+
resources:
9+
- certificatesigningrequests
10+
verbs:
11+
- get
12+
- list
13+
- watch
14+
- apiGroups:
15+
- certificates.k8s.io
16+
resources:
17+
- certificatesigningrequests/status
18+
verbs:
19+
- update
20+
- apiGroups:
21+
- certificates.k8s.io
22+
resources:
23+
- signers
24+
resourceNames:
25+
- example.com/my-signer-name # example.com/* can be used to authorize for all signers in the 'example.com' domain
26+
verbs:
27+
- sign
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
apiVersion: admissionregistration.k8s.io/v1
2+
kind: ValidatingAdmissionPolicy
3+
metadata:
4+
name: "deploy-replica-policy.example.com"
5+
spec:
6+
paramKind:
7+
apiVersion: rules.example.com/v1
8+
kind: ReplicaLimit
9+
matchConstraints:
10+
resourceRules:
11+
- apiGroups: ["apps"]
12+
apiVersions: ["v1"]
13+
operations: ["CREATE", "UPDATE"]
14+
resources: ["deployments"]
15+
validations:
16+
- expression: "object.spec.replicas <= params.maxReplicas"
17+
messageExpression: "'object.spec.replicas must be no greater than ' + string(params.maxReplicas)"
18+
reason: Invalid
19+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: ClusterRole
3+
metadata:
4+
annotations:
5+
kubernetes.io/description: |-
6+
Add endpoints write permissions to the edit and admin roles. This was
7+
removed by default in 1.22 because of CVE-2021-25740. See
8+
https://issue.k8s.io/103675. This can allow writers to direct LoadBalancer
9+
or Ingress implementations to expose backend IPs that would not otherwise
10+
be accessible, and can circumvent network policies or security controls
11+
intended to prevent/isolate access to those backends.
12+
EndpointSlices were never included in the edit or admin roles, so there
13+
is nothing to restore for the EndpointSlice API.
14+
labels:
15+
rbac.authorization.k8s.io/aggregate-to-edit: "true"
16+
name: custom:aggregate-to-edit:endpoints # you can change this if you wish
17+
rules:
18+
- apiGroups: [""]
19+
resources: ["endpoints"]
20+
verbs: ["create", "delete", "deletecollection", "patch", "update"]
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# This policy enforces that all containers of a deployment has the image repo match the environment label of its namespace.
2+
# Except for "exempt" deployments, or any containers that do not belong to the "example.com" organization (e.g. common sidecars).
3+
# For example, if the namespace has a label of {"environment": "staging"}, all container images must be either staging.example.com/*
4+
# or do not contain "example.com" at all, unless the deployment has {"exempt": "true"} label.
5+
apiVersion: admissionregistration.k8s.io/v1
6+
kind: ValidatingAdmissionPolicy
7+
metadata:
8+
name: "image-matches-namespace-environment.policy.example.com"
9+
spec:
10+
failurePolicy: Fail
11+
matchConstraints:
12+
resourceRules:
13+
- apiGroups: ["apps"]
14+
apiVersions: ["v1"]
15+
operations: ["CREATE", "UPDATE"]
16+
resources: ["deployments"]
17+
variables:
18+
- name: environment
19+
expression: "'environment' in namespaceObject.metadata.labels ? namespaceObject.metadata.labels['environment'] : 'prod'"
20+
- name: exempt
21+
expression: "'exempt' in object.metadata.labels && object.metadata.labels['exempt'] == 'true'"
22+
- name: containers
23+
expression: "object.spec.template.spec.containers"
24+
- name: containersToCheck
25+
expression: "variables.containers.filter(c, c.image.contains('example.com/'))"
26+
validations:
27+
- expression: "variables.exempt || variables.containersToCheck.all(c, c.image.startsWith(variables.environment + '.'))"
28+
messageExpression: "'only ' + variables.environment + ' images are allowed in namespace ' + namespaceObject.metadata.name"
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: ClusterRole
3+
metadata:
4+
# "namespace" omitted since ClusterRoles are not namespaced
5+
name: secret-reader
6+
rules:
7+
- apiGroups: [""]
8+
#
9+
# at the HTTP level, the name of the resource for accessing Secret
10+
# objects is "secrets"
11+
resources: ["secrets"]
12+
verbs: ["get", "watch", "list"]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
# This cluster role binding allows anyone in the "manager" group to read secrets in any namespace.
3+
kind: ClusterRoleBinding
4+
metadata:
5+
name: read-secrets-global
6+
subjects:
7+
- kind: Group
8+
name: manager # Name is case sensitive
9+
apiGroup: rbac.authorization.k8s.io
10+
roleRef:
11+
kind: ClusterRole
12+
name: secret-reader
13+
apiGroup: rbac.authorization.k8s.io
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: Role
3+
metadata:
4+
namespace: default
5+
name: pod-reader
6+
rules:
7+
- apiGroups: [""] # "" indicates the core API group
8+
resources: ["pods"]
9+
verbs: ["get", "watch", "list"]

0 commit comments

Comments
 (0)