forked from elastic/cloud-on-k8s
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Mount annotations in the Pod * Redirect errors to stderr
- Loading branch information
1 parent
076e774
commit 565abf9
Showing
4 changed files
with
89 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
// or more contributor license agreements. Licensed under the Elastic License; | ||
// you may not use this file except in compliance with the Elastic License. | ||
|
||
package volume | ||
|
||
import ( | ||
"github.com/elastic/cloud-on-k8s/pkg/controller/elasticsearch/volume" | ||
corev1 "k8s.io/api/core/v1" | ||
) | ||
|
||
var downwardAPIVolume = corev1.Volume{ | ||
Name: volume.DownwardAPIVolumeName, | ||
VolumeSource: corev1.VolumeSource{ | ||
DownwardAPI: &corev1.DownwardAPIVolumeSource{ | ||
Items: []corev1.DownwardAPIVolumeFile{ | ||
{ | ||
Path: volume.LabelsFile, | ||
FieldRef: &corev1.ObjectFieldSelector{ | ||
FieldPath: "metadata.labels", | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
} | ||
|
||
var downwardAPIVolumeMount = corev1.VolumeMount{ | ||
Name: volume.DownwardAPIVolumeName, | ||
MountPath: volume.DownwardAPIMountPath, | ||
ReadOnly: true, | ||
} | ||
|
||
type DownwardAPI struct{} | ||
|
||
var _ VolumeLike = DownwardAPI{} | ||
|
||
func (DownwardAPI) Name() string { | ||
return volume.DownwardAPIVolumeName | ||
} | ||
|
||
func (DownwardAPI) Volume() corev1.Volume { | ||
return downwardAPIVolume | ||
} | ||
|
||
func (DownwardAPI) VolumeMount() corev1.VolumeMount { | ||
return downwardAPIVolumeMount | ||
} |
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