Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sync sync sync
- Loading branch information
Showing
7 changed files
with
166 additions
and
10 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
10 changes: 10 additions & 0 deletions
10
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,10 @@ | ||
mode: 0644 | ||
path: "/etc/kube-rbac-proxy/crio-metrics-proxy.cfg" | ||
contents: | ||
inline: |- | ||
authorization: | ||
resourceAttributes: | ||
apiVersion: v1 | ||
resource: namespace | ||
subresource: metrics | ||
namespace: openshift-machine-config-operator |
67 changes: 67 additions & 0 deletions
67
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,67 @@ | ||
mode: 0644 | ||
path: "/etc/kubernetes/manifests/criometricsproxy.yaml" | ||
contents: | ||
inline: |- | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: crio-kube-rbac-proxy | ||
namespace: openshift-machine-config-operator | ||
spec: | ||
volumes: | ||
- name: host-fs | ||
hostPath: | ||
path: "/" | ||
hostNetwork: true | ||
initContainers: | ||
- name: setup | ||
terminationMessagePolicy: FallbackToLogsOnError | ||
image: {{.Images.kubeRbacProxyImage}} | ||
imagePullPolicy: IfNotPresent | ||
volumeMounts: | ||
- name: host-fs | ||
mountPath: "/host" | ||
mountPropagation: HostToContainer | ||
command: ['/bin/bash', '-ec'] | ||
args: | ||
- | | ||
echo -n "Waiting for kubelet key and certificate to be available" | ||
while [ -n "$(ls /host/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: crio-kube-rbac-proxy | ||
image: {{.Images.kubeRbacProxyImage}} | ||
securityContext: | ||
privileged: true | ||
ports: | ||
- containerPort: 9637 | ||
args: | ||
- --secure-listen-address=:9637 | ||
- --logtostderr=true | ||
- --config-file=/host/etc/kube-rbac-proxy/crio-metrics-proxy.cfg | ||
- --kubeconfig=/host/etc/kubernetes/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=/host/var/lib/kubelet/pki/kubelet-server-current.pem | ||
- --tls-private-key-file=/host/var/lib/kubelet/pki/kubelet-server-current.pem | ||
resources: | ||
requests: | ||
cpu: 20m | ||
memory: 50Mi | ||
volumeMounts: | ||
- name: host-fs | ||
mountPath: "/host" | ||
mountPropagation: HostToContainer |
10 changes: 10 additions & 0 deletions
10
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,10 @@ | ||
mode: 0644 | ||
path: "/etc/kube-rbac-proxy/crio-metrics-proxy.cfg" | ||
contents: | ||
inline: |- | ||
authorization: | ||
resourceAttributes: | ||
apiVersion: v1 | ||
resource: namespace | ||
subresource: metrics | ||
namespace: openshift-machine-config-operator |
67 changes: 67 additions & 0 deletions
67
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,67 @@ | ||
mode: 0644 | ||
path: "/etc/kubernetes/manifests/criometricsproxy.yaml" | ||
contents: | ||
inline: |- | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: crio-kube-rbac-proxy | ||
namespace: openshift-machine-config-operator | ||
spec: | ||
volumes: | ||
- name: host-fs | ||
hostPath: | ||
path: "/" | ||
hostNetwork: true | ||
initContainers: | ||
- name: setup | ||
terminationMessagePolicy: FallbackToLogsOnError | ||
image: {{.Images.kubeRbacProxyImage}} | ||
imagePullPolicy: IfNotPresent | ||
volumeMounts: | ||
- name: host-fs | ||
mountPath: "/host" | ||
mountPropagation: HostToContainer | ||
command: ['/bin/bash', '-ec'] | ||
args: | ||
- | | ||
echo -n "Waiting for kubelet key and certificate to be available" | ||
while [ -n "$(ls /host/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: crio-kube-rbac-proxy | ||
image: {{.Images.kubeRbacProxyImage}} | ||
securityContext: | ||
privileged: true | ||
ports: | ||
- containerPort: 9637 | ||
args: | ||
- --secure-listen-address=:9637 | ||
- --config-file=/host/etc/kube-rbac-proxy/crio-metrics-proxy.cfg | ||
- --logtostderr=true | ||
- --kubeconfig=/host/etc/kubernetes/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=/host/var/lib/kubelet/pki/kubelet-server-current.pem | ||
- --tls-private-key-file=/host/var/lib/kubelet/pki/kubelet-server-current.pem | ||
resources: | ||
requests: | ||
cpu: 20m | ||
memory: 50Mi | ||
volumeMounts: | ||
- name: host-fs | ||
mountPath: "/host" | ||
mountPropagation: HostToContainer |