Skip to content

Conversation

@nimish-ks
Copy link
Member

@nimish-ks nimish-ks commented Jan 22, 2024

This PR adds support for the following new features as well as minor fixes and refactors:

  • Automatic re-deployment
  • Support for native kubernetes tls secrets eg. kubernetes.io/tls
  • Support for filtering secrets based on phaseAppEnvTag.
  • Support for secret processors and name transformers

Tests:

  1. Automatic re-deployments:

Add to any deployment:

  annotations:
    secrets.phase.dev/redeploy: "true"

Example:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: env-echo
  labels:
    app: env-echo
  annotations:
    secrets.phase.dev/redeploy: "true"
spec:
  replicas: 1
  selector:
    matchLabels:
      app: env-echo
  template:
    metadata:
      labels:
        app: env-echo
    spec:
      containers:
        - name: echo
          image: mendhak/http-https-echo
          ports:
            - containerPort: 80
          env:
            - name: ECHO_INCLUDE_ENV_VARS
              value: "1"
          envFrom:
            - secretRef:
                name: my-application-secret
  1. kubernetes.io/tls secret type and tags filters and secret name processors

CR:

apiVersion: secrets.phase.dev/v1alpha1
kind: PhaseSecret
metadata:
  name: example-phase-secret
  namespace: default
spec:
  phaseAppEnv: "prod"
  phaseAppEnvTag: "certs" # This is the tag used to filter for this secret
  phaseHost: "https://console.phase.dev"
  authentication:
    serviceToken:
      serviceTokenSecretReference:
        secretName: "phase-service-token"
        secretNamespace: "default"
  managedSecretReferences:
    - secretName: "my-tls-secret"
      secretNamespace: "default"
      secretType: "kubernetes.io/tls"
      processors:
        PKCS12_CERTIFICATE:
          asName: "tls.crt"
          type: "base64"
        PKCS12_PRIVATE_KEY:
          asName: "tls.key"
          type: "base64"

PKCS12_CERTIFICATE:

LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUN6RENDQWllZ0F3SUJBZ0lSQUk4VjluK2F3RmJ5MjA3YklUekFLQmdncWhrak9QUVFEQWpBaE1STXdFUVlEVlFRREV3MUpkSGRwZEhSbGNsOHRZV2RwYm1jaU1Td0dBMVVFQXd3YlEyeHBZMkYwWlM1amIyMHdIaGNOTWpBd016QTNN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N1EwN05CbUdQOGN4YU5WQ3Q5V0JyZ0NZVjB3ZUZaQ1RvQXZjYk1TSzBieGx4M3ZzQnZZbG9lUT09Ci0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0K

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 22, 2024

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: f78ac67
Status: ✅  Deploy successful!
Preview URL: https://1dd37ce6.helm-repo-kubernetes-secrets-operator.pages.dev
Branch Preview URL: https://feat--auto-redeploy.helm-repo-kubernetes-secrets-operator.pages.dev

View logs

@nimish-ks nimish-ks changed the title Phase Kubernetes Operator v1.0 Phase Kubernetes Operator v1.0.0 Jan 23, 2024
Copy link
Member

@rohan-chaturvedi rohan-chaturvedi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nimish-ks Lets add the test suite to the github actions workflow, and add some instructions on running them locally in the Readme

@nimish-ks
Copy link
Member Author

@nimish-ks Lets add the test suite to the github actions workflow, and add some instructions on running them locally in the Readme

having some trouble fixing the python imports. will do in a separate PR. let's roll this out.

@nimish-ks nimish-ks merged commit bf39964 into main Jan 27, 2024
@nimish-ks nimish-ks deleted the feat--auto-redeploy branch January 27, 2024 08:19
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.

3 participants