mirror of
https://github.com/netbirdio/netbird-kubeapi-proxy.git
synced 2026-09-23 09:34:58 -07:00
Add initial API server proxy
Co-authored-by: Shyam <shyam0904a@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: netbird-kubeapi-proxy
|
||||
labels:
|
||||
app.kubernetes.io/name: netbird-kubeapi-proxy
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: netbird-kubeapi-proxy
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: netbird-kubeapi-proxy
|
||||
spec:
|
||||
serviceAccountName: netbird-kubeapi-proxy
|
||||
securityContext:
|
||||
seccompProfile:
|
||||
type: RuntimeDefault
|
||||
containers:
|
||||
- name: proxy
|
||||
image: ghcr.io/netbirdio/netbird-kubeapi-proxy:dev
|
||||
args:
|
||||
- --api-key=$(API_KEY)
|
||||
- --setup-key=$(SETUP_KEY)
|
||||
- --instance-name=$(POD_NAME)
|
||||
- --cluster-name=kubernetes
|
||||
env:
|
||||
- name: POD_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
- name: SETUP_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: netbird-kubeapi-proxy
|
||||
key: setup-key
|
||||
- name: API_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: netbird-kubeapi-proxy
|
||||
key: api-key
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
readOnlyRootFilesystem: true
|
||||
runAsNonRoot: true
|
||||
capabilities:
|
||||
drop:
|
||||
- ALL
|
||||
@@ -0,0 +1,5 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- deployment.yaml
|
||||
- rbac.yaml
|
||||
@@ -0,0 +1,38 @@
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: netbird-kubeapi-proxy
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: netbird-kubeapi-proxy
|
||||
rules:
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- users
|
||||
- groups
|
||||
verbs:
|
||||
- impersonate
|
||||
|
||||
- apiGroups:
|
||||
- authentication.k8s.io
|
||||
resources:
|
||||
- userextras/*
|
||||
- uids
|
||||
verbs:
|
||||
- impersonate
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: netbird-kubeapi-proxy
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: netbird-kubeapi-proxy
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: netbird-kubeapi-proxy
|
||||
namespace: default
|
||||
Reference in New Issue
Block a user