Documentation ¶
Index ¶
- Constants
- func AddSecretVolumeToPod(secretVolumeName string, secretName string, pod *v1.Pod)
- func FindGCPServiceAccountSecret(annotations map[string]string) (string, string, bool)
- func FindGeneralSecrets(annotations map[string]string) map[string]string
- func MountSecretToContainer(volumeName string, mountPath string, container *v1.Container)
- func MountServiceAccountSecretToContainer(mountPath string, container *v1.Container)
Constants ¶
const ( // GoogleApplicationCredentialsEnvVar is the environment variable used by the // Application Default Credentials mechanism. More details can be found at // https://developers.google.com/identity/protocols/application-default-credentials. GoogleApplicationCredentialsEnvVar = "GOOGLE_APPLICATION_CREDENTIALS" // ServiceAccountJSONKeyFileName is the default name of the service account // Json key file. This name is added to the service account secret mount path to // form the path to the Json key file referred to by GOOGLE_APPLICATION_CREDENTIALS. ServiceAccountJSONKeyFileName = "key.json" // ServiceAccountSecretVolumeName is the name of the GCP service account secret volume. ServiceAccountSecretVolumeName = "gcp-service-account-secret-volume" )
Variables ¶
This section is empty.
Functions ¶
func AddSecretVolumeToPod ¶
AddSecretVolumeToPod adds a secret volume for the secret with secretName into pod.
func FindGCPServiceAccountSecret ¶
FindGCPServiceAccountSecret finds the annotation for specifying GCP service account secret and returns the name and mount path of the secret if the annotation is found.
func FindGeneralSecrets ¶
FindGeneralSecrets finds the annotations for specifying general secrets and returns an map of names of the secrets to their mount paths.
func MountSecretToContainer ¶
MountSecretToContainer mounts the secret volume with volumeName onto the mountPath into container.
func MountServiceAccountSecretToContainer ¶
MountServiceAccountSecretToContainer mounts the service account secret volume with volumeName onto the mountPath into container and also sets environment variable GOOGLE_APPLICATION_CREDENTIALS to the service account key file in the volume.
Types ¶
This section is empty.