Skip to content

Commit

Permalink
Merge branch 'w/2.11/bugfix/fix-backup-replication-job-name' into tmp…
Browse files Browse the repository at this point in the history
…/octopus/q/2.11
  • Loading branch information
bert-e committed Oct 28, 2021
2 parents fb98024 + 13a68eb commit fb14be9
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 61 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@
- Bump Kubernetes version to 1.21.6
(PR[#3583](https://github.com/scality/metalk8s/pull/3583))

## Bug fixes

- Fix the backup replication Job name which was including the node name,
so that he could exceed the limit of 63 characters.
(PR[#3584](https://github.com/scality/metalk8s/pull/3584))

- Fluent-bit instances stayed stuck when a Loki instance was down, blocking
the whole logging pipeline. It is now fixed as we configure fluent-bit to
talk with Loki's service and use memberlist to keep the Loki instances
replicated.
(PR[#3557](https://github.com/scality/metalk8s/pull/3557))

## Release 2.10.4
## Bug fixes

Expand Down
51 changes: 1 addition & 50 deletions salt/metalk8s/addons/dex/deployed/service-configuration.sls
Original file line number Diff line number Diff line change
Expand Up @@ -33,56 +33,7 @@ Create Dex ServiceConfiguration (metalk8s-auth/metalk8s-dex-config):

{%- else %}

{%- set config_data = dex_service_config.data['config.yaml'] | load_yaml %}

{%- if config_data.apiVersion == 'addons.metalk8s.scality.com' %}

Convert old Dex ServiceConfiguration to new format:
metalk8s_kubernetes.object_present:
- manifest:
apiVersion: v1
kind: ConfigMap
metadata:
name: metalk8s-dex-config
namespace: metalk8s-auth
data:
config.yaml: |-
apiVersion: addons.metalk8s.scality.com/v1alpha2
kind: DexConfig
spec:
{%- if 'deployment' in config_data.spec %}
deployment:
{{ config_data.spec.deployment | yaml(False) | indent(16) }}
{%- endif %}

config:
{%- if 'localuserstore' in config_data.spec %}
enablePasswordDB: {{ config_data.spec.localuserstore.enabled }}
staticPasswords:
{{ config_data.spec.localuserstore.userlist | yaml(False)
| indent(16) }}
{%- endif %}

{%- if 'connectors' in config_data.spec %}
connectors:
{{ config_data.spec.connectors | yaml(False) | indent(16) }}
{%- endif %}

{# We backup the previous config, in case of issues #}
previous-config.yaml: |-
{{ config_data | yaml(False) | indent(12) }}

{%- elif config_data.apiVersion == 'addons.metalk8s.scality.com/v1alpha2' %}

Dex ServiceConfiguration already exists in expected format:
Dex ServiceConfiguration already exists:
test.succeed_without_changes: []

{%- else %}

Dex ServiceConfiguration has unexpected format:
test.fail_without_changes:
- comment: Found unexpected apiVersion "{{ config_data.apiVersion }}"
{%- endif %}
{%- endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Create metalk8s-loki-config ConfigMap:

{%- else %}

metalk8s-loki-config ConfigMap already exist:
metalk8s-loki-config ConfigMap already exists:
test.succeed_without_changes: []

{%- endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Create prometheus-config ConfigMap:

{%- else %}

metalk8s-prometheus-config ConfigMap already exist:
metalk8s-prometheus-config ConfigMap already exists:
test.succeed_without_changes: []

{%- endif %}
Expand All @@ -89,7 +89,7 @@ Create alertmanager-config ConfigMap:

{%- else %}

metalk8s-alertmanager-config ConfigMap already exist:
metalk8s-alertmanager-config ConfigMap already exists:
test.succeed_without_changes: []

{%- endif %}
6 changes: 0 additions & 6 deletions salt/metalk8s/addons/prometheus-operator/post-upgrade.sls
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,3 @@

include:
- .post-cleanup

Delete old metalk8s-prometheus StorageClass:
metalk8s_kubernetes.object_absent:
- apiVersion: storage.k8s.io/v1
- kind: StorageClass
- name: metalk8s-prometheus
4 changes: 2 additions & 2 deletions salt/metalk8s/orchestrate/backup/files/job.yaml.j2
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: batch/v1
kind: Job
metadata:
name: backup-replication-{{ node }}
name: {{ name }}
namespace: kube-system
labels:
app.kubernetes.io/name: backup-replication
Expand All @@ -10,7 +10,7 @@ metadata:
spec:
backoffLimit: 4
parallelism: 1
ttlSecondsAfterFinished: 120
ttlSecondsAfterFinished: 86400
template:
metadata:
labels:
Expand Down
1 change: 1 addition & 0 deletions salt/metalk8s/orchestrate/backup/replication.sls
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Schedule backup replication Job on {{ node }}:
- name: salt://{{ slspath }}/files/job.yaml.j2
- template: jinja
- defaults:
name: backup-replication-{{ salt.random.get_str(length=15) | lower }}
node: {{ node }}
image: {{ image }}
Expand Down
1 change: 1 addition & 0 deletions salt/tests/unit/formulas/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ metalk8s:
_cases:
"Create job manifest for a node":
extra_context:
name: replication-backup-012345689abcde
node: master-1
image: registry/some-image-name:tag

Expand Down

0 comments on commit fb14be9

Please sign in to comment.