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

jkube for dapr user #1996

Open
vishalrijhwani opened this issue Jan 11, 2023 · 2 comments
Open

jkube for dapr user #1996

vishalrijhwani opened this issue Jan 11, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@vishalrijhwani
Copy link
Contributor

Component

Kubernetes Gradle Plugin

Is your enhancement related to a problem? Please describe

issue 1
Hi dapr user can also take advantage of jkube for automatic creation of container, pushing in to repository and generating kubernetes manifest. just to make kubernetes manifest file to work we need to add dapr annotation in kubenetes manifest file (above spec: container) generated by dapr. by adding below annotation dapr adds dapr side car to application.
annotations:
dapr.io/enabled: "true"
dapr.io/app-id: "daprpubsubdemo"
dapr.io/app-port: "8084"
dapr.io/config: "appconfig"
dapr.io/sidecar-liveness-probe-delay-seconds: "2m"
dapr.io/sidecar-liveness-probe-timeout-seconds: "4m"
dapr.io/sidecar-readiness-probe-delay-seconds: "2m"
dapr.io/sidecar-readiness-probe-timeout-seconds: "3m"

complete kubernetes deployment manifest file

apiVersion: v1
kind: List
items:

  • apiVersion: apps/v1
    kind: Deployment
    metadata:
    labels:
    app: daprpubsubdemo
    provider: jkube
    version: 0.0.1-SNAPSHOT
    group: com.example
    name: daprpubsubdemo
    namespace: pubsubdemo
    spec:
    replicas: 1
    revisionHistoryLimit: 2
    selector:
    matchLabels:
    app: daprpubsubdemo
    provider: jkube
    group: com.example
    template:
    metadata:
    labels:
    app: daprpubsubdemo
    provider: jkube
    version: 0.0.1-SNAPSHOT
    group: com.example
    name: daprpubsubdemo
    namespace: pubsubdemo
    annotations:
    dapr.io/enabled: "true"
    dapr.io/app-id: "daprpubsubdemo"
    dapr.io/app-port: "8084"
    dapr.io/config: "appconfig"
    dapr.io/sidecar-liveness-probe-delay-seconds: "2m"
    dapr.io/sidecar-liveness-probe-timeout-seconds: "4m"
    dapr.io/sidecar-readiness-probe-delay-seconds: "2m"
    dapr.io/sidecar-readiness-probe-timeout-seconds: "3m"
    spec:
    containers:
    - env:
    - name: KUBERNETES_NAMESPACE
    valueFrom:
    fieldRef:
    fieldPath: metadata.namespace
    - name: HOSTNAME
    valueFrom:
    fieldRef:
    fieldPath: metadata.name
    image: docker.io/vishalrijhwani/daprpubsubdemo:latest
    imagePullPolicy: Always
    name: daprpubsubdemo
    ports:
    - containerPort: 8084
    protocol: TCP
    - containerPort: 9779
    name: prometheus
    protocol: TCP
    - containerPort: 8778
    name: jolokia
    protocol: TCP
    securityContext:
    privileged: false

issue 2
Further there is another issue of viewing logs using k8slogs if there is sidecar container along with your application. how to view log of application (just your applicaion container) not side car container using k8slog

and what if we want to see logs of side car container other than application container using k8slog

Describe the solution you'd like

issue I
The above dapr annotation need to be added through jkube enricher like example below
jkube.enricher.jkube-controller.replicaCount = 1

issue II
k8s log should provide way to view logs for application container and side car container

Describe alternatives you've considered

Issue I
Right now to make my manifest file generated by jkube to work with dapr, after doing k8s resources, i go to kubernetes.yml file and manually add dapr annotation above
spec:
containers:

It can be automated if jkube provides automation provision for dapr

Issue II
write now i am using kubernetes tools to view logs of main container and side car container using below command
kubectl logs podname -c containername

Additional context

No response

@vishalrijhwani vishalrijhwani added the enhancement New feature or request label Jan 11, 2023
@rohanKanojia
Copy link
Member

Umm, I see two different issues. Ideally you would want to keep one issue per GitHub issue

For sidecar logs, does using jkube.log.container property or logContainerName configuration option help?

@rohanKanojia
Copy link
Member

Possible alternative solution for part 1 : #2029 (comment)

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

No branches or pull requests

2 participants