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

feat: More robust k8s manifest parsing #39

Merged
merged 4 commits into from
Jul 25, 2024
Merged

Conversation

laurentluce
Copy link
Contributor

@laurentluce laurentluce commented Jul 18, 2024

  • Support for service with no deployment e.g. load balancer service (ingress).
  • Support for unordered service / deployment pairs. Name matching uses the metadata label app string or the metadata name.

Example of manifest supported:

apiVersion: v1
kind: Service
metadata:
  labels:
    app: redis-prod
    version: v1
  name: redis-prod
  namespace: voting-app
  annotations:
    kardinal.dev.service/stateful: "true"
    kardinal.dev/plugins: |
      - name: github.com/kardinaldev/redis-db-sidecar-plugin:36ed9a4
        args:
          mode: "pass-through" 
spec:
  ports:
    - name: tcp-redis
      port: 6379
      protocol: TCP
      targetPort: 6379
  selector:
    app: redis-prod
---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: redis-prod
    version: v1
  name: redis-prod-v1
  namespace: voting-app
spec:
  replicas: 1
  selector:
    matchLabels:
      app: redis-prod
      version: v1
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      annotations:
        sidecar.istio.io/inject: "true"
      labels:
        app: redis-prod
        version: v1
    spec:
      containers:
        - name: redis-prod
          image: bitnami/redis:6.0.8
          env:
            - name: ALLOW_EMPTY_PASSWORD
              value: "yes"
            - name: REDIS_PORT_NUMBER
              value: "6379"
          resources:
            requests:
              cpu: 100m
              memory: 128Mi
            limits:
              cpu: 250m
              memory: 256Mi
          ports:
            - containerPort: 6379
              name: redis

---
apiVersion: v1
kind: Service
metadata:
  labels:
    app: voting-app-ui
    version: v1
  name: voting-app-ui
  namespace: voting-app
  annotations:
    kardinal.dev.service/dependencies: "redis-prod:6379"
spec:
  ports:
    - name: http
      port: 80
      protocol: TCP
      targetPort: 80
  selector:
    app: voting-app-ui
---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: voting-app-ui
    version: v1
  name: voting-app-ui-v1
  namespace: voting-app
spec:
  replicas: 1
  selector:
    matchLabels:
      app: voting-app-ui
      version: v1
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      annotations:
        sidecar.istio.io/inject: "true"
      labels:
        app: voting-app-ui
        version: v1
    spec:
      containers:
        - name: voting-app-ui
          image: kurtosistech/demo-voting-app-ui
          imagePullPolicy: IfNotPresent
          resources:
            requests:
              cpu: 100m
              memory: 128Mi
            limits:
              cpu: 250m
              memory: 256Mi
          ports:
            - containerPort: 80
          env:
            - name: REDIS
              value: "redis-prod"
---
apiVersion: v1
kind: Service
metadata:
  name: voting-app-lb
  annotations:
    kardinal.dev.service/ingress: "true"
spec:
  type: LoadBalancer
  ports:
  - port: 80
  selector:
    app: voting-app-ui

@laurentluce laurentluce requested a review from tedim52 July 18, 2024 20:06
@laurentluce laurentluce merged commit 3a18e63 into main Jul 25, 2024
11 checks passed
h4ck3rk3y pushed a commit that referenced this pull request Jul 30, 2024
🤖 I have created a release *beep* *boop*
---


##
[0.1.4](0.1.3...0.1.4)
(2024-07-30)


### Features

* added a dashboard cmd that opens the kardinal dashboard in the browser
([#36](#36))
([741e2e5](741e2e5))
* added required types for tracing <> flows
([#51](#51))
([c525e3f](c525e3f))
* deploy the trace router + redis when manager is deployed
([#53](#53))
([d458d22](d458d22))
* More robust k8s manifest parsing
([#39](#39))
([3a18e63](3a18e63))
* move website to public repo
([#47](#47))
([368f733](368f733))


### Bug Fixes

* better error message if dashboard doesnt open
([#38](#38))
([ce8804b](ce8804b))
* remove extra space in CTA heading
([#49](#49))
([8b2fe9f](8b2fe9f))
* use right type for authorization policies
([#52](#52))
([216e606](216e606))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
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

Successfully merging this pull request may close these issues.

2 participants