🚀 DevOps & SRE Certification Program 📅 Starting: 1st of Every Month 🤝 +91 8409492687 🔍 Contact@DevOpsSchool.com

Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

External Secrets Operator: Example of ExternalSecret

# Example 1: Get all values from an external secret
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: all-keys-example
spec:
refreshInterval: 1h
secretStoreRef:
kind: SecretStore
name: my-secret-store
dataFrom:
- key: my-secret
# This ExternalSecret will fetch all of the key-value pairs from the my-secret secret in the my-secret-store SecretStore and create a Kubernetes Secret with the same data.
# Example 2: Get specific values from an external secret
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: specific-keys-example
spec:
refreshInterval: 1h
secretStoreRef:
kind: SecretStore
name: my-secret-store
dataFrom:
- key: my-secret
keys:
- username
- password
# This ExternalSecret will fetch the username and password keys from the my-secret secret in the my-secret-store SecretStore and create a Kubernetes Secret with the same data.
# Example 3: Get values from an external secret and rewrite the keys
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: rewrite-keys-example
spec:
refreshInterval: 1h
secretStoreRef:
kind: SecretStore
name: my-secret-store
dataFrom:
- key: my-secret
rewrite:
- regexp:
source: "path/to/my/secrets/(.*)"
target: "$1"
# This ExternalSecret will fetch all of the key-value pairs from the my-secret secret in the my-secret-store SecretStore and create a Kubernetes Secret with the same data, but the keys will be rewritten by removing the path/to/my/secrets/ prefix.
# Example 4: Get values from multiple external secrets
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: multiple-secrets-example
spec:
refreshInterval: 1h
dataFrom:
- key: my-secret-1
secretStoreRef:
kind: SecretStore
name: my-secret-store-1
- key: my-secret-2
secretStoreRef:
kind: SecretStore
name: my-secret-store-2
# This ExternalSecret will fetch the my-secret-1 secret from the my-secret-store-1 SecretStore and the my-secret-2 secret from the my-secret-store-2 SecretStore and create a Kubernetes Secret with the combined data.
# Example 5: Get values from an external secret and specify the target Secret type
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: target-secret-type-example
spec:
refreshInterval: 1h
secretStoreRef:
kind: SecretStore
name: my-secret-store
dataFrom:
- key: my-secret
target:
type: Opaque
# This ExternalSecret will fetch the my-secret secret from the my-secret-store SecretStore and create a Kubernetes Secret with the same data, but the Secret type will be Opaque instead of the default Opaque.
Subscribe
Notify of
guest


0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments

Certification Courses

DevOpsSchool has introduced a series of professional certification courses designed to enhance your skills and expertise in cutting-edge technologies and methodologies. Whether you are aiming to excel in development, security, or operations, these certifications provide a comprehensive learning experience. Explore the following programs:

DevOps Certification, SRE Certification, and DevSecOps Certification by DevOpsSchool

Explore our DevOps Certification, SRE Certification, and DevSecOps Certification programs at DevOpsSchool. Gain the expertise needed to excel in your career with hands-on training and globally recognized certifications.

0
Would love your thoughts, please comment.x
()
x