|
| 1 | +apiVersion: v1 |
| 2 | +kind: Namespace |
| 3 | +metadata: |
| 4 | + name: nginx-gateway |
| 5 | +--- |
| 6 | +# Source: nginx-gateway-fabric/templates/rbac.yaml |
| 7 | +apiVersion: v1 |
| 8 | +kind: ServiceAccount |
| 9 | +metadata: |
| 10 | + name: nginx-gateway |
| 11 | + namespace: nginx-gateway |
| 12 | + labels: |
| 13 | + app.kubernetes.io/name: nginx-gateway |
| 14 | + app.kubernetes.io/instance: nginx-gateway |
| 15 | + app.kubernetes.io/version: "edge" |
| 16 | + annotations: |
| 17 | + {} |
| 18 | +--- |
| 19 | +# Source: nginx-gateway-fabric/templates/rbac.yaml |
| 20 | +apiVersion: rbac.authorization.k8s.io/v1 |
| 21 | +kind: ClusterRole |
| 22 | +metadata: |
| 23 | + name: nginx-gateway |
| 24 | + labels: |
| 25 | + app.kubernetes.io/name: nginx-gateway |
| 26 | + app.kubernetes.io/instance: nginx-gateway |
| 27 | + app.kubernetes.io/version: "edge" |
| 28 | +rules: |
| 29 | +- apiGroups: |
| 30 | + - "" |
| 31 | + resources: |
| 32 | + - namespaces |
| 33 | + - services |
| 34 | + - secrets |
| 35 | + verbs: |
| 36 | + - list |
| 37 | + - watch |
| 38 | +# FIXME(bjee19): make nodes, pods, replicasets permission dependent on telemetry being enabled. |
| 39 | +# https://github.com/nginxinc/nginx-gateway-fabric/issues/1317. |
| 40 | +- apiGroups: |
| 41 | + - "" |
| 42 | + resources: |
| 43 | + - pods |
| 44 | + verbs: |
| 45 | + - get |
| 46 | +- apiGroups: |
| 47 | + - "" |
| 48 | + resources: |
| 49 | + - nodes |
| 50 | + verbs: |
| 51 | + - list |
| 52 | +- apiGroups: |
| 53 | + - "" |
| 54 | + resources: |
| 55 | + - events |
| 56 | + verbs: |
| 57 | + - create |
| 58 | + - patch |
| 59 | +- apiGroups: |
| 60 | + - apps |
| 61 | + resources: |
| 62 | + - replicasets |
| 63 | + verbs: |
| 64 | + - get |
| 65 | +- apiGroups: |
| 66 | + - discovery.k8s.io |
| 67 | + resources: |
| 68 | + - endpointslices |
| 69 | + verbs: |
| 70 | + - list |
| 71 | + - watch |
| 72 | +- apiGroups: |
| 73 | + - gateway.networking.k8s.io |
| 74 | + resources: |
| 75 | + - gatewayclasses |
| 76 | + - gateways |
| 77 | + - httproutes |
| 78 | + - referencegrants |
| 79 | + verbs: |
| 80 | + - list |
| 81 | + - watch |
| 82 | +- apiGroups: |
| 83 | + - gateway.networking.k8s.io |
| 84 | + resources: |
| 85 | + - httproutes/status |
| 86 | + - gateways/status |
| 87 | + - gatewayclasses/status |
| 88 | + verbs: |
| 89 | + - update |
| 90 | +- apiGroups: |
| 91 | + - gateway.nginx.org |
| 92 | + resources: |
| 93 | + - nginxgateways |
| 94 | + verbs: |
| 95 | + - get |
| 96 | + - list |
| 97 | + - watch |
| 98 | +- apiGroups: |
| 99 | + - gateway.nginx.org |
| 100 | + resources: |
| 101 | + - nginxgateways/status |
| 102 | + verbs: |
| 103 | + - update |
| 104 | +- apiGroups: |
| 105 | + - coordination.k8s.io |
| 106 | + resources: |
| 107 | + - leases |
| 108 | + verbs: |
| 109 | + - create |
| 110 | + - get |
| 111 | + - update |
| 112 | +- apiGroups: |
| 113 | + - apiextensions.k8s.io |
| 114 | + resources: |
| 115 | + - customresourcedefinitions |
| 116 | + verbs: |
| 117 | + - list |
| 118 | + - watch |
| 119 | +--- |
| 120 | +# Source: nginx-gateway-fabric/templates/rbac.yaml |
| 121 | +apiVersion: rbac.authorization.k8s.io/v1 |
| 122 | +kind: ClusterRoleBinding |
| 123 | +metadata: |
| 124 | + name: nginx-gateway |
| 125 | + labels: |
| 126 | + app.kubernetes.io/name: nginx-gateway |
| 127 | + app.kubernetes.io/instance: nginx-gateway |
| 128 | + app.kubernetes.io/version: "edge" |
| 129 | +roleRef: |
| 130 | + apiGroup: rbac.authorization.k8s.io |
| 131 | + kind: ClusterRole |
| 132 | + name: nginx-gateway |
| 133 | +subjects: |
| 134 | +- kind: ServiceAccount |
| 135 | + name: nginx-gateway |
| 136 | + namespace: nginx-gateway |
| 137 | +--- |
| 138 | +# Source: nginx-gateway-fabric/templates/deployment.yaml |
| 139 | +apiVersion: apps/v1 |
| 140 | +kind: Deployment |
| 141 | +metadata: |
| 142 | + name: nginx-gateway |
| 143 | + namespace: nginx-gateway |
| 144 | + labels: |
| 145 | + app.kubernetes.io/name: nginx-gateway |
| 146 | + app.kubernetes.io/instance: nginx-gateway |
| 147 | + app.kubernetes.io/version: "edge" |
| 148 | +spec: |
| 149 | + replicas: 1 |
| 150 | + selector: |
| 151 | + matchLabels: |
| 152 | + app.kubernetes.io/name: nginx-gateway |
| 153 | + app.kubernetes.io/instance: nginx-gateway |
| 154 | + template: |
| 155 | + metadata: |
| 156 | + labels: |
| 157 | + app.kubernetes.io/name: nginx-gateway |
| 158 | + app.kubernetes.io/instance: nginx-gateway |
| 159 | + annotations: |
| 160 | + prometheus.io/scrape: "true" |
| 161 | + prometheus.io/port: "9113" |
| 162 | + spec: |
| 163 | + containers: |
| 164 | + - args: |
| 165 | + - static-mode |
| 166 | + - --gateway-ctlr-name=gateway.nginx.org/nginx-gateway-controller |
| 167 | + - --gatewayclass=nginx |
| 168 | + - --config=nginx-gateway-config |
| 169 | + - --service=nginx-gateway |
| 170 | + - --nginx-plus |
| 171 | + - --metrics-port=9113 |
| 172 | + - --health-port=8081 |
| 173 | + - --leader-election-lock-name=nginx-gateway-leader-election |
| 174 | + env: |
| 175 | + - name: POD_IP |
| 176 | + valueFrom: |
| 177 | + fieldRef: |
| 178 | + fieldPath: status.podIP |
| 179 | + - name: POD_NAMESPACE |
| 180 | + valueFrom: |
| 181 | + fieldRef: |
| 182 | + fieldPath: metadata.namespace |
| 183 | + - name: POD_NAME |
| 184 | + valueFrom: |
| 185 | + fieldRef: |
| 186 | + fieldPath: metadata.name |
| 187 | + image: ghcr.io/nginxinc/nginx-gateway-fabric:edge |
| 188 | + imagePullPolicy: Always |
| 189 | + name: nginx-gateway |
| 190 | + ports: |
| 191 | + - name: metrics |
| 192 | + containerPort: 9113 |
| 193 | + - name: health |
| 194 | + containerPort: 8081 |
| 195 | + readinessProbe: |
| 196 | + httpGet: |
| 197 | + path: /readyz |
| 198 | + port: health |
| 199 | + initialDelaySeconds: 3 |
| 200 | + periodSeconds: 1 |
| 201 | + securityContext: |
| 202 | + allowPrivilegeEscalation: false |
| 203 | + capabilities: |
| 204 | + add: |
| 205 | + - KILL |
| 206 | + drop: |
| 207 | + - ALL |
| 208 | + readOnlyRootFilesystem: true |
| 209 | + runAsUser: 102 |
| 210 | + runAsGroup: 1001 |
| 211 | + volumeMounts: |
| 212 | + - name: nginx-conf |
| 213 | + mountPath: /etc/nginx/conf.d |
| 214 | + - name: nginx-secrets |
| 215 | + mountPath: /etc/nginx/secrets |
| 216 | + - name: nginx-run |
| 217 | + mountPath: /var/run/nginx |
| 218 | + - image: nginx-gateway-fabric/nginx-plus:edge |
| 219 | + imagePullPolicy: Always |
| 220 | + name: nginx |
| 221 | + ports: |
| 222 | + - containerPort: 80 |
| 223 | + name: http |
| 224 | + - containerPort: 443 |
| 225 | + name: https |
| 226 | + securityContext: |
| 227 | + capabilities: |
| 228 | + add: |
| 229 | + - NET_BIND_SERVICE |
| 230 | + drop: |
| 231 | + - ALL |
| 232 | + readOnlyRootFilesystem: true |
| 233 | + runAsUser: 101 |
| 234 | + runAsGroup: 1001 |
| 235 | + volumeMounts: |
| 236 | + - name: nginx-conf |
| 237 | + mountPath: /etc/nginx/conf.d |
| 238 | + - name: nginx-secrets |
| 239 | + mountPath: /etc/nginx/secrets |
| 240 | + - name: nginx-run |
| 241 | + mountPath: /var/run/nginx |
| 242 | + - name: nginx-cache |
| 243 | + mountPath: /var/cache/nginx |
| 244 | + - name: nginx-lib |
| 245 | + mountPath: /var/lib/nginx |
| 246 | + terminationGracePeriodSeconds: 30 |
| 247 | + serviceAccountName: nginx-gateway |
| 248 | + shareProcessNamespace: true |
| 249 | + securityContext: |
| 250 | + fsGroup: 1001 |
| 251 | + runAsNonRoot: true |
| 252 | + volumes: |
| 253 | + - name: nginx-conf |
| 254 | + emptyDir: {} |
| 255 | + - name: nginx-secrets |
| 256 | + emptyDir: {} |
| 257 | + - name: nginx-run |
| 258 | + emptyDir: {} |
| 259 | + - name: nginx-cache |
| 260 | + emptyDir: {} |
| 261 | + - name: nginx-lib |
| 262 | + emptyDir: {} |
| 263 | +--- |
| 264 | +# Source: nginx-gateway-fabric/templates/gatewayclass.yaml |
| 265 | +apiVersion: gateway.networking.k8s.io/v1 |
| 266 | +kind: GatewayClass |
| 267 | +metadata: |
| 268 | + name: nginx |
| 269 | + labels: |
| 270 | + app.kubernetes.io/name: nginx-gateway |
| 271 | + app.kubernetes.io/instance: nginx-gateway |
| 272 | + app.kubernetes.io/version: "edge" |
| 273 | +spec: |
| 274 | + controllerName: gateway.nginx.org/nginx-gateway-controller |
| 275 | +--- |
| 276 | +# Source: nginx-gateway-fabric/templates/nginxgateway.yaml |
| 277 | +apiVersion: gateway.nginx.org/v1alpha1 |
| 278 | +kind: NginxGateway |
| 279 | +metadata: |
| 280 | + name: nginx-gateway-config |
| 281 | + namespace: nginx-gateway |
| 282 | + labels: |
| 283 | + app.kubernetes.io/name: nginx-gateway |
| 284 | + app.kubernetes.io/instance: nginx-gateway |
| 285 | + app.kubernetes.io/version: "edge" |
| 286 | +spec: |
| 287 | + logging: |
| 288 | + level: info |
0 commit comments