v1.5.0

For Go-based operators, migrate your project to use the project version stable.

The PROJECT version config file represents the project configuration. It reach the maturate stability and it will store the data used to do the scaffolds. The motivation for this behaviour is to allow tools and helpers in the future such as to make easier the process to update the projects to use upper versions. More info: TBD. //TODO: add link for docs (see the PR kubernetes-sigs/kubebuilder#1916)

See #4402 for more details.

PROJECT config version 3-alpha must be upgraded to 3.

PROJECT config version 3-alpha has been stabilized as version 3 (the version key in your PROJECT file), and contains a set of config fields sufficient to fully describe a project. While this change is not technically breaking because the spec at that version was alpha, it was used by default in operator-sdk commands so should be marked as breaking and have a convenient migration path. The alpha config-3alpha-to-3 command will convert most of your PROJECT file from version 3-alpha to 3, and leave comments with directions where automatic conversion is not possible:

  1. $ cat PROJECT
  2. version: 3-alpha
  3. resources:
  4. - crdVersion: v1
  5. ...
  6. $ operator-sdk alpha config-3alpha-to-3
  7. Your PROJECT config file has been converted from version 3-alpha to 3. Please make sure all config data is correct.
  8. $ cat PROJECT
  9. version: "3"
  10. esources:
  11. - api:
  12. crdVersion: v1
  13. ...

See #4613 for more details.

(go/v3) Upgrade controller-runtime to v0.7.2.

In your go.mod file, upgrade sigs.k8s.io/controller-runtime to v0.7.2.

See #4626 for more details.

(go/v3) Add a system:controller-manager ServiceAccount to your project.

A non-default ServiceAccount controller-manager is scaffolded on operator-sdk init, to improve security for operators installed in shared namespaces. To add this ServiceAccount to your project, do the following:

  1. # Create the ServiceAccount.
  2. cat <<EOF > config/rbac/service_account.yaml
  3. apiVersion: v1
  4. kind: ServiceAccount
  5. metadata:
  6. name: controller-manager
  7. namespace: system
  8. EOF
  9. # Add it to the list of RBAC resources.
  10. echo "- service_account.yaml" >> config/rbac/kustomization.yaml
  11. # Update all RoleBinding and ClusterRoleBinding subjects that reference the operator's ServiceAccount.
  12. find config/rbac -name *_binding.yaml -exec sed -i -E 's/ name: default/ name: controller-manager/g' {} \;
  13. # Add the ServiceAccount name to the manager Deployment's spec.template.spec.serviceAccountName.
  14. sed -i -E 's/([ ]+)(terminationGracePeriodSeconds:)/\1serviceAccountName: controller-manager\n\1\2/g' config/manager/manager.yaml

The changes should look like:

  1. # config/manager/manager.yaml
  2. requests:
  3. cpu: 100m
  4. memory: 20Mi
  5. + serviceAccountName: controller-manager
  6. terminationGracePeriodSeconds: 10
  7. # config/rbac/auth_proxy_role_binding.yaml
  8. name: proxy-role
  9. subjects:
  10. - kind: ServiceAccount
  11. - name: default
  12. + name: controller-manager
  13. namespace: system
  14. # config/rbac/kustomization.yaml
  15. resources:
  16. +- service_account.yaml
  17. - role.yaml
  18. - role_binding.yaml
  19. - leader_election_role.yaml
  20. # config/rbac/leader_election_role_binding.yaml
  21. name: leader-election-role
  22. subjects:
  23. - kind: ServiceAccount
  24. - name: default
  25. + name: controller-manager
  26. namespace: system
  27. # config/rbac/role_binding.yaml
  28. name: manager-role
  29. subjects:
  30. - kind: ServiceAccount
  31. - name: default
  32. + name: controller-manager
  33. namespace: system
  34. # config/rbac/service_account.yaml
  35. +apiVersion: v1
  36. +kind: ServiceAccount
  37. +metadata:
  38. + name: controller-manager
  39. + namespace: system

See #4626 for more details.

(ansible/v1, helm/v1) Swap the paths of liveness/readiness probes in config/manager/manager.yaml.

The liveness and readiness probe endpoints were incorrectly named, although this mismatch will not affect their behavior. To fix, swap the readinessProbe and livenessProbe HTTP paths in config/manager/manager.yaml:

  1. livenessProbe:
  2. httpGet:
  3. path: /healthz
  4. port: 6789
  5. initialDelaySeconds: 15
  6. periodSeconds: 20
  7. readinessProbe:
  8. httpGet:
  9. path: /readyz
  10. port: 6789
  11. initialDelaySeconds: 5
  12. periodSeconds: 10

See #4546 for more details.

Last modified March 12, 2021: Release v1.5.0 (#4646) (98f30d59)