Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Configuring yaml file

I’m learning k8s, I found an example in the MS docs. The problem I’m having is that I want to switch what GITHUB repo thats being used. I havent been able to figure out the path within this yaml example

 apiVersion: apps/v1
 kind: Deployment
 metadata:
   name: azure-vote-back
 spec:
    replicas: 1
    selector:
      matchLabels:
  app: azure-vote-back
  template:
    metadata:
      labels:
      app: azure-vote-back
  spec:
    nodeSelector:
    "kubernetes.io/os": linux
  containers:
  - name: azure-vote-back
    image: mcr.microsoft.com/oss/bitnami/redis:6.0.8
    env:
    - name: ALLOW_EMPTY_PASSWORD
      value: "yes"
    resources:
      requests:
        cpu: 100m
        memory: 128Mi
      limits:
        cpu: 250m
        memory: 256Mi
    ports:
    - containerPort: 6379
      name: redis
    ---
    apiVersion: v1
    kind: Service
    metadata:
     name: azure-vote-back
    spec:
      ports:
      - port: 6379
    selector:
    app: azure-vote-back
    ---
    apiVersion: apps/v1
    kind: Deployment
    metadata:
       name: azure-vote-front
         spec:
    replicas: 1
      selector:
       matchLabels:
     app: azure-vote-front
    template:
  metadata:
    labels:
      app: azure-vote-front
  spec:
     nodeSelector:
        "kubernetes.io/os": linux
  containers:
  - name: azure-vote-front
    image: mcr.microsoft.com/azuredocs/azure-vote-front:v1
    resources:
      requests:
        cpu: 100m
        memory: 128Mi
      limits:
        cpu: 250m
        memory: 256Mi
    ports:
    - containerPort: 80
    env:
    - name: REDIS
      value: "azure-vote-back"
    ---
    apiVersion: v1
    kind: Service
    metadata:
    name: azure-vote-front
 spec:
   type: LoadBalancer
   ports:
   - port: 80
   selector:
app: azure-vote-front

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

This YAML example doesn’t have a Github Repo field at all. That’s why you can’t find a path.

If you’re trying to change the container image source, it has to be from a container registry (or your own filesystem), which is located at

containers: image: mcr.microsoft.com/azuredocs/azure-vote-front:v1

where mcr.microsoft.com is the container registry.

You won’t be able to connect this directly to a Github Repository, but any container registry will work, and I believe Github has one at https://ghcr.io (that link itself will direct you back to Github)

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading