Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while creating deployment #9

Open
rohits-splunk opened this issue Oct 30, 2022 · 6 comments
Open

Error while creating deployment #9

rohits-splunk opened this issue Oct 30, 2022 · 6 comments

Comments

@rohits-splunk
Copy link

kubectl create -f deployments/mongo-deployment.yaml

error: resource mapping not found for name: "mongo" namespace: "" from "deployments/mongo-deployment.yaml": no matches for kind "Deployment" in version "extensions/v1beta1"
ensure CRDs are installed first

@font
Copy link
Owner

font commented Nov 1, 2022

Thanks for reporting the issue! These manifests are a bit outdated as the Deployment API group has since been updated to apps/v1. If you try to replace extensions/v1beta1 with apps/v1 the error should be fixed.

@rohits-splunk
Copy link
Author

I fixed it , thanks @font . Would you mind telling which mongo db version this app expects ? I installed the latest one and the app is complaining about.

@font
Copy link
Owner

font commented Nov 1, 2022

I fixed it , thanks @font . Would you mind telling which mongo db version this app expects ? I installed the latest one and the app is complaining about.

Great question! The YAML manifests should really have specified the exact mongo version by tagging the image. At the time it wasn't an issue because any mongo version worked since it didn't rely on any unique mongo features. It was mongo 3.4 at the time.

In any case, make sure to align the MongoDB NodeJS driver version used in pacman with a MongoDB version that is compatible.

@rohits-splunk
Copy link
Author

I am trying to install 3.4 but it wont install at all, because exact versions of other components are not know, then i tried 3.2 by following the link https://www.mongodb.com/docs/v3.2/tutorial/install-mongodb-on-ubuntu/ and it again failed due do dependencies.

Is there a possibility to upgrade the mongo used in the game along with the drivers ?

@aespindola09
Copy link

To solve the version problem I ran the following commands to change the apiVersion and add the selector in the deployments

#Remplace apiVersion extensions/v1beta1 for apps/v1 for compatibility 
# Add selector name mongo
cat > deployments/mongo-deployment.yaml <<EOF
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    name: mongo
  name: mongo
spec:
  replicas: 0
  selector:
    matchLabels:
      name: mongo
  template:
    metadata:
      labels:
        name: mongo
    spec:
      containers:
      - image: mongo
        name: mongo
        ports:
        - name: mongo
          containerPort: 27017
        volumeMounts:
          - name: mongo-db
            mountPath: /data/db
      volumes:
        - name: mongo-db
          persistentVolumeClaim:
            claimName: mongo-storage
EOF


#Remplace apiVersion extensions/v1beta1 for apps/v1 for compatibility
# Add selector name pacman
cat > deployments/pacman-deployment.yaml <<EOF
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    name: pacman
  name: pacman
spec:
  replicas: 0
  selector:
    matchLabels:
      name: pacman
  template:
    metadata:
      labels:
        name: pacman
    spec:
      containers:
      - image: quay.io/ifont/pacman-nodejs-app:latest
        name: pacman
        ports:
        - containerPort: 8080
          name: http-server
EOF

@rohits-splunk
Copy link
Author

Thanks , i was able to this as well. I am not sure if i am able to see any changes in the mongodb version !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants