To retrieve images from a private Nexus repository using a K8s cluster, you can follow the below steps:
apiVersion: v1
kind: Secret
metadata:
name: nexus-repo-cred
type: Opaque
data:
username: <base64 encoded username>
password: <base64 encoded password>
apiVersion: v1
kind: Pod
metadata:
name: nexus-pod
spec:
containers:
- name: test
image: <your-image>
env:
- name: NEXUS_USERNAME
valueFrom:
secretKeyRef:
name: nexus-repo-cred
key: username
- name: NEXUS_PASSWORD
valueFrom:
secretKeyRef:
name: nexus-repo-cred
key: password
volumeMounts:
- name: nexus-creds
mountPath: /etc/nexus-creds
volumes:
- name: nexus-creds
secret:
secretName: nexus-repo-cred
apiVersion: apps/v1
kind: Deployment
metadata:
name: <your-deployment>
labels:
app: <your-app>
spec:
replicas: 1
selector:
matchLabels:
app: <your-app>
template:
metadata:
labels:
app: <your-app>
spec:
containers:
- name: <your-container>
image: <your-image>
imagePullSecrets:
- name: nexus-repo-cred
After following these steps, your Kubernetes cluster should be able to retrieve images from your private Nexus repository.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2023-06-13 07:54:06 +0000
Seen: 11 times
Last updated: Jun 13 '23
How can Django Admin accommodate a variety of formats and locales for its input fields?
How can an array be passed using typo3 flexform xml and itemsProcConfig?
Is it possible to invoke an asynchronous function without using the await keyword?
How can metadata be linked to a series in Polars?
What is the process of utilizing the map function to map a pandas column using a dictionary?
How can the orientation of images be corrected during uploading using Plupload?