|
| 1 | +apiVersion: template.openshift.io/v1 |
| 2 | +kind: Template |
| 3 | +metadata: |
| 4 | + name: claw-claw |
| 5 | +objects: |
| 6 | +- apiVersion: v1 |
| 7 | + kind: Namespace |
| 8 | + metadata: |
| 9 | + annotations: |
| 10 | + openshift.io/description: ${SPACE_NAME}-claw |
| 11 | + openshift.io/display-name: ${SPACE_NAME}-claw |
| 12 | + openshift.io/requester: ${SPACE_NAME} |
| 13 | + labels: |
| 14 | + name: ${SPACE_NAME}-claw |
| 15 | + name: ${SPACE_NAME}-claw |
| 16 | + |
| 17 | +# Role and RoleBindings for CRT administration (not associated with users) |
| 18 | +- apiVersion: rbac.authorization.k8s.io/v1 |
| 19 | + kind: Role |
| 20 | + metadata: |
| 21 | + name: exec-pods |
| 22 | + namespace: ${SPACE_NAME}-claw |
| 23 | + rules: |
| 24 | + - apiGroups: |
| 25 | + - "" |
| 26 | + resources: |
| 27 | + - pods/exec |
| 28 | + verbs: |
| 29 | + - get |
| 30 | + - list |
| 31 | + - watch |
| 32 | + - create |
| 33 | + - delete |
| 34 | + - update |
| 35 | +- apiVersion: rbac.authorization.k8s.io/v1 |
| 36 | + kind: RoleBinding |
| 37 | + metadata: |
| 38 | + name: crtadmin-view |
| 39 | + namespace: ${SPACE_NAME}-claw |
| 40 | + roleRef: |
| 41 | + apiGroup: rbac.authorization.k8s.io |
| 42 | + kind: ClusterRole |
| 43 | + name: view |
| 44 | + subjects: |
| 45 | + - apiGroup: rbac.authorization.k8s.io |
| 46 | + kind: Group |
| 47 | + name: crtadmin-users-view |
| 48 | +- apiVersion: rbac.authorization.k8s.io/v1 |
| 49 | + kind: RoleBinding |
| 50 | + metadata: |
| 51 | + name: crtadmin-pods |
| 52 | + namespace: ${SPACE_NAME}-claw |
| 53 | + roleRef: |
| 54 | + apiGroup: rbac.authorization.k8s.io |
| 55 | + kind: Role |
| 56 | + name: exec-pods |
| 57 | + subjects: |
| 58 | + - apiGroup: rbac.authorization.k8s.io |
| 59 | + kind: Group |
| 60 | + name: crtadmin-users-view |
| 61 | + |
| 62 | +# ResourceQuota — sized for operator workloads (gateway, proxy, device-pairing) |
| 63 | +# plus headroom for future components and rolling updates. |
| 64 | +- apiVersion: v1 |
| 65 | + kind: ResourceQuota |
| 66 | + metadata: |
| 67 | + name: compute-deploy |
| 68 | + namespace: ${SPACE_NAME}-claw |
| 69 | + spec: |
| 70 | + hard: |
| 71 | + limits.cpu: "8" |
| 72 | + limits.memory: 10Gi |
| 73 | + requests.cpu: "1" |
| 74 | + requests.memory: 3Gi |
| 75 | +- apiVersion: v1 |
| 76 | + kind: ResourceQuota |
| 77 | + metadata: |
| 78 | + name: storage |
| 79 | + namespace: ${SPACE_NAME}-claw |
| 80 | + spec: |
| 81 | + hard: |
| 82 | + limits.ephemeral-storage: 5Gi |
| 83 | + requests.storage: 15Gi |
| 84 | + requests.ephemeral-storage: 5Gi |
| 85 | + count/persistentvolumeclaims: "1" |
| 86 | +# LimitRange — default resource requests/limits for containers |
| 87 | +- apiVersion: v1 |
| 88 | + kind: LimitRange |
| 89 | + metadata: |
| 90 | + name: resource-limits |
| 91 | + namespace: ${SPACE_NAME}-claw |
| 92 | + spec: |
| 93 | + limits: |
| 94 | + - type: "Container" |
| 95 | + default: |
| 96 | + cpu: 500m |
| 97 | + memory: 512Mi |
| 98 | + defaultRequest: |
| 99 | + cpu: 10m |
| 100 | + memory: 64Mi |
| 101 | + |
| 102 | +# NetworkPolicies — sandbox-standard ingress policies |
| 103 | +- apiVersion: networking.k8s.io/v1 |
| 104 | + kind: NetworkPolicy |
| 105 | + metadata: |
| 106 | + name: allow-same-namespace |
| 107 | + namespace: ${SPACE_NAME}-claw |
| 108 | + spec: |
| 109 | + podSelector: {} |
| 110 | + ingress: |
| 111 | + - from: |
| 112 | + - podSelector: {} |
| 113 | +- apiVersion: networking.k8s.io/v1 |
| 114 | + kind: NetworkPolicy |
| 115 | + metadata: |
| 116 | + name: allow-from-openshift-ingress |
| 117 | + namespace: ${SPACE_NAME}-claw |
| 118 | + spec: |
| 119 | + ingress: |
| 120 | + - from: |
| 121 | + - namespaceSelector: |
| 122 | + matchLabels: |
| 123 | + network.openshift.io/policy-group: ingress |
| 124 | + podSelector: {} |
| 125 | + policyTypes: |
| 126 | + - Ingress |
| 127 | +- apiVersion: networking.k8s.io/v1 |
| 128 | + kind: NetworkPolicy |
| 129 | + metadata: |
| 130 | + name: allow-from-openshift-monitoring |
| 131 | + namespace: ${SPACE_NAME}-claw |
| 132 | + spec: |
| 133 | + ingress: |
| 134 | + - from: |
| 135 | + - namespaceSelector: |
| 136 | + matchLabels: |
| 137 | + network.openshift.io/policy-group: monitoring |
| 138 | + podSelector: {} |
| 139 | + policyTypes: |
| 140 | + - Ingress |
| 141 | +- apiVersion: networking.k8s.io/v1 |
| 142 | + kind: NetworkPolicy |
| 143 | + metadata: |
| 144 | + name: allow-from-olm-namespaces |
| 145 | + namespace: ${SPACE_NAME}-claw |
| 146 | + spec: |
| 147 | + ingress: |
| 148 | + - from: |
| 149 | + - namespaceSelector: |
| 150 | + matchLabels: |
| 151 | + openshift.io/scc: anyuid |
| 152 | + podSelector: {} |
| 153 | + policyTypes: |
| 154 | + - Ingress |
| 155 | +- apiVersion: networking.k8s.io/v1 |
| 156 | + kind: NetworkPolicy |
| 157 | + metadata: |
| 158 | + name: allow-from-console-namespaces |
| 159 | + namespace: ${SPACE_NAME}-claw |
| 160 | + spec: |
| 161 | + ingress: |
| 162 | + - from: |
| 163 | + - namespaceSelector: |
| 164 | + matchLabels: |
| 165 | + network.openshift.io/policy-group: console |
| 166 | + podSelector: {} |
| 167 | + policyTypes: |
| 168 | + - Ingress |
| 169 | +parameters: |
| 170 | +- name: SPACE_NAME |
| 171 | + required: true |
0 commit comments