|
| 1 | +apiVersion: v1 |
| 2 | +kind: Service |
| 3 | +metadata: |
| 4 | + name: yurt-coordinator-apiserver |
| 5 | + namespace: {{ .Release.Namespace }} |
| 6 | + annotations: |
| 7 | + openyurt.io/topologyKeys: openyurt.io/nodepool |
| 8 | + labels: |
| 9 | + {{- include "yurt-coordinator.labels" . | nindent 4 }} |
| 10 | +spec: |
| 11 | + type: ClusterIP |
| 12 | + ports: |
| 13 | + - port: 443 |
| 14 | + targetPort: {{ .Values.apiserverSecurePort }} |
| 15 | + protocol: TCP |
| 16 | + name: https |
| 17 | + selector: |
| 18 | + {{- include "yurt-coordinator.selectorLabels" . | nindent 4 }} |
| 19 | +--- |
| 20 | +apiVersion: v1 |
| 21 | +kind: Service |
| 22 | +metadata: |
| 23 | + name: yurt-coordinator-etcd |
| 24 | + namespace: {{ .Release.Namespace }} |
| 25 | + annotations: |
| 26 | + openyurt.io/topologyKeys: openyurt.io/nodepool |
| 27 | + labels: |
| 28 | + {{- include "yurt-coordinator.labels" . | nindent 4 }} |
| 29 | +spec: |
| 30 | + type: ClusterIP |
| 31 | + ports: |
| 32 | + - port: 2379 |
| 33 | + targetPort: {{ .Values.etcdPort }} |
| 34 | + protocol: TCP |
| 35 | + name: https |
| 36 | + selector: |
| 37 | + {{- include "yurt-coordinator.selectorLabels" . | nindent 4 }} |
| 38 | +--- |
| 39 | +apiVersion: apps.openyurt.io/v1alpha1 |
| 40 | +kind: YurtAppDaemon |
| 41 | +metadata: |
| 42 | + name: yurt-coordinator |
| 43 | + namespace: {{ .Release.Namespace }} |
| 44 | + labels: |
| 45 | + {{- include "yurt-coordinator.labels" . | nindent 4 }} |
| 46 | +spec: |
| 47 | + selector: |
| 48 | + matchLabels: |
| 49 | + {{- include "yurt-coordinator.selectorLabels" . | nindent 6 }} |
| 50 | + nodepoolSelector: |
| 51 | + matchLabels: |
| 52 | + openyurt.io/node-pool-type: "edge" |
| 53 | + workloadTemplate: |
| 54 | + deploymentTemplate: |
| 55 | + metadata: |
| 56 | + labels: |
| 57 | + {{- include "yurt-coordinator.labels" . | nindent 10 }} |
| 58 | + spec: |
| 59 | + replicas: 1 |
| 60 | + selector: |
| 61 | + matchLabels: |
| 62 | + {{- include "yurt-coordinator.selectorLabels" . | nindent 12 }} |
| 63 | + template: |
| 64 | + metadata: |
| 65 | + labels: |
| 66 | + {{- include "yurt-coordinator.labels" . | nindent 14 }} |
| 67 | + spec: |
| 68 | + containers: |
| 69 | + - command: |
| 70 | + - kube-apiserver |
| 71 | + - --bind-address=0.0.0.0 |
| 72 | + - --allow-privileged=true |
| 73 | + - --anonymous-auth=true |
| 74 | + - --authorization-mode=Node,RBAC |
| 75 | + - --client-ca-file=/etc/kubernetes/pki/ca.crt |
| 76 | + - --enable-admission-plugins=NodeRestriction |
| 77 | + - --enable-bootstrap-token-auth=true |
| 78 | + - --disable-admission-plugins=ServiceAccount |
| 79 | + - --etcd-cafile=/etc/kubernetes/pki/ca.crt |
| 80 | + - --etcd-certfile=/etc/kubernetes/pki/apiserver-etcd-client.crt |
| 81 | + - --etcd-keyfile=/etc/kubernetes/pki/apiserver-etcd-client.key |
| 82 | + - --etcd-servers=https://127.0.0.1:{{ .Values.etcdPort }} |
| 83 | + - --kubelet-client-certificate=/etc/kubernetes/pki/apiserver-kubelet-client.crt |
| 84 | + - --kubelet-client-key=/etc/kubernetes/pki/apiserver-kubelet-client.key |
| 85 | + - --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname |
| 86 | + - --secure-port={{ .Values.apiserverSecurePort }} |
| 87 | + - --service-account-issuer=https://kubernetes.default.svc.cluster.local |
| 88 | + - --service-account-key-file=/etc/kubernetes/pki/sa.pub |
| 89 | + - --service-account-signing-key-file=/etc/kubernetes/pki/sa.key |
| 90 | + - --service-cluster-ip-range={{ .Values.serviceClusterIPRange }} |
| 91 | + - --tls-cert-file=/etc/kubernetes/pki/apiserver.crt |
| 92 | + - --tls-private-key-file=/etc/kubernetes/pki/apiserver.key |
| 93 | + image: "{{ .Values.apiserverImage.registry }}/{{ .Values.apiserverImage.repository }}:{{ .Values.apiserverImage.tag }}" |
| 94 | + imagePullPolicy: IfNotPresent |
| 95 | + livenessProbe: |
| 96 | + failureThreshold: 8 |
| 97 | + httpGet: |
| 98 | + host: 127.0.0.1 |
| 99 | + path: /livez |
| 100 | + port: {{ .Values.apiserverSecurePort }} |
| 101 | + scheme: HTTPS |
| 102 | + initialDelaySeconds: 10 |
| 103 | + periodSeconds: 10 |
| 104 | + successThreshold: 1 |
| 105 | + timeoutSeconds: 15 |
| 106 | + name: kube-apiserver |
| 107 | + readinessProbe: |
| 108 | + failureThreshold: 3 |
| 109 | + httpGet: |
| 110 | + host: 127.0.0.1 |
| 111 | + path: /readyz |
| 112 | + port: {{ .Values.apiserverSecurePort }} |
| 113 | + scheme: HTTPS |
| 114 | + periodSeconds: 1 |
| 115 | + successThreshold: 1 |
| 116 | + timeoutSeconds: 15 |
| 117 | + {{- if .Values.apiserverResources }} |
| 118 | + resources: |
| 119 | + {{- toYaml .Values.apiserverResources | nindent 18 }} |
| 120 | + {{- end }} |
| 121 | + startupProbe: |
| 122 | + failureThreshold: 24 |
| 123 | + httpGet: |
| 124 | + host: 127.0.0.1 |
| 125 | + path: /livez |
| 126 | + port: {{ .Values.apiserverSecurePort }} |
| 127 | + scheme: HTTPS |
| 128 | + initialDelaySeconds: 10 |
| 129 | + periodSeconds: 10 |
| 130 | + successThreshold: 1 |
| 131 | + timeoutSeconds: 15 |
| 132 | + terminationMessagePath: /dev/termination-log |
| 133 | + terminationMessagePolicy: File |
| 134 | + volumeMounts: |
| 135 | + - mountPath: /etc/kubernetes/pki |
| 136 | + name: yurt-coordinator-certs |
| 137 | + readOnly: true |
| 138 | + - command: |
| 139 | + - etcd |
| 140 | + - --advertise-client-urls=https://0.0.0.0:{{ .Values.etcdPort }} |
| 141 | + - --listen-client-urls=https://0.0.0.0:{{ .Values.etcdPort }} |
| 142 | + - --cert-file=/etc/kubernetes/pki/etcd-server.crt |
| 143 | + - --client-cert-auth=true |
| 144 | + - --max-txn-ops=102400 |
| 145 | + - --data-dir=/var/lib/etcd |
| 146 | + - --max-request-bytes=100000000 |
| 147 | + - --key-file=/etc/kubernetes/pki/etcd-server.key |
| 148 | + - --listen-metrics-urls=http://0.0.0.0:{{ .Values.etcdMetricPort }} |
| 149 | + - --snapshot-count=10000 |
| 150 | + - --trusted-ca-file=/etc/kubernetes/pki/ca.crt |
| 151 | + image: "{{ .Values.etcdImage.registry }}/{{ .Values.etcdImage.repository }}:{{ .Values.etcdImage.tag }}" |
| 152 | + imagePullPolicy: IfNotPresent |
| 153 | + name: etcd |
| 154 | + {{- if .Values.etcdResources}} |
| 155 | + resources: |
| 156 | + {{- toYaml .Values.etcdResources | nindent 18 }} |
| 157 | + {{- end }} |
| 158 | + startupProbe: |
| 159 | + failureThreshold: 24 |
| 160 | + httpGet: |
| 161 | + host: 127.0.0.1 |
| 162 | + path: /health |
| 163 | + port: {{ .Values.etcdMetricPort }} |
| 164 | + scheme: HTTP |
| 165 | + initialDelaySeconds: 10 |
| 166 | + periodSeconds: 10 |
| 167 | + successThreshold: 1 |
| 168 | + timeoutSeconds: 15 |
| 169 | + volumeMounts: |
| 170 | + - mountPath: /var/lib/etcd |
| 171 | + name: etcd-data |
| 172 | + - mountPath: /etc/kubernetes/pki |
| 173 | + name: yurt-coordinator-certs |
| 174 | + readOnly: true |
| 175 | + dnsPolicy: ClusterFirst |
| 176 | + {{- if .Values.imagePullSecrets }} |
| 177 | + imagePullSecrets: |
| 178 | + {{ toYaml .Values.imagePullSecrets | nindent 14 }} |
| 179 | + {{- end }} |
| 180 | + enableServiceLinks: true |
| 181 | + hostNetwork: true |
| 182 | + preemptionPolicy: PreemptLowerPriority |
| 183 | + priority: 2000001000 |
| 184 | + priorityClassName: system-node-critical |
| 185 | + restartPolicy: Always |
| 186 | + schedulerName: default-scheduler |
| 187 | + securityContext: |
| 188 | + seccompProfile: |
| 189 | + type: RuntimeDefault |
| 190 | + terminationGracePeriodSeconds: 30 |
| 191 | + volumes: |
| 192 | + - emptyDir: |
| 193 | + medium: Memory |
| 194 | + name: etcd-data |
| 195 | + - projected: |
| 196 | + defaultMode: 420 |
| 197 | + sources: |
| 198 | + - secret: |
| 199 | + name: yurt-coordinator-dynamic-certs |
| 200 | + - secret: |
| 201 | + name: yurt-coordinator-static-certs |
| 202 | + name: yurt-coordinator-certs |
| 203 | +--- |
| 204 | +apiVersion: rbac.authorization.k8s.io/v1 |
| 205 | +kind: ClusterRole |
| 206 | +metadata: |
| 207 | + name: openyurt:yurt-coordinator:node-lease-proxy-client |
| 208 | +rules: |
| 209 | + - apiGroups: |
| 210 | + - "coordination.k8s.io" |
| 211 | + resources: |
| 212 | + - leases |
| 213 | + verbs: |
| 214 | + - get |
| 215 | + - update |
| 216 | +--- |
| 217 | +apiVersion: rbac.authorization.k8s.io/v1 |
| 218 | +kind: ClusterRoleBinding |
| 219 | +metadata: |
| 220 | + name: openyurt:yurt-coordinator:node-lease-proxy-client |
| 221 | +roleRef: |
| 222 | + apiGroup: rbac.authorization.k8s.io |
| 223 | + kind: ClusterRole |
| 224 | + name: openyurt:yurt-coordinator:node-lease-proxy-client |
| 225 | +subjects: |
| 226 | + - apiGroup: rbac.authorization.k8s.io |
| 227 | + kind: User |
| 228 | + name: openyurt:yurt-coordinator:node-lease-proxy-client |
0 commit comments