Skip to content

Commit 8506ecc

Browse files
authored
Merge pull request #9149 from ameukam/kops-discovery-server-deploy
deploy kops discovery server
2 parents 3762ff0 + 30d1d8e commit 8506ecc

5 files changed

Lines changed: 134 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
apiVersion: argoproj.io/v1alpha1
2+
kind: Application
3+
metadata:
4+
name: kops-discovery
5+
spec:
6+
destination:
7+
namespace: kops-discovery
8+
server: https://kubernetes.default.svc
9+
project: default
10+
source:
11+
path: kubernetes/gke-utility/kops-discovery
12+
repoURL: https://github.com/kubernetes/k8s.io
13+
targetRevision: main
14+
syncPolicy:
15+
automated:
16+
prune: true
17+
selfHeal: true
18+
syncOptions:
19+
- CreateNamespace=true
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: kops-discovery
5+
labels:
6+
app: kops-discovery
7+
spec:
8+
replicas: 2
9+
selector:
10+
matchLabels:
11+
app: kops-discovery
12+
strategy:
13+
rollingUpdate:
14+
maxSurge: 1
15+
maxUnavailable: 1
16+
type: RollingUpdate
17+
template:
18+
metadata:
19+
labels:
20+
app: kops-discovery
21+
spec:
22+
serviceAccountName: kops-discovery
23+
terminationGracePeriodSeconds: 30
24+
securityContext:
25+
runAsNonRoot: true
26+
seccompProfile:
27+
type: RuntimeDefault
28+
containers:
29+
- name: discovery-server
30+
image: registry.k8s.io/kops/discovery-server:1.35.0-beta.1
31+
args:
32+
- --listen=:8443
33+
- --storage=memory
34+
ports:
35+
- name: https
36+
containerPort: 8443
37+
protocol: TCP
38+
resources:
39+
requests:
40+
cpu: 100m
41+
memory: 128Mi
42+
limits:
43+
cpu: 500m
44+
memory: 256Mi
45+
securityContext:
46+
allowPrivilegeEscalation: false
47+
readOnlyRootFilesystem: true
48+
capabilities:
49+
drop:
50+
- ALL
51+
# Note: kops discovery server has no health endpoints, using TCP probe
52+
livenessProbe:
53+
tcpSocket:
54+
port: 8443
55+
initialDelaySeconds: 10
56+
periodSeconds: 10
57+
timeoutSeconds: 5
58+
failureThreshold: 3
59+
readinessProbe:
60+
tcpSocket:
61+
port: 8443
62+
initialDelaySeconds: 5
63+
periodSeconds: 5
64+
timeoutSeconds: 3
65+
failureThreshold: 3
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
namespace: kops-discovery
4+
5+
resources:
6+
- rbac.yaml
7+
- deployment.yaml
8+
- service.yaml
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
apiVersion: v1
2+
kind: ServiceAccount
3+
metadata:
4+
name: kops-discovery
5+
---
6+
apiVersion: rbac.authorization.k8s.io/v1
7+
kind: Role
8+
metadata:
9+
name: kops-discovery
10+
rules:
11+
# Minimal permissions - discovery server uses in-memory storage
12+
# Add permissions here if external storage integration is needed
13+
- apiGroups: [""]
14+
resources: ["configmaps"]
15+
verbs: ["get", "list", "watch"]
16+
---
17+
apiVersion: rbac.authorization.k8s.io/v1
18+
kind: RoleBinding
19+
metadata:
20+
name: kops-discovery
21+
roleRef:
22+
apiGroup: rbac.authorization.k8s.io
23+
kind: Role
24+
name: kops-discovery
25+
subjects:
26+
- kind: ServiceAccount
27+
name: kops-discovery
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: kops-discovery
5+
labels:
6+
app: kops-discovery
7+
spec:
8+
type: ClusterIP
9+
ports:
10+
- name: https
11+
port: 443
12+
targetPort: 8443
13+
protocol: TCP
14+
selector:
15+
app: kops-discovery

0 commit comments

Comments
 (0)