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

VS 2022 - Kubernetes publish not working - asp.net core 6 #1121

Closed
myappfree opened this issue Apr 12, 2022 · 4 comments
Closed

VS 2022 - Kubernetes publish not working - asp.net core 6 #1121

myappfree opened this issue Apr 12, 2022 · 4 comments

Comments

@myappfree
Copy link

Publishing [ProjectNameHere] to Kubernetes.
Failed to deploy project [ProjectNameHere] to Kubernetes.

evenr the generate app.yaml fails

at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.CreateValue()
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.Create()
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveNext(PartLifecycleState nextState)
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveToState(PartLifecycleState requiredState)
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose()
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.<>c__DisplayClass15_0.b__0()
at Microsoft.VisualStudio.Composition.DelegateServices.<>c__DisplayClass2_01.<As>b__0() at System.Lazy1.CreateValue()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Lazy`1.get_Value()
at GoogleCloudExtension.Services.Configuration.AppEngineConfiguration.CheckProjectConfiguration(IParsedProject project)
at GoogleCloudExtension.GenerateConfigurationCommand.GenerateConfigurationContextMenuCommand.d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at GoogleCloudExtension.Utils.ErrorHandlerUtils.d__2.MoveNext()

@myappfree
Copy link
Author

myappfree commented Apr 25, 2022

@jskeet any chance to fix the iussue?
Thanks

Here my Workaround

first of all you need to install docker desktop

right click on project -> Add -> Docker Supoport

righ click on project-> open in Terminal

you need first time authentication

gcloud auth login
gcloud container clusters get-credentials {your cluster} --region {region} --project {project} gcloud auth configure-docker

create a script ps1


 $version = [DateTimeOffset]::Now.ToUnixTimeSeconds()

 docker build -t gcr.io/{project}/{your deployment name}:$version .

 docker push gcr.io/{project}/{your deployment name}:$version

 $deployment_yaml = (Get-Content .\Conf\Prod\deployment.yaml) -replace "{{version}}", $version

 $deployment_yaml | kubectl apply -f -

here an example of deployment.yaml please note the I have added {version} placeholder

apiVersion: apps/v1
kind: Deployment
metadata:
  name: {your deployment name}
spec:
  replicas: 2
  selector:
    matchLabels:
      run: {your deployment name}
  template:
    metadata:
      creationTimestamp: null
      labels:
        run: {your deployment name}
    spec:
      containers:
      - image: gcr.io/{project}/{your deployment name}:{{version}}
        imagePullPolicy: IfNotPresent
        name: {your deployment name}
        ports:
        - containerPort: 8080
          protocol: TCP
        resources:
          limits:
            cpu: "2"
            memory: 2Gi
          requests:
            cpu: "2"
            memory: 2Gi

@jskeet
Copy link
Member

jskeet commented Apr 25, 2022

The Visual Studio extension is no longer supported or maintained, I'm afraid.

@jskeet jskeet closed this as completed Apr 25, 2022
@myappfree
Copy link
Author

Thanks, could you please update the readme file to inform other developer that the project is not supported anymore?

@jskeet
Copy link
Member

jskeet commented Apr 25, 2022

Yes, I've asked the product manager responsible to do so. Apologies for that not being done before.

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

2 participants