Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/v1.29.2 #245

Merged
merged 86 commits into from
Aug 9, 2024
Merged
Changes from 1 commit
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
d7672dd
feat(monitoring): add remoteWrite to Prometheus and Prometheus Agent …
ralgozino Jun 27, 2024
11e2d63
chore: generate go-models
ralgozino Jun 27, 2024
be22e2d
feat(logging): add customOuputs type
ralgozino Jul 3, 2024
17e350d
feature(networking): add internal Hubble ingress
ralgozino Jul 4, 2024
51035d3
feature(onpremises): support containerd mirrors
ralgozino Jul 8, 2024
b2a8cf5
feat(templates/dr): add selectors and tolerations to minio and velero…
Jul 11, 2024
4eeab9e
fix(templates/dr): add namespace to minio job
Jul 11, 2024
8120c6f
feat(templates/dr): modify velero cron
Jul 11, 2024
5970053
feat(templates/dr): change velero cron fields
Jul 11, 2024
0edab42
feat(monitoring): add remoteWrite to Prometheus and Prometheus Agent …
ralgozino Jun 27, 2024
7dc59d6
chore: generate go-models
ralgozino Jun 27, 2024
f863a40
chore: update schema fields description and go models
ralgozino Jul 18, 2024
073eebb
feature(onprem): enable haproxy monitoring
ralgozino Jul 17, 2024
7cb3b99
Add new schema fields to configure Pomerium
alessiodionisi Apr 24, 2024
116f942
feat: additional parameters for oidc settings
nutellinoit Jul 31, 2024
02c22fa
Merge pull request #213 from sighupio/pomerium-routes-configuration
nutellinoit Jul 31, 2024
94714bf
Merge branch 'feat/v1.29.2' into feature-prometheus-agent
nutellinoit Jul 31, 2024
907c80a
Merge pull request #228 from sighupio/feature-prometheus-agent
nutellinoit Jul 31, 2024
c45a851
Merge branch 'feat/v1.29.2' into feature-hubble-ingress
nutellinoit Jul 31, 2024
6c41064
Merge pull request #230 from sighupio/feature-hubble-ingress
nutellinoit Jul 31, 2024
7ffdedd
Merge branch 'feat/v1.29.2' into feature-logging-customOutputs
nutellinoit Jul 31, 2024
add2271
Merge pull request #229 from sighupio/feature-logging-customOutputs
nutellinoit Jul 31, 2024
bb9acb0
Merge branch 'feat/v1.29.2' into feature-containerd-registry-mirrors
nutellinoit Jul 31, 2024
1662887
Merge pull request #232 from sighupio/feature-containerd-registry-mir…
nutellinoit Jul 31, 2024
3b71cb2
Merge pull request #233 from sighupio/feat/minio-velero-selectors
nutellinoit Jul 31, 2024
9387770
Merge pull request #234 from sighupio/feat/modify-velero-cron
nutellinoit Jul 31, 2024
5bb6fc0
Merge pull request #236 from sighupio/feature-haproxy-monitoring
nutellinoit Jul 31, 2024
0c1768a
Update kfd.yaml
nutellinoit Jul 31, 2024
b6f0d48
Merge branch 'feat/v1.29.2' into feat/additional-advanced-fields-oidc
nutellinoit Jul 31, 2024
763fc53
Merge pull request #239 from sighupio/feat/additional-advanced-fields…
nutellinoit Jul 31, 2024
8a35932
Add Forecastle groups in ingress with SSO enabled
Jun 7, 2024
d8de6a5
feat(monitoring): add remoteWrite to Prometheus and Prometheus Agent …
ralgozino Jun 27, 2024
8d3a5fa
feat(logging): add customOuputs type
ralgozino Jul 3, 2024
ed158ae
feature(networking): add internal Hubble ingress
ralgozino Jul 4, 2024
48b2b26
feat(monitoring): add remoteWrite to Prometheus and Prometheus Agent …
ralgozino Jun 27, 2024
bd7aafc
chore: update schema fields description and go models
ralgozino Jul 18, 2024
f06a080
Add new schema fields to configure Pomerium
alessiodionisi Apr 24, 2024
8ef3d13
fix: post rebase
Jul 31, 2024
73a532c
fix: post rebase
Jul 31, 2024
5a449a8
chore: regenate models
Jul 31, 2024
75839c4
chore: regen schema docs
Jul 31, 2024
11d3d70
Update kfd.yaml
nutellinoit Jul 31, 2024
ff0f59c
Update kfd.yaml
nutellinoit Jul 31, 2024
f982552
Update kfd.yaml
nutellinoit Jul 31, 2024
5e975a5
chore(schema): improve pomerium secrets description
ralgozino Jul 31, 2024
3e2d320
Update kfd.yaml
sbruzzese902 Jul 31, 2024
3c5b791
Merge pull request #240 from sighupio/pomerium-secrets-description
ralgozino Jul 31, 2024
7d72a4c
fix: add viewers_can_edit to true otherwise the explore tab is not sh…
nutellinoit Jul 31, 2024
ca41027
Update kfd.yaml
sbruzzese902 Jul 31, 2024
07898a3
feat: prepare to test 1.29.2 rcs
nutellinoit Jul 31, 2024
fe1a738
feat: bump furyctl to v0.29.4-rc.0
nutellinoit Jul 31, 2024
dde1588
feat: add playbook tpl for cluster certificates renewal
stefanoghinelli Aug 1, 2024
7ca1aee
fix(templates/monitoring): don't apply grafana config when type is pr…
ralgozino Aug 1, 2024
0dc5207
Merge pull request #242 from sighupio/fix-promagent-no-grafana-config
ralgozino Aug 1, 2024
3db800d
fix: add guards on kfddistribution provider for haproxy scrape configs
nutellinoit Aug 1, 2024
4c8e047
Apply suggestions from code review
nutellinoit Aug 1, 2024
65521b4
Merge pull request #243 from sighupio/fix/haproxy-scrapeconfigs-when-…
nutellinoit Aug 1, 2024
2c5a43f
Merge branch 'feat/v1.29.2' into feat/certificates-renewal
nutellinoit Aug 1, 2024
0c7b408
hotfix: missing SIGNING_KEY on e2e tests
nutellinoit Aug 1, 2024
6ab4135
fix: aws templates on tf
Aug 1, 2024
4c484ba
fix: define hubbleIngress template only for onprem and kfddistro
ralgozino Aug 1, 2024
27ceeac
fix: set networking ingress disabled by default
Aug 1, 2024
3a3c26a
fix: change condition for minio-dr patch
Aug 1, 2024
eb81a59
Merge pull request #244 from sighupio/bugfix/aws-module-tf
sbruzzese902 Aug 1, 2024
af5e8aa
Merge branch 'feat/v1.29.2' into feat/certificates-renewal
nutellinoit Aug 1, 2024
55c36f4
fix: since kubectl is executed on the masters, the command is not usi…
nutellinoit Aug 1, 2024
97847ea
fix: too many }} and "
nutellinoit Aug 1, 2024
1406095
Merge pull request #241 from sighupio/feat/certificates-renewal
stefanoghinelli Aug 1, 2024
19bce7a
feat: bump furyctl version
nutellinoit Aug 1, 2024
9cbb986
docs: add WIP v1.29.2 release notes
nutellinoit Aug 1, 2024
1387ceb
fix: linting
nutellinoit Aug 1, 2024
fda3b45
docs: added websocket suppor fix
nutellinoit Aug 1, 2024
0989116
fix: linting, again
nutellinoit Aug 1, 2024
c8b8180
chore: added description to cluster name maxLength increase
Aug 1, 2024
4e2fd32
chore: add description to sso configuration improvement
stefanoghinelli Aug 1, 2024
521b859
chore: add example to sso configuration improvement
stefanoghinelli Aug 1, 2024
9931db4
Add pomerium policy settings for hubble ui (#247)
alessiodionisi Aug 5, 2024
5be4739
docs: add release v1.27.7 and v1.28.2
nutellinoit Aug 8, 2024
f9093f4
docs: update compatibility matrix
nutellinoit Aug 8, 2024
2e5740f
feat: update kfd.yaml with the correct fury version
nutellinoit Aug 8, 2024
1ed5fb8
Merge pull request #246 from sighupio/docs/v1.29.2-and-lower-versions
nutellinoit Aug 8, 2024
ca1c29c
feat: add generate-docs command
alessiodionisi Aug 8, 2024
ce775e7
docs: update main README with correct versions
nutellinoit Aug 8, 2024
d719c03
feat: bump furyctl version for e2e tests
nutellinoit Aug 8, 2024
2bbe30e
feat: reduce e2e test concurrency
nutellinoit Aug 8, 2024
b2c9271
feat: update onpremise installer to v1.29.3-rev.2
nutellinoit Aug 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: add playbook tpl for cluster certificates renewal
  • Loading branch information
stefanoghinelli committed Aug 1, 2024
commit dde158870b8e6203e939f044cf145e39f1c3caf6
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
# Copyright (c) 2017-present SIGHUP s.r.l All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
#
# Kubernetes PKI certificates renewal playbook
#
# This playbook automates the Kubernetes certificates renewal process, it performs:
# 1. Renew Control Plane certificates.
# 2. Renew Kubelet certificates.
# 3. Print all certificates expiration dates for check.
#
# Check for expiration first e.g. via executing the following on a master node via:
#
# find /etc/kubernetes/pki /etc/etcd/pki -type f -name "*.crt" -print | sort |
# egrep -v 'ca\.crt$|\/pki\/expired\/|\/tmp\/|ca-bundle\.' |
# xargs -L 1 -t -i bash -c 'openssl x509 -noout -text -in {} | grep After'
#
# or via:
#
# find /etc/kubernetes -type f -name '*.conf' |
# grep -v expired |
# xargs -L 1 -t -i bash -c 'kubectl config view --raw -o jsonpath="{.users[0].user.client-certificate-data}" --kubeconfig={} | base64 -d | openssl x509 -noout -text | grep After'
#
# In case the certificates are close to expiring, this playbook can be used to renew them.

- name: Renew Kubernetes PKI certificates
hosts: master
become: true
serial: 1
tasks:

# Get Kubernetes version and modify the output from something like “v1.29.3” to “1.29”.
- name: Get the current Kubernetes version
shell: |
K8S_VERSION=$({{ .paths.kubectl }} version --kubeconfig={{ kubernetes_kubeconfig_path }}admin.conf" }} --short 2>/dev/null | grep 'Server Version:' | awk '{print $3}')
if [ -z "$K8S_VERSION" ]; then
K8S_VERSION=$({{ .paths.kubectl }} version --kubeconfig={{ kubernetes_kubeconfig_path }}admin.conf" }} 2>/dev/null | grep 'Server Version:' | awk '{print $3}')
fi
if [ -z "$K8S_VERSION" ]; then
echo "ERROR: Unable to get Kubernetes version"
exit 1
fi
echo "$K8S_VERSION" | sed -E 's/^v?([0-9]+\.[0-9]+)\.[0-9]+.*/\1/'
register: kubernetes_version

- name: Get the current Container Runtime
shell: |
RUNTIME=$({{ .paths.kubectl }} get nodes --kubeconfig={{ kubernetes_kubeconfig_path }}admin.conf" }} -o=jsonpath='{.items[0].status.nodeInfo.containerRuntimeVersion}')
if [[ $RUNTIME == containerd* ]]; then
echo "containerd"
else
echo "docker"
fi
register: container_runtime

- name: Backup all Kubernetes certs
shell: |
(BCK_FOLDER=$HOME/certs-backup/$(date +%Y-%m-%d_%H-%M-%S)
mkdir -p $BCK_FOLDER/etc-kubernetes $BCK_FOLDER/etc-etcd-pki \
&& rsync -av /etc/kubernetes/ $BCK_FOLDER/etc-kubernetes --exclude tmp \
&& rsync -av /etc/etcd/pki/ $BCK_FOLDER/etc-etcd-pki
)

- name: Renew all Kubernetes certs
shell: |
kubeadm certs renew admin.conf \
&& kubeadm certs renew apiserver \
&& kubeadm certs renew apiserver-kubelet-client \
&& kubeadm certs renew controller-manager.conf \
&& kubeadm certs renew front-proxy-client \
&& kubeadm certs renew scheduler.conf \
&& kubeadm certs renew --config=/etc/etcd/kubeadm-etcd.yml --cert-dir=/etc/etcd/pki apiserver-etcd-client \
&& kubeadm certs renew --config=/etc/etcd/kubeadm-etcd.yml --cert-dir=/etc/etcd/pki etcd-healthcheck-client \
&& kubeadm certs renew --config=/etc/etcd/kubeadm-etcd.yml --cert-dir=/etc/etcd/pki etcd-peer \
&& kubeadm certs renew --config=/etc/etcd/kubeadm-etcd.yml --cert-dir=/etc/etcd/pki etcd-server

- name: Renew Kubernetes super-admin.conf (only if Kubernetes version >= 1.29)
shell: |
kubeadm certs renew super-admin.conf
when: kubernetes_version.stdout is version('1.29', '>=')

- name: Restart all control plane components
shell: |
crictl ps -q --name 'kube-(controller-manager|scheduler|apiserver)' | xargs -r crictl stop
crictl ps -a -q --state exited --name 'kube-(apiserver|controller-manager|scheduler)' | xargs -r crictl rm
systemctl restart etcd
when: container_runtime.stdout == 'containerd'

- name: Restart all control plane components with Docker
shell: |
docker container restart $(docker container ls -q --filter name=k8s_kube-"(controller|scheduler|apiserver)")
&& systemctl restart etcd
when: container_runtime.stdout == 'docker'

- name: Wait for kube-controller-manager to be running
shell: crictl ps --name kube-controller-manager | grep -q Running
register: kube_controller_manager_status
retries: 10
delay: 5
until: kube_controller_manager_status.rc == 0

- name: Wait for kube-scheduler to be running
shell: crictl ps --name kube-scheduler | grep -q Running
register: kube_scheduler_status
retries: 10
delay: 5
until: kube_scheduler_status.rc == 0

- name: Wait for kube-apiserver to be running
shell: crictl ps --name kube-apiserver | grep -q Running
register: kube_apiserver_status
retries: 10
delay: 5
until: kube_apiserver_status.rc == 0

- name: Wait for etcd to be running
shell: systemctl is-active etcd --quiet
register: etcd_status
retries: 10
delay: 5
until: etcd_status.rc == 0


- name: Renew Kubelet certificates
hosts: master,nodes
become: true
serial: 1
tasks:
- name: Ensure Kubelet client certificate auto-renewal
block:
- name: Check whether it's already done
shell: cat /etc/kubernetes/kubelet.conf | grep /var/lib/kubelet/pki/kubelet-client-current.pem
rescue:
- name: Remove static client cert from kubelet.conf
lineinfile:
path: /etc/kubernetes/kubelet.conf
state: absent
regexp: '.*client-certificate-data.*'
- name: Remove static client key from kubelet.conf
lineinfile:
path: /etc/kubernetes/kubelet.conf
state: absent
regexp: '.*client-key-data.*'
- name: Link kubelet.conf to kubelet-client-current.pem
blockinfile:
path: /etc/kubernetes/kubelet.conf
marker: ""
insertafter: "user:"
content: |4
client-certificate: /var/lib/kubelet/pki/kubelet-client-current.pem
client-key: /var/lib/kubelet/pki/kubelet-client-current.pem
- name: Remove the blank line from the previous "blockinfile" task
lineinfile :
path: /etc/kubernetes/kubelet.conf
state: absent
regexp: '^$'

- name: Delete the Kubelet server cert before regenarating them
file:
path: "{{ item }}"
state: absent
with_items:
- /var/lib/kubelet/pki/kubelet.crt
- /var/lib/kubelet/pki/kubelet.key

- name: Restart Kubelet and regenerate the server certificate
shell: |
systemctl restart kubelet.service

- name: Check if Kubelet is running
shell: systemctl is-active kubelet --quiet
register: kubelet_status
retries: 10
delay: 5
until: kubelet_status.rc == 0


- name: Print Control Plane certificates expiration dates
hosts: master
become: true
tasks:
- name: Print certificates expiration dates
shell: |
find /etc/kubernetes/pki /etc/etcd/pki -type f -name "*.crt" -print | sort |
egrep -v 'ca\.crt$|\/pki\/expired\/|\/tmp\/|ca-bundle\.' |
xargs -L 1 -t -i bash -c 'openssl x509 -noout -text -in {} | grep After'
register: pki_info
- debug: var=pki_info.stdout_lines

- name: Print kubeconfig expiration dates (expected 'unable to load certificate' error)
ignore_errors: true # error with message 'unable to load certificate' are expected here
shell: |
find /etc/kubernetes -type f -name '*.conf' |
egrep -v 'expired' |
xargs -L 1 -t -i bash -c '{{ .paths.kubectl }} config view --kubeconfig={{ kubernetes_kubeconfig_path }}admin.conf" }} --raw -o jsonpath="{.users[0].user.client-certificate-data}" --kubeconfig={} | base64 -d | openssl x509 -noout -text | grep After'
register: kconfig_info
- debug: var=kconfig_info.stdout_lines

- name: Print Kubelet certificates expiration dates
hosts: master,nodes
become: true
tasks:
- name: Print Kubelet certificates expiration dates
shell: |
curl -kv https://127.0.0.1:10250 2>&1 | grep expire
register: kubelet_info
- debug: var=kubelet_info.stdout_lines