Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4258 from openshift-cherrypick-robot/cherry-pick-…
…4252-to-release-4.14 [release-4.14] OCPBUGS-30872: add static pods for rbacproxy
- Loading branch information
Showing
7 changed files
with
185 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
templates/master/01-master-kubelet/_base/files/criometricsproxy-config.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
mode: 0644 | ||
path: "/etc/kubernetes/crio-metrics-proxy.cfg" | ||
contents: | ||
inline: |- | ||
authorization: | ||
static: | ||
- resourceRequest: false | ||
path: /metrics | ||
verb: get | ||
user: | ||
name: system:serviceaccount:openshift-monitoring:prometheus-k8s |
75 changes: 75 additions & 0 deletions
75
templates/master/01-master-kubelet/_base/files/criometricsproxy.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
mode: 0644 | ||
path: "/etc/kubernetes/manifests/criometricsproxy.yaml" | ||
contents: | ||
inline: |- | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: kube-rbac-proxy-crio | ||
namespace: openshift-machine-config-operator | ||
spec: | ||
volumes: | ||
- name: etc-kube | ||
hostPath: | ||
path: "/etc/kubernetes" | ||
- name: var-lib-kubelet | ||
hostPath: | ||
path: "/var/lib/kubelet" | ||
hostNetwork: true | ||
priorityClassName: system-cluster-critical | ||
initContainers: | ||
- name: setup | ||
terminationMessagePolicy: FallbackToLogsOnError | ||
image: {{.Images.kubeRbacProxyImage}} | ||
imagePullPolicy: IfNotPresent | ||
volumeMounts: | ||
- name: var-lib-kubelet | ||
mountPath: "/var" | ||
mountPropagation: HostToContainer | ||
command: ['/bin/bash', '-ec'] | ||
args: | ||
- | | ||
echo -n "Waiting for kubelet key and certificate to be available" | ||
while [ -n "$(test -e /var/lib/kubelet/pki/kubelet-server-current.pem)" ] ; do | ||
echo -n "." | ||
sleep 1 | ||
(( tries += 1 )) | ||
if [[ "${tries}" -gt 10 ]]; then | ||
echo "Timed out waiting for kubelet key and cert." | ||
exit 1 | ||
fi | ||
done | ||
securityContext: | ||
privileged: true | ||
resources: | ||
requests: | ||
memory: 50Mi | ||
cpu: 5m | ||
containers: | ||
- name: kube-rbac-proxy-crio | ||
image: {{.Images.kubeRbacProxyImage}} | ||
securityContext: | ||
privileged: true | ||
ports: | ||
- containerPort: 9637 | ||
args: | ||
- --secure-listen-address=:9637 | ||
- --config-file=/etc/kubernetes/crio-metrics-proxy.cfg | ||
- --client-ca-file=/etc/kubernetes/kubelet-ca.crt | ||
- --logtostderr=true | ||
- --kubeconfig=/var/lib/kubelet/kubeconfig | ||
- --tls-cipher-suites=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305 | ||
- --upstream=http://127.0.0.1:9537 | ||
- --tls-cert-file=/var/lib/kubelet/pki/kubelet-server-current.pem | ||
- --tls-private-key-file=/var/lib/kubelet/pki/kubelet-server-current.pem | ||
resources: | ||
requests: | ||
cpu: 20m | ||
memory: 50Mi | ||
volumeMounts: | ||
- name: etc-kube | ||
mountPath: "/etc/kubernetes" | ||
mountPropagation: HostToContainer | ||
- name: var-lib-kubelet | ||
mountPath: "/var/lib/kubelet" | ||
mountPropagation: HostToContainer |
12 changes: 12 additions & 0 deletions
12
templates/worker/01-worker-kubelet/_base/files/criometricsproxy-config.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
mode: 0644 | ||
mode: 0644 | ||
path: "/etc/kubernetes/crio-metrics-proxy.cfg" | ||
contents: | ||
inline: |- | ||
authorization: | ||
static: | ||
- resourceRequest: false | ||
path: /metrics | ||
verb: get | ||
user: | ||
name: system:serviceaccount:openshift-monitoring:prometheus-k8s |
75 changes: 75 additions & 0 deletions
75
templates/worker/01-worker-kubelet/_base/files/criometricsproxy.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
mode: 0644 | ||
path: "/etc/kubernetes/manifests/criometricsproxy.yaml" | ||
contents: | ||
inline: |- | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: kube-rbac-proxy-crio | ||
namespace: openshift-machine-config-operator | ||
spec: | ||
volumes: | ||
- name: etc-kube | ||
hostPath: | ||
path: "/etc/kubernetes" | ||
- name: var-lib-kubelet | ||
hostPath: | ||
path: "/var/lib/kubelet" | ||
hostNetwork: true | ||
priorityClassName: system-cluster-critical | ||
initContainers: | ||
- name: setup | ||
terminationMessagePolicy: FallbackToLogsOnError | ||
image: {{.Images.kubeRbacProxyImage}} | ||
imagePullPolicy: IfNotPresent | ||
volumeMounts: | ||
- name: var-lib-kubelet | ||
mountPath: "/var" | ||
mountPropagation: HostToContainer | ||
command: ['/bin/bash', '-ec'] | ||
args: | ||
- | | ||
echo -n "Waiting for kubelet key and certificate to be available" | ||
while [ -n "$(test -e /var/lib/kubelet/pki/kubelet-server-current.pem)" ] ; do | ||
echo -n "." | ||
sleep 1 | ||
(( tries += 1 )) | ||
if [[ "${tries}" -gt 10 ]]; then | ||
echo "Timed out waiting for kubelet key and cert." | ||
exit 1 | ||
fi | ||
done | ||
securityContext: | ||
privileged: true | ||
resources: | ||
requests: | ||
memory: 50Mi | ||
cpu: 5m | ||
containers: | ||
- name: kube-rbac-proxy-crio | ||
image: {{.Images.kubeRbacProxyImage}} | ||
securityContext: | ||
privileged: true | ||
ports: | ||
- containerPort: 9637 | ||
args: | ||
- --secure-listen-address=:9637 | ||
- --config-file=/etc/kubernetes/crio-metrics-proxy.cfg | ||
- --client-ca-file=/etc/kubernetes/kubelet-ca.crt | ||
- --logtostderr=true | ||
- --kubeconfig=/var/lib/kubelet/kubeconfig | ||
- --tls-cipher-suites=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305 | ||
- --upstream=http://127.0.0.1:9537 | ||
- --tls-cert-file=/var/lib/kubelet/pki/kubelet-server-current.pem | ||
- --tls-private-key-file=/var/lib/kubelet/pki/kubelet-server-current.pem | ||
resources: | ||
requests: | ||
cpu: 20m | ||
memory: 50Mi | ||
volumeMounts: | ||
- name: etc-kube | ||
mountPath: "/etc/kubernetes" | ||
mountPropagation: HostToContainer | ||
- name: var-lib-kubelet | ||
mountPath: "/var/lib/kubelet" | ||
mountPropagation: HostToContainer |