Make operator unaware of its own service account

This commit is contained in:
Sergey Dudoladov 2018-04-23 14:38:20 +02:00
parent a88416e6ea
commit c31c76281c
3 changed files with 1 additions and 3 deletions

View File

@ -7,7 +7,6 @@ data:
# if neither is set or evaluates to the empty string, listen to the operator's own namespace # if neither is set or evaluates to the empty string, listen to the operator's own namespace
# if set to the "*", listen to all namespaces # if set to the "*", listen to all namespaces
# watched_namespace: development # watched_namespace: development
service_account_name: operator
cluster_labels: application:spilo cluster_labels: application:spilo
cluster_name_label: version cluster_name_label: version
pod_role_label: spilo-role pod_role_label: spilo-role

View File

@ -435,7 +435,7 @@ func (c *Cluster) generatePodTemplate(
terminateGracePeriodSeconds := int64(c.OpConfig.PodTerminateGracePeriod.Seconds()) terminateGracePeriodSeconds := int64(c.OpConfig.PodTerminateGracePeriod.Seconds())
podSpec := v1.PodSpec{ podSpec := v1.PodSpec{
ServiceAccountName: c.OpConfig.ServiceAccountName, ServiceAccountName: c.OpConfig.PodServiceAccountName,
TerminationGracePeriodSeconds: &terminateGracePeriodSeconds, TerminationGracePeriodSeconds: &terminateGracePeriodSeconds,
Containers: []v1.Container{container}, Containers: []v1.Container{container},
Tolerations: c.tolerations(tolerationsSpec), Tolerations: c.tolerations(tolerationsSpec),

View File

@ -73,7 +73,6 @@ type Config struct {
EtcdHost string `name:"etcd_host" default:"etcd-client.default.svc.cluster.local:2379"` EtcdHost string `name:"etcd_host" default:"etcd-client.default.svc.cluster.local:2379"`
DockerImage string `name:"docker_image" default:"registry.opensource.zalan.do/acid/spiloprivate-9.6:1.2-p4"` DockerImage string `name:"docker_image" default:"registry.opensource.zalan.do/acid/spiloprivate-9.6:1.2-p4"`
// re-use one account for both Spilo pods and the operator; this grants extra privileges to pods // re-use one account for both Spilo pods and the operator; this grants extra privileges to pods
ServiceAccountName string `name:"service_account_name" default:"operator"`
PodServiceAccountName string `name:"pod_service_account_name" default:"operator"` PodServiceAccountName string `name:"pod_service_account_name" default:"operator"`
PodServiceAccountDefinition string `name:"pod_service_account_definition" default:"apiVersion: v1\nkind: ServiceAccount\nmetadata:\n name: operator\n"` PodServiceAccountDefinition string `name:"pod_service_account_definition" default:"apiVersion: v1\nkind: ServiceAccount\nmetadata:\n name: operator\n"`
DbHostedZone string `name:"db_hosted_zone" default:"db.example.com"` DbHostedZone string `name:"db_hosted_zone" default:"db.example.com"`