akka-grpc-sample-kubernetes-scala icon indicating copy to clipboard operation
akka-grpc-sample-kubernetes-scala copied to clipboard

Update Ingress configuration for new versions of k8s

Open sherpal opened this issue 3 years ago • 0 comments

Problem statement

On a MacOS (bigSur 11.6), with kubernetes version 1.21 (see below for details), it seems that the definition of the kubernetes/httptogrpc.yml configuration for Ingress is outdated. The error message that I get with the yml file in the current state is this:

error: unable to recognize "kubernetes/httptogrpc.yml": no matches for kind "Ingress" in version "extensions/v1beta1"

I did not check on another os, but I'm guessing it's not special to Mac. Below is the modified file that end up working for me:

---
apiVersion: "apps/v1"
kind: Deployment
metadata:
  name: "httptogrpc-v0-1-0-snapshot"
  labels:
    appName: httptogrpc
    appNameVersion: "httptogrpc-v0-1-0-snapshot"
spec:
  replicas: 1
  selector:
    matchLabels:
      appNameVersion: "httptogrpc-v0-1-0-snapshot"
  template:
    metadata:
      labels:
        appName: httptogrpc
        appNameVersion: "httptogrpc-v0-1-0-snapshot"
    spec:
      restartPolicy: Always
      containers:
        - name: httptogrpc
          image: "httptogrpc:0.1.0-SNAPSHOT"
          imagePullPolicy: IfNotPresent
          ports:
            - containerPort: 8080
              name: http
          volumeMounts: []
      volumes: []
---
apiVersion: v1
kind: Service
metadata:
  labels:
    appName: httptogrpc
  name: httptogrpc
spec:
  ports:
    - name: http
      port: 8080
      protocol: TCP
      targetPort: 8080
  selector:
    appName: httptogrpc
---
apiVersion: "networking.k8s.io/v1"
kind: Ingress
metadata:
  name: httptogrpc
spec:
  ingressClassName: nginx
  rules:
    - host: "superservice.com"
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: httptogrpc
                port:
                  number: 8080

Would it be worth updating it in this repo? Or is my configuration special in any way?

Additional info

kubernetes version full output:

Client Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.4", GitCommit:"3cce4a82b44f032d0cd1a1790e6d2f5a55d20aae", GitTreeState:"clean", BuildDate:"2021-08-11T18:16:05Z", GoVersion:"go1.16.7", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.2", GitCommit:"8b5a19147530eaac9476b0ab82980b4088bbc1b2", GitTreeState:"clean", BuildDate:"2021-09-15T21:32:41Z", GoVersion:"go1.16.8", Compiler:"gc", Platform:"linux/amd64"}

sherpal avatar Oct 28 '21 08:10 sherpal